-
Notifications
You must be signed in to change notification settings - Fork 3
/
MRPLUGIN_ILMerge.xml
246 lines (214 loc) · 19.6 KB
/
MRPLUGIN_ILMerge.xml
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
<?xml version="1.0" encoding="UTF-8"?>
<!--
ilmerge
[/lib:directory]* - set /lib for each directory X
[/log[:filename]] X
[/keyfile:filename] X
[/delaysign]] X
[/internalize[:filename]] X
[/t[arget]:(library|exe|winexe)] X
[/closed] X
[/ndebug] X
[/ver:version] X
[/copyattrs [/allowMultiple]] X
[/xmldocs] X
[/attr:filename] X
([/targetplatform:<version>[,<platformdir>]]|v1|v1.1|v2|v4)
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.1
[/useFullPublicKeyForReferences] X
[/zeroPeKind] X
[/wildcards] X
[/allowDup[:typename]]* X
[/allowDuplicateResources] X
[/union] X
[/align:n]
/out:filename <primary assembly> [<other assemblies>...] X
-->
<meta-runner name="ILMerge">
<description>Run ILMerge within TeamCity</description>
<settings>
<parameters>
<!-- Mandatory Fields -->
<param name="teamcity.tool.microsoft.ilmerge.outputFile" value="" spec="text description='/out:filename [primary assembly] Specifies the path and filename that the target assembly will be written to.' display='normal' label='Output file:' validationMode='not_empty'" />
<param name="teamcity.tool.microsoft.ilmerge.inputFiles" value="" spec="text description='[other assemblies...] Contains the path and filename of an input assembly. The first element of the array is considered to be the primary assembly' display='normal' label='Input assembly:' validationMode='not_empty'" />
<!-- Optional Fields -->
<param name="teamcity.tool.microsoft.ilmerge.lib" value="" spec="text description='[/lib:directory] Sets the directories to be used to search for input assemblies' display='normal' label='Search Directories:' validationMode=''" />
<param name="teamcity.tool.microsoft.ilmerge.log" value="" spec="text description='[/log[:filename]] The path and filename that log messages are written to' display='normal' label='Log:' validationMode=''" />
<param name="teamcity.tool.microsoft.ilmerge.keyfile" value="" spec="text description='[/keyfile:filename] Specifies the path and filename to a .snk file. The target assembly will be signed with its contents and will then have a strong name. It can be used with the DelaySign property to have the target assembly delay signed. This can be done even if the primary assembly was fully signed.' display='normal' label='Key File' validationMode=''" />
<param name="teamcity.tool.microsoft.ilmerge.delaysign" value="" spec="checkbox checkedValue='true' uncheckedValue='false' description='[/delaysign]] When this is set the target assembly will be delay signed. This can be set only in conjunction with the /keyfile option' display='normal' label='Delay Sign' validationMode='any'" />
<param name="teamcity.tool.microsoft.ilmerge.internalize" value="" spec="text description='[/internalize[:filename]] This controls whether types in assemblies other than the primary assembly have their visibility modified. When it is true, then all non-exempt types that are visible outside of their assembly have their visibility modified so that they are not visible from outside of the merged assembly. A type is exempt if its full name matches a line from the ExcludeFile using the .NET regular expression engine.' display='normal' label='Internalize:' validationMode=''" />
<param name="teamcity.tool.microsoft.ilmerge.target" value="" spec="select data_1='library' data_3='exe' data_5='winexe' description='[/t[arget]:(library|exe|winexe)] This controls whether the target assembly is created as a library, a console application or as a Windows application. When it is not specified, then the target assembly will be the same kind as that of the primary assembly. (In that case, the file extensions found on the specified target assembly and the primary assembly must match.) When it is specified, then the file extension of the target assembly must match the specification.' display='normal' label='Target:' label_1='Library' label_3='Console App' label_5='Windows App'" />
<param name="teamcity.tool.microsoft.ilmerge.closed" value="" spec="checkbox checkedValue='true' uncheckedValue='false' description='[/closed] When this is set before calling Merge, then the transitive closure of the input assemblies is computed and added to the list of input assemblies. An assembly is considered part of the transitive closure if it is referenced, either directly or indirectly, from one of the originally specified input assemblies and it has an external reference to one of the input assemblies, or one of the assemblies that has such a reference' display='normal' label='Closed:' validationMode='any'" />
<param name="teamcity.tool.microsoft.ilmerge.ndebug" value="" spec="checkbox checkedValue='true' uncheckedValue='false' description='[/ndebug] When this is set to true, ILMerge creates a .pdb file for the output assembly and merges into it any .pdb files found for input assemblies.' display='normal' label='Debug' validationMode='any'" />
<param name="teamcity.tool.microsoft.ilmerge.ver" value="" spec="text description='[/ver:version] When set, the target assembly will be given its value as the version number of the assembly. When specified on the command line, the version is read in as a string and should look like 6.2.1.3. The version must be a valid assembly version as defined by the attribute AssemblyVersion in the System.Reflection namespace.' display='normal' label='Version:' validationMode=''" />
<param name="teamcity.tool.microsoft.ilmerge.copyattrs" value="" spec="checkbox checkedValue='true' uncheckedValue='false' description='[/copyattrs] When set, the assembly level attributes of each input assembly are copied over into the target assembly. Any duplicate attribute overwrites a previously copied attribute. If you want to allow duplicates (for those attributes whose type specifies AllowMultiple in their definition), then you can also set the allowMultiple flag. The input assemblies are processed in the order they are specified. This option is mutually exclusive with specifying an attribute assembly, i.e., the property AttributeFile. When an attribute assembly is specified, then no assembly-level attributes are copied over from the input assemblies.' display='normal' label='Copy Attributes:' validationMode='any'" />
<param name="teamcity.tool.microsoft.ilmerge.allowMultiple" value="" spec="checkbox checkedValue='true' uncheckedValue='false' description='[/allowMultiple] When this is set before calling Merge, then if the CopyAttributes property is also set, any assembly-level attributes names that have the same type are copied over into the target directory as long as the definition of the attribute type specifies that AllowMultiple is true' display='normal' label='Allow Multiple Attributes:' validationMode='any'" />
<param name="teamcity.tool.microsoft.ilmerge.xmldocs" value="" spec="checkbox checkedValue='true' uncheckedValue='false' description='[/xmldocs] Controls whether XML documentation files are merged to produce an XML documentation file for the target assembly' display='normal' label='XML Documentation:' validationMode='any'" />
<param name="teamcity.tool.microsoft.ilmerge.attr" value="" spec="text description='[/attr:filename] Specifies the path and filename to an atttribute assembly, an assembly that will be used to get all of the assembly-level attributes such as Culture, Version, etc. It will also be used to get the Win32 Resources from. It is mutually exclusive with the CopyAttributes. When it is not specified, then the Win32 Resources from the primary assembly are copied over into the target assembly. If it is not a full path, then the current directory is used.' display='normal' label='Attribute Assembly File Path:' validationMode=''" />
<param name="teamcity.tool.microsoft.ilmerge.targetplatform" value="" spec="select data_1='v3.5' data_2='v4.0' data_3='v4.5' data_4='v4.5.1' data_5='v4.5.2' data_6='v4.6' data_7='v4.6.1' data_8='v4.6.2' data_9='v4.7' data_10='v4.7.1' description='([/targetplatform:version[,platformdir]]|v1|v1.1|v2|v4) This method sets the .NET Framework for the target assembly to be the one specified by platform. Valid strings for the first argument are v1, v1.1, v2, and v4. The v is case insensitive and is also optional. This way ILMerge can be used to cross-compile, i.e., it can run in one version of the framework and generate the target assembly so it will run under a different assembly. The second argument is the directory in which mscorlib.dll is to be found.' display='normal' label='Target Platform:' label_1='v3.5' label_2='v4.0' label_3='v4.5' label_4='v4.5.1' label_5='v4.5.2' label_6='v4.6' label_7='v4.6.1' label_8='v4.6.2' label_9='v4.7' label_10='v4.7.1' " />
<param name="teamcity.tool.microsoft.ilmerge.useFullPublicKeyForReferences" value="" spec="checkbox checkedValue='true' uncheckedValue='false' description='[/useFullPublicKeyForReferences] Indicates whether external assembly references in the manifest of the target assembly will use full public keys (false) or public key tokens (true).' display='normal' label='Use Full Public Key For References:' validationMode='any'" />
<param name="teamcity.tool.microsoft.ilmerge.zeroPeKind" value="" spec="checkbox checkedValue='true' uncheckedValue='false' description='[/zeroPeKind] If an assemblys PeKind flag (this is the value of the field listed as .corflags in the Manifest) is zero it will be treated as if it was IL only. This can be used to allow C++ assemblies to be merged; it does not appear that the C++ compiler writes the value as ILonly. However, if such an assembly has any non-IL features, then they will probably not be copied over into the target assembly correctly. So please use this option with caution.' display='normal' label='Zero PeKind:' validationMode='any'" />
<param name="teamcity.tool.microsoft.ilmerge.wildcards" value="" spec="checkbox checkedValue='true' uncheckedValue='false' description='[/wildcards] Any wild cards in file names are expanded and all matching files will be used as input. Note that because the wild card matching is done by a call to Directory.GetFiles, it does not allow the characters .. to appear in a file name. So if you want to specify a relative path containing .. to move up a directory, you will have to use it with the /lib option. That option does allow the use of .. to move up directories.' display='normal' label='Wildcards' validationMode='any'" />
<param name="teamcity.tool.microsoft.ilmerge.allowDup" value="" spec="checkbox checkedValue='true' uncheckedValue='false' description='[/allowDup] The normal behavior of ILMerge is to not allow there to be more than one public type with the same name. If such a duplicate is found, then an exception is thrown...' display='normal' label='Allow Duplicates:' validationMode='any'" />
<param name="teamcity.tool.microsoft.ilmerge.renameDup" value="" spec="text description='[/allowDup[:typename]]* ...however, ILMerge can just rename the type so that it no longer causes a conflict. For private types, this is not a problem since no outside client can see it anyway, so ILMerge just does the renaming by default. For public types, it is not often a useful feature to have it renamed. However, there are situations where it is needed. In particular, for obfuscated assemblies, it seems that the obfuscator defines an attribute and creates an assembly-level attribute for the obfuscated assembly using that attribute. This would mean that obfuscated assemblies cannot be merged.
So this option allows the user to either allow all public types to be renamed when they are duplicates, or to specify it for arbitrary type names. On the command line, there can be as many options as desired, if followed by a colon and a type name, otherwise just specify it alone with no colon (and type name) to allow all duplicates.' display='normal' label='Allow Duplicates (Rename Types):' validationMode=''" />
<param name="teamcity.tool.microsoft.ilmerge.allowDuplicateResources" value="" spec="checkbox checkedValue='true' uncheckedValue='false' description='[/allowDuplicateResources]' display='normal' label='Allow Duplicate Resources:' validationMode='any'" />
<param name="teamcity.tool.microsoft.ilmerge.union" value="" spec="checkbox checkedValue='true' uncheckedValue='false' description='[/union] When this is true, then types with the same name are all merged into a single type in the target assembly. The single type is the union of all of the individual types in the input assemblies: it contains all of the members from each of the corresponding types in the input assemblies. It cannot be specified at the same time as /allowDup.' display='normal' label='Union' validationMode='any'" />
<param name="teamcity.tool.microsoft.ilmerge.align" value="" spec="text description='[/align:n] This controls the file alignment used for the target assembly. The setter sets the value to the largest power of two that is no larger than the supplied argument, and is at least 512.' display='normal' label='Align:' validationMode=''" />
</parameters>
<build-runners>
<runner name="ILMerge" type="jetbrains_powershell">
<parameters>
<param name="jetbrains_powershell_execution" value="PS1" />
<param name="jetbrains_powershell_noprofile" value="true" />
<param name="jetbrains_powershell_errorToError" value="error" />
<param name="jetbrains_powershell_script_mode" value="CODE" />
<param name="jetbrains_powershell_bitness" value="x86" />
<param name="jetbrains_powershell_minVersion" value="3.0" />
<param name="teamcity.step.mode" value="default" />
<param name="jetbrains_powershell_script_code">
<![CDATA[
$toolPath = "`"%teamcity.agent.tools.dir%\ilmerge-metarunner\bin\ilmerge.exe`"";
$inputFiles = '%teamcity.tool.microsoft.ilmerge.inputFiles%'
$outputFile = '%teamcity.tool.microsoft.ilmerge.outputFile%'
$lib = "%teamcity.tool.microsoft.ilmerge.lib%"
$log = "%teamcity.tool.microsoft.ilmerge.log%"
$keyfile = "%teamcity.tool.microsoft.ilmerge.keyfile%"
$delaysign = "%teamcity.tool.microsoft.ilmerge.delaysign%"
$internalize = "%teamcity.tool.microsoft.ilmerge.internalize%"
$target = "%teamcity.tool.microsoft.ilmerge.target%"
$closed = "%teamcity.tool.microsoft.ilmerge.closed%"
$ndebug = "%teamcity.tool.microsoft.ilmerge.ndebug%"
$ver = "%teamcity.tool.microsoft.ilmerge.ver%"
$copyattrs = "%teamcity.tool.microsoft.ilmerge.copyattrs%"
$allowMultiple = "%teamcity.tool.microsoft.ilmerge.allowMultiple%"
$xmldocs = "%teamcity.tool.microsoft.ilmerge.xmldocs%"
$attr = "%teamcity.tool.microsoft.ilmerge.attr%"
$targetplatform = "%teamcity.tool.microsoft.ilmerge.targetplatform%"
$useFullPublicKeyForReferences = "%teamcity.tool.microsoft.ilmerge.useFullPublicKeyForReferences%"
$zeroPeKind = "%teamcity.tool.microsoft.ilmerge.zeroPeKind%"
$wildcards = "%teamcity.tool.microsoft.ilmerge.wildcards%"
$allowDup = "%teamcity.tool.microsoft.ilmerge.allowDup%"
$renameDup = "%teamcity.tool.microsoft.ilmerge.renameDup%"
$allowDuplicateResources = "%teamcity.tool.microsoft.ilmerge.allowDuplicateResources%"
$union = "%teamcity.tool.microsoft.ilmerge.union%"
$align = "%teamcity.tool.microsoft.ilmerge.align%"
try
{
$command = "";
if (![String]::IsNullOrEmpty($lib)){
$command += " /lib:" + $lib;
}
if (![String]::IsNullOrEmpty($log)){
$command += " /log:" + $log;
}
if (![String]::IsNullOrEmpty($keyfile)){
$command += " /keyfile:" + $keyfile;
if ($delaysign -eq "true"){
$command += " /delaysign";
}
}
if (![String]::IsNullOrEmpty($internalize)){
$command += " /internalize:" + $internalize;
}
if (![String]::IsNullOrEmpty($target)){
$command += " /target:" + $target;
}
if ($closed -eq "true"){
$command += " /closed";
}
if ($ndebug -eq "true"){
$command += " /ndebug";
}
if (![String]::IsNullOrEmpty($ver)){
$command += " /ver:" + $ver;
}
if ($copyattrs -eq "true"){
$command += " /copyattrs";
}
if ($allowMultiple -eq "true"){
$command += " /allowMultiple";
}
if ($xmldocs -eq "true"){
$command += " /xmldocs";
}
if (![String]::IsNullOrEmpty($attr)){
$command += " /attr:" + $attr;
}
if (![String]::IsNullOrEmpty($targetplatform)){
$command += " /targetplatform:";
switch ($targetplatform)
{
"v3.5" { $command += "`"v2,C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5`""; }
"v4.0" { $command += "`"v4,C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0`""; }
"v4.5" { $command += "`"v4,C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5`""; }
"v4.5.1" { $command += "`"v4,C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1`""; }
"v4.5.2" { $command += "`"v4,C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2`""; }
"v4.6" { $command += "`"v4,C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6`""; }
"v4.6.1" { $command += "`"v4,C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1`""; }
"v4.6.2" { $command += "`"v4,C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2`""; }
"v4.7" { $command += "`"v4,C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7`""; }
"v4.7.1" { $command += "`"v4,C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.1`""; }
}
}
if ($useFullPublicKeyForReferences -eq "true"){
$command += " /useFullPublicKeyForReferences";
}
if ($zeroPeKind -eq "true"){
$command += " /zeroPeKind";
}
if ($wildcards -eq "true"){
$command += " /wildcards";
}
if ($allowDup -eq "true"){
$command += " /allowDup";
if (![String]::IsNullOrEmpty($renameDup)){
$command += ":" + $renameDup;
}
}
if ($allowDuplicateResources -eq "true"){
$command += " /allowDuplicateResources";
}
if ($union -eq "true"){
$command += " /union";
}
if (![String]::IsNullOrEmpty($align)){
$command += " /align:" + $align;
}
if ([String]::IsNullOrEmpty($inputFiles)){
throw "Input files are required"
} else {
$command += " " + $inputFiles;
}
if ([String]::IsNullOrEmpty($outputFile)){
throw "Output files are required"
} else {
$command += " /out:" + $outputFile;
}
$commandToExecute = "& " + $toolPath + $command
Write-Host "Command to Execute: " $commandToExecute
$result = Invoke-Expression $commandToExecute
Write-Host $result
}
catch
{
Write-Error $_
[System.Environment]::Exit(1)
}
]]>
</param>
</parameters>
</runner>
</build-runners>
<requirements />
</settings>
</meta-runner>