-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathUnityScript.Build.targets
245 lines (197 loc) · 7.96 KB
/
UnityScript.Build.targets
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
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask
TaskName="UnityScript.Build.Tasks.CreateUnityScriptManifestResourceName"
AssemblyFile="UnityScript.Build.Tasks.dll" />
<UsingTask
TaskName="UnityScript.Build.Tasks.US"
AssemblyFile="UnityScript.Build.Tasks.dll"/>
<PropertyGroup>
<MSBuildAllProjects Condition="'$(UnityScriptBinPath)' != ''">
$(MSBuildAllProjects);$(UnityScriptBinPath)\UnityScript.Build.targets
</MSBuildAllProjects>
<MSBuildAllProjects Condition="'$(UnityScriptBinPath)' == ''">
$(MSBuildAllProjects);$(MSBuildBinPath)\UnityScript.Build.targets
</MSBuildAllProjects>
<DefaultLanguageSourceExtension>.us</DefaultLanguageSourceExtension>
<Language>UnityScript</Language>
</PropertyGroup>
<!--
The CreateManifestResourceNames target create the manifest resource names
from the .RESX files.
[IN]
@(ResxWithNoCulture) - The names the non-culture .RESX files.
@(ResxWithCulture) - The names the culture .RESX files.
@(NonResxWithNoCulture) - The names of the non-culture non-RESX
files (like bitmaps, etc).
@(NonResxWithCulture) - The names of the culture non-RESX
files (like bitmaps, etc).
[OUT]
@(ManifestResourceWithNoCultureName) - The corresponding manifest
resource name (.RESOURCE)
@(ManifestResourceWithCultureName) - The corresponding manifest
resource name (.RESOURCE)
@(ManifestNonResxWithNoCulture) - The corresponding manifest
resource name.
@(ManifestNonResxWithCulture) - The corresponding manifest
resource name.
For Boo applications the transformation is like:
Resources1.resx => RootNamespace.Resources1 => Build into main assembly
SubFolder\Resources1.resx =>
RootNamespace.SubFolder.Resources1 =>
Build into main assembly
Resources1.fr.resx =>
RootNamespace.Resources1.fr =>
Build into satellite assembly
Resources1.notaculture.resx =>
RootNamespace.Resources1.notaculture =>
Build into main assembly
For other project systems, this transformation may be different.
-->
<PropertyGroup>
<CreateManifestResourceNamesDependsOn>
</CreateManifestResourceNamesDependsOn>
</PropertyGroup>
<Target
Name="CreateManifestResourceNames"
DependsOnTargets="$(CreateManifestResourceNamesDependsOn)"
>
<CallTarget Targets="CreateManifestResourceNames_35" Condition="'$(MSBuildToolsVersion)' == '3.5'"/>
<CallTarget Targets="CreateManifestResourceNames_20" Condition="'$(MSBuildToolsVersion)' != '3.5'"/>
</Target>
<Target
Name="CreateManifestResourceNames_20"
Condition="'
@(ResxWithNoCulture)
@(ResxWithCulture)
@(NonResxWithNoCulture)
@(NonResxWithCulture)'!=''"
>
<!-- Create the target resource names for non-culture resx files -->
<CreateUnityScriptManifestResourceName
Condition="'@(ResxWithNoCulture)'!=''"
ResourceFiles="@(ResxWithNoCulture)"
RootNamespace="$(RootNamespace)">
<Output
TaskParameter="ManifestResourceNames"
ItemName="ManifestResourceWithNoCultureName"/>
</CreateUnityScriptManifestResourceName>
<!-- Create the target resource names for culture resx files. -->
<CreateUnityScriptManifestResourceName
Condition="'@(ResxWithCulture)'!=''"
ResourceFiles="@(ResxWithCulture)"
RootNamespace="$(RootNamespace)">
<Output
TaskParameter="ManifestResourceNames"
ItemName="ManifestResourceWithCultureName"/>
</CreateUnityScriptManifestResourceName>
<!-- Create the target resource names for non-culture non-resx files. -->
<CreateUnityScriptManifestResourceName
Condition="'@(NonResxWithNoCulture)'!=''"
ResourceFiles="@(NonResxWithNoCulture)"
RootNamespace="$(RootNamespace)">
<Output
TaskParameter="ManifestResourceNames"
ItemName="ManifestNonResxWithNoCulture"/>
</CreateUnityScriptManifestResourceName>
<!-- Create the target resource names for culture non-resx files. -->
<CreateUnityScriptManifestResourceName
Condition="'@(NonResxWithCulture)'!=''"
ResourceFiles="@(NonResxWithCulture)"
RootNamespace="$(RootNamespace)">
<Output
TaskParameter="ManifestResourceNames"
ItemName="ManifestNonResxWithCulture"/>
</CreateUnityScriptManifestResourceName>
</Target>
<Target
Name="CreateManifestResourceNames_35"
Condition="'@(EmbeddedResource)' != ''"
>
<ItemGroup>
<_Temporary Remove="@(_Temporary)" />
</ItemGroup>
<CreateUnityScriptManifestResourceName
ResourceFiles="@(EmbeddedResource)"
RootNamespace="$(RootNamespace)"
Condition="'%(EmbeddedResource.ManifestResourceName)' == ''">
<Output TaskParameter="ResourceFilesWithManifestResourceNames" ItemName="_Temporary" />
</CreateUnityScriptManifestResourceName>
<ItemGroup>
<EmbeddedResource Remove="@(EmbeddedResource)" Condition="'%(EmbeddedResource.ManifestResourceName)' == ''"/>
<EmbeddedResource Include="@(_Temporary)" />
<_Temporary Remove="@(_Temporary)" />
</ItemGroup>
</Target>
<PropertyGroup>
<!--
"None" is not technically a valid DebugType, so we can't pass it
in as such to the compiler. So here, we modify the properties so
they make sense.
-->
<DebugSymbols Condition="'$(DebugType)' == 'none'">false</DebugSymbols>
<DebugType Condition="'$(DebugType)' == 'none'"></DebugType>
<!-- Provide a facility to override UseHostCompilerIfAvailable-->
<UseHostCompilerIfAvailable Condition="'$(UseHostCompilerIfAvailable)' == ''">true</UseHostCompilerIfAvailable>
</PropertyGroup>
<ItemGroup>
<DocFileItem Include="$(DocumentationFile)" Condition="'$(DocumentationFile)'!=''">
<InProject>false</InProject>
</DocFileItem>
</ItemGroup>
<PropertyGroup>
<CoreCompileDependsOn>_ComputeNonExistentFileProperty</CoreCompileDependsOn>
</PropertyGroup>
<PropertyGroup Condition=" '$(UnityScriptToolPath)' != '' ">
<ReferencePath>$(ReferencePath);$(UnityScriptToolPath)</ReferencePath>
</PropertyGroup>
<PropertyGroup Condition=" '$(UnityScriptToolPath)' == '' ">
<ReferencePath>$(ReferencePath);$(UnityScriptBinPath)</ReferencePath>
</PropertyGroup>
<Target
Name="CoreCompile"
Inputs="$(MSBuildAllProjects);
@(Compile);
@(ManifestResourceWithNoCulture);
$(ApplicationIcon);
$(AssemblyOriginatorKeyFile);
@(ManifestNonResxWithNoCultureOnDisk);
@(ReferencePath);
@(CompiledLicenseFile)"
Outputs="@(IntermediateAssembly)"
DependsOnTargets="$(CoreCompileDependsOn)">
<US
DefineSymbols="$(DefineConstants)"
EmitDebugInformation="$(DebugSymbols)"
GenerateFullPaths="$(GenerateFullPaths)"
OutputAssembly="@(IntermediateAssembly)"
References="@(ReferencePath)"
Resources="@(ManifestResourceWithNoCulture);
@(ManifestNonResxWithNoCultureOnDisk);
@(CompiledLicenseFile)"
ResponseFiles="$(CompilerResponseFile)"
SourceDirectories="$(SourceDirectories)"
Sources="@(Compile)"
TargetType="$(OutputType)"
ToolPath="$(UnityScriptToolPath)"
Verbose="$(Verbose)"
BaseClass="$(BaseClass)"
Method="$(Method)"
Expando="$(Expando)"
Imports="$(Imports)"
Pragmas="$(Pragmas)"
TypeInferenceRuleAttribute="$(TypeInferenceRuleAttribute)"
SuppressedWarnings="$(NoWarn)"
/>
<Copy
Condition=" ('$(UnityScriptToolPath)' == '') and ('$(CopyUnityScriptLangToOutput)' != 'false') "
SkipUnchangedFiles="true"
SourceFiles="$(UnityScriptBinPath)\UnityScript.Lang.dll"
DestinationFolder="$(OutputPath)"/>
<Copy
Condition=" ('$(UnityScriptToolPath)' != '') and ('$(CopyUnityScriptLangToOutput)' != 'false') "
SkipUnchangedFiles="true"
SourceFiles="$(UnityScriptToolPath)\UnityScript.Lang.dll"
DestinationFolder="$(OutputPath)"/>
</Target>
<Import Project="$(MSBuildBinPath)\Microsoft.Common.targets" />
</Project>