-
Notifications
You must be signed in to change notification settings - Fork 14
/
manifest.ps1
55 lines (48 loc) · 2.01 KB
/
manifest.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Param (
[string]$project = $env:APPVEYOR_PROJECT_NAME,
[string]$version = $env:APPVEYOR_BUILD_VERSION
)
$postfix = '_' + $version -replace '\.','-'
$v1,$v2,$v3,$v4 = $version.split('.')
Set-Content 'version.h' "#define VER_FILENAME $project"
Add-Content 'version.h' "#define VERSION_FULL $version"
Add-Content 'version.h' "#define VERSION_MAJOR $v1"
Add-Content 'version.h' "#define VERSION_MINOR $v2"
Add-Content 'version.h' "#define VERSION_REVISION $v3"
Add-Content 'version.h' "#define VERSION_BUILD $v4"
$encoding = [System.Text.Encoding]::UTF8
$writer = New-Object System.XMl.XmlTextWriter('./manifest.xml', $encoding)
$writer.Formatting = 'Indented'
$writer.Indentation = 1
$writer.IndentChar = "`t"
$writer.WriteStartDocument()
$writer.WriteStartElement('bundle')
$writer.WriteAttributeString('xmlns', 'http://v8.1c.ru/8.2/addin/bundle')
$writer.WriteStartElement('component')
$writer.WriteAttributeString('type', 'native')
$writer.WriteAttributeString('os', 'Windows')
$writer.WriteAttributeString('arch', 'i386')
$writer.WriteAttributeString('path', "${project}Win32${postfix}.dll")
$writer.WriteEndElement();
$writer.WriteStartElement('component')
$writer.WriteAttributeString('type', 'native')
$writer.WriteAttributeString('os', 'Windows')
$writer.WriteAttributeString('arch', 'x86_64')
$writer.WriteAttributeString('path', "${project}Win64${postfix}.dll")
$writer.WriteEndElement();
$writer.WriteStartElement('component')
$writer.WriteAttributeString('type', 'native')
$writer.WriteAttributeString('os', 'Linux')
$writer.WriteAttributeString('arch', 'i386')
$writer.WriteAttributeString('path', "${project}Lin32${postfix}.so")
$writer.WriteEndElement();
$writer.WriteStartElement('component')
$writer.WriteAttributeString('type', 'native')
$writer.WriteAttributeString('os', 'Linux')
$writer.WriteAttributeString('arch', 'x86_64')
$writer.WriteAttributeString('path', "${project}Lin64${postfix}.so")
$writer.WriteEndElement();
$writer.WriteEndElement();
$writer.WriteEndDocument()
$writer.Flush()
$writer.Close()