forked from rsdn/nemerle
/
NemerleAll-4.0.nproj
223 lines (211 loc) · 13.3 KB
/
NemerleAll-4.0.nproj
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
<Project DefaultTargets="DevBuild2Stage" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<UsingTask TaskName="MSBuild.Community.Tasks.FileUpdate" AssemblyFile="$(MSBuildProjectDirectory)\ExternalDependences\MSBuild.Community.Tasks.dll" />
<PropertyGroup Condition=" '$(NTargetName)' == '' ">
<NTargetName>Rebuild</NTargetName>
</PropertyGroup>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<!--Folder for Nemerle installation. To install use "Install" terget.-->
<NInstall Condition=" '$(NInstall)' == '' ">$(ProgramFiles)\Nemerle</NInstall>
<!--Path to root directory of Nemerle sources.-->
<NRoot>$(MSBuildProjectDirectory)</NRoot>
<!--Path to boot compiler.-->
<NBoot>$(NRoot)\boot-4.0\</NBoot>
<!--Path to stages output directory (including current configuration subfolder).-->
<NBin>$(NRoot)\bin\$(Configuration)</NBin>
<NObj>$(NRoot)\obj\$(Configuration)</NObj>
</PropertyGroup>
<!--Project required to build any Nemerle project (.nproj)-->
<ItemGroup>
<NTasksProject Include="$(NRoot)\Nemerle.MSBuild.Tasks-4.0.csproj" />
</ItemGroup>
<!--Projects related only to compiler.-->
<ItemGroup>
<NCompilerProject Include="$(NRoot)\Nemerle-4.0.nproj" />
<NCompilerProject Include="$(NRoot)\Nemerle.Compiler-4.0.nproj" />
<NCompilerProject Include="$(NRoot)\Nemerle.Macros-4.0.nproj" />
<NCompilerProject Include="$(NRoot)\ncc-4.0.nproj" />
</ItemGroup>
<!--Projects related to integration-->
<ItemGroup>
<NIntegrationProject Include="$(NRoot)\VsIntegration\ComInteropHelper\ComInteropHelper.csproj" />
<NIntegrationProject Include="$(NRoot)\VsIntegration\Nemerle.VisualStudio\GUI\WpfHint\WpfHint.csproj" />
<NIntegrationProject Include="$(NRoot)\VsIntegration\Nemerle.Compiler.Utils\Nemerle.Compiler.Utils.csproj" />
<NIntegrationProject Include="$(NRoot)\VsIntegration\Nemerle.VisualStudio\Nemerle.VisualStudio.csproj" />
<NIntegrationProject Include="$(NRoot)\VsIntegration\Nemerle.VsIntegration.Tests\Nemerle.VsIntegration.Tests.csproj" />
<NIntegrationProject Include="$(NRoot)\VsIntegration\Nemerle.Compiler.Utils.Tests\Nemerle.Compiler.Utils.Tests.csproj" />
<NIntegrationProject Include="$(NRoot)\Linq\Macro\Linq.nproj" />
<NIntegrationProject Condition=" '$(Configuration)' != 'Debug' " Include="$(NRoot)\VsIntegration\Shell\NemerleStudio\NemerleStudio.vcproj" />
<NIntegrationProject Condition=" '$(Configuration)' != 'Debug' " Include="$(NRoot)\VsIntegration\Shell\NemerleStudioUI\NemerleStudioUI.vcproj" />
<NIntegrationProject Condition=" '$(Configuration)' != 'Debug' " Include="$(NRoot)\tools\Nemerle.Evaluation.nproj" />
<NIntegrationProject Condition=" '$(Configuration)' != 'Debug' " Include="$(NRoot)\tools\nemish.nproj" />
<NIntegrationProject Condition=" '$(Configuration)' != 'Debug' " Include="$(NRoot)\tools\Nemerle.NAnt.Tasks.nproj" />
<NIntegrationProject Condition=" '$(Configuration)' != 'Debug' " Include="$(NRoot)\tools\reflector-addon\reflector-addon.nproj" />
</ItemGroup>
<!--Initialize FX and SDK tools locations-->
<Target Name="InitTools">
<GetFrameworkPath>
<Output TaskParameter="FrameworkVersion35Path" PropertyName="FW35" />
<Output TaskParameter="FrameworkVersion20Path" PropertyName="FW20" />
</GetFrameworkPath>
<GetFrameworkSdkPath>
<Output TaskParameter="Path" PropertyName="SDK_3" />
</GetFrameworkSdkPath>
<PropertyGroup>
<!-- HACK: GetFrameworkSdkPath must be fixed for .Net 4.0 -->
<SDK>$(SDK_3)\bin\NETFX 4.0 Tools</SDK>
<GacUtil>"$(SDK4)\gacutil.exe"</GacUtil>
<Ildasm>"$(SDK)\ildasm.exe"</Ildasm>
<PEVerify>"$(SDK)\peverify.exe"</PEVerify>
<NGen>"$(FW20)\ngen.exe"</NGen>
<MSBuild>$(MSBuildBinPath)\msbuild.exe</MSBuild>
<Junction>$(NRoot)\ExternalDependences\junction.exe</Junction>
</PropertyGroup>
<Message Text="Framework tools found at:" Importance="high" />
<Message Text=" MSBuild - $(MSBuild)" Importance="high" />
<Message Text=" NGen - $(NGen)" Importance="high" />
<Message Text="SDK tools found at:" Importance="high" />
<Message Text=" GacUtil - $(GacUtil)" Importance="high" />
<Message Text=" Ildasm - $(Ildasm)" Importance="high" />
<Message Text=" PEVerify - $(PEVerify)" Importance="high" />
<Message Text="ExternalDependences:" Importance="high" />
<Message Text=" Junction - $(Junction)" Importance="high" />
</Target>
<!--Builds and deploy tasks dll into boot directory-->
<Target Name="NTasks" DependsOnTargets="InitTools">
<MSBuild Projects="@(NTasksProject)" Properties="OutputPath=$(NBoot); IntermediateOutputPath=$(NObj)\Tasks\" Targets="$(NTargetName)" />
<CreateItem Include="$(NBoot)\Nemerle.MSBuild.Tasks.dll">
<Output ItemName="NTasksFiles" TaskParameter="Include" />
</CreateItem>
<CreateItem Include="$(NBoot)\Nemerle.MSBuild.targets">
<Output ItemName="NTasksFiles" TaskParameter="Include" />
</CreateItem>
</Target>
<!--Builds compiler using boot-->
<Target Name="Stage1" DependsOnTargets="NTasks">
<PropertyGroup>
<NPrevBin>$(NBoot)</NPrevBin>
<NCurBin>$(NBin)\Stage1\</NCurBin>
<NCurObj>$(NObj)\Stage1\</NCurObj>
</PropertyGroup>
<MSBuild Projects="@(NCompilerProject)" Properties="OutputPath=$(NCurBin); DefineConstants=NET_4_0;TRACE; IntermediateOutputPath=$(NCurObj); Nemerle=$(NPrevBin)" Targets="$(NTargetName)" />
<Copy SourceFiles="@(NTasksFiles)" DestinationFolder="$(NCurBin)" />
</Target>
<!--Builds compiler using Stage1-->
<Target Name="Stage2" DependsOnTargets="Stage1">
<PropertyGroup>
<NPrevBin>$(NBin)\Stage1\</NPrevBin>
<NCurBin>$(NBin)\Stage2\</NCurBin>
<NCurObj>$(NObj)\Stage2\</NCurObj>
</PropertyGroup>
<MSBuild Projects="@(NCompilerProject)" Properties="OutputPath=$(NCurBin); DefineConstants=NET_4_0;TRACE; IntermediateOutputPath=$(NCurObj); Nemerle=$(NPrevBin)" Targets="$(NTargetName)" />
<Copy SourceFiles="@(NTasksFiles)" DestinationFolder="$(NCurBin)" />
</Target>
<!--Builds compiler using Stage2-->
<Target Name="Stage3" DependsOnTargets="Stage2">
<PropertyGroup>
<NPrevBin>$(NBin)\Stage2\</NPrevBin>
<NCurBin>$(NBin)\Stage3\</NCurBin>
<NCurObj>$(NObj)\Stage3\</NCurObj>
</PropertyGroup>
<MSBuild Projects="@(NCompilerProject)" Properties="OutputPath=$(NCurBin); DefineConstants=NET_4_0;TRACE; IntermediateOutputPath=$(NCurObj); Nemerle=$(NPrevBin)" Targets="$(NTargetName)" />
<Copy SourceFiles="@(NTasksFiles)" DestinationFolder="$(NCurBin)" />
</Target>
<!--Builds compiler using Stage3-->
<Target Name="Stage4" DependsOnTargets="Stage3">
<PropertyGroup>
<NPrevBin>$(NBin)\Stage3\</NPrevBin>
<NCurBin>$(NBin)\Stage4\</NCurBin>
<NCurObj>$(NObj)\Stage4\</NCurObj>
</PropertyGroup>
<MSBuild Projects="@(NCompilerProject)" Properties="OutputPath=$(NCurBin); DefineConstants=NET_4_0;TRACE; IntermediateOutputPath=$(NCurObj); Nemerle=$(NPrevBin)" Targets="$(NTargetName)" />
<Copy SourceFiles="@(NTasksFiles)" DestinationFolder="$(NCurBin)" />
</Target>
<!--Builds all tools, linq, vs integration and shell. Only Stage1 compiler required.-->
<Target Name="IntegrationFast" DependsOnTargets="Stage1; _Integration" />
<!--Builds all tools, linq, vs integration and shell. Stage4 compiler required.-->
<Target Name="IntegrationFull" DependsOnTargets="Stage4; Validate; CompilerTests; _Integration; IdeEngineTests" />
<!--Builds MSI package. Only Stage1 compiler required.-->
<Target Name="InstallerFast" DependsOnTargets="IntegrationFast; _Installer" />
<!--Builds MSI package. Stage4 compiler required.-->
<Target Name="InstallerFull" DependsOnTargets="IntegrationFull; _Installer" />
<!--Compare last two stages on IL level-->
<Target Name="Validate" DependsOnTargets="InitTools">
<ItemGroup>
<Asm2 Include="$(NPrevBin)\*.dll" />
<Asm2 Include="$(NPrevBin)\*.exe" />
<Asm3 Include="$(NCurBin)\*.dll" />
<Asm3 Include="$(NCurBin)\*.exe" />
</ItemGroup>
<Exec Command="$(Ildasm) %(Asm2.FullPath) /output:%(Asm2.FullPath).il /nobar" WorkingDirectory="$(NPrevBin)" />
<Exec Command="$(Ildasm) %(Asm3.FullPath) /output:%(Asm3.FullPath).il /nobar" WorkingDirectory="$(NCurBin)" />
<ItemGroup>
<IL_PREV Include="$(NPrevBin)\*.il" />
<IL_LAST Include="$(NCurBin)\*.il" />
</ItemGroup>
<MSBuild.Community.Tasks.FileUpdate Files="@(IL_PREV)" Regex="^(//.*)(?=\r)" ReplacementText="// REPLACED" Multiline="True" />
<MSBuild.Community.Tasks.FileUpdate Files="@(IL_LAST)" Regex="^(//.*)(?=\r)" ReplacementText="// REPLACED" Multiline="True" />
<Exec Command="fc $(NPrevBin)\*.il $(NCurBin)\*.il" />
<Exec Command="$(PEVerify) %(Asm3.FullPath)" ContinueOnError="True" />
<Delete Files="@(IL_PREV)" />
<Delete Files="@(IL_LAST)" />
</Target>
<!--Runs compiler tests.-->
<Target Name="CompilerTests">
<!--Build tester-->
<MSBuild Projects="$(NRoot)\Tests.nproj" Properties="Nemerle=$(NCurBin); Configuration=$(Configuration)"></MSBuild>
<!--Run positive tests-->
<Exec Command="tests.exe -d:positive -p "-nowarn:10003 -def:RUNTIME_MS" -s" WorkingDirectory="$(NRoot)\ncc\testsuite" />
<!--Run negative tests-->
<Exec Command="tests.exe -d:negative -p "-nowarn:10003 -def:RUNTIME_MS" -s" WorkingDirectory="$(NRoot)\ncc\testsuite" />
</Target>
<!--Install Nemerle compiler to specified folder. By default to ProgramFiles. To override folder set NInstall property.-->
<Target Name="Install" DependsOnTargets="InitTools">
<Error Condition=" '$(NCurBin)' == '' " Text="Property NCurBin is not set. Any stage of compilation should preceed the Install target." />
<!--Path which should contane binary filese to be installed-->
<!--PropertyGroup Condition=" '$(NCurBin)' == '' ">
<NCurBin>$(NBin)\Stage1</NCurBin>
</PropertyGroup-->
<Message Importance="high" Text="Install binaries from: '$(NCurBin)'" />
<ItemGroup>
<FilesToCopyToProgFiles Include="$(NRoot)\VsIntegration\bin\$(Configuration)\*.*" />
<FilesToCopyToProgFiles Include="$(NCurBin)\*.*" />
</ItemGroup>
<Copy SourceFiles="@(FilesToCopyToProgFiles)" DestinationFolder="$(NInstall)" />
<!--Copy SourceFiles="$(NRoot)\tools\msbuild-task\Nemerle.MSBuild.targets" DestinationFolder="$(NInstall)" /-->
<ItemGroup>
<FilesToRegInProgFiles Include="$(NInstall)\Nemerle.dll" />
<FilesToRegInProgFiles Include="$(NInstall)\Nemerle.Compiler.dll" />
<FilesToRegInProgFiles Include="$(NInstall)\Nemerle.Macros.dll" />
<FilesToRegInProgFiles Include="$(NInstall)\Nemerle.MSBuild.Tasks.dll" />
<FilesToRegInProgFiles Include="$(NInstall)\ncc.exe" />
</ItemGroup>
<Exec Command="$(GacUtil) /u %(FilesToRegInProgFiles.Filename)" IgnoreExitCode="True" WorkingDirectory="$(NInstall)" ContinueOnError="True" />
<Exec Command="$(NGen) uninstall "%(FilesToRegInProgFiles.FullPath)"" WorkingDirectory="$(NInstall)" IgnoreExitCode="True" ContinueOnError="True" />
<Exec Command="$(NGen) install "%(FilesToRegInProgFiles.FullPath)"" WorkingDirectory="$(NInstall)" />
<PropertyGroup>
<TargetLocation>"$(NInstall)\Nemerle.MSBuild.targets"</TargetLocation>
</PropertyGroup>
<Exec Command="reg.exe add HKLM\SOFTWARE\Microsoft\VisualStudio\9.0\MSBuild\SafeImports /v NemerleTarget /d $(TargetLocation) /f" StdOutEncoding="Windows-1251" />
<Exec Command="reg.exe add HKCU\Software\Microsoft\VisualStudio\9.0\Configuration\MSBuild\SafeImports /v NemerleTarget /d $(TargetLocation) /f" StdOutEncoding="Windows-1251" />
<Exec Command="reg.exe add HKCU\Software\Microsoft\VisualStudio\9.0Exp\Configuration\MSBuild\SafeImports /v NemerleTarget /d $(TargetLocation) /f" StdOutEncoding="Windows-1251" />
<Exec Command="$(Junction) "$(ProgramW6432)\Nemerle" "$(ProgramFiles(x86))\Nemerle"" Condition="'$(ProgramW6432)' != '' " IgnoreExitCode="true" />
</Target>
<Target Name="IdeEngineTests"> <!--DependsOnTargets="IntegrationFull"-->
<!--Run NUnit-tests for Nemerle.Compiler.Utils.dll (Engine Extentions of compiler engine)-->
<Exec Command=""$(NRoot)\ExternalDependences\nunit-console.exe" /nologo "$(NRoot)\VsIntegration\Nemerle.Compiler.Utils.Tests\bin\$(Configuration)\Nemerle.Compiler.Utils.Tests.dll"" />
</Target>
<!--Helper target to build integration-->
<Target Name="_Integration">
<MSBuild Projects="@(NIntegrationProject)" Targets="$(NTargetName)" Properties="Nemerle=$(NCurBin); Configuration=$(Configuration)" />
</Target>
<Target Name="DevBuildQuick" DependsOnTargets="Stage1; _Integration; Install" />
<Target Name="DevBuild2Stage" DependsOnTargets="Stage2; _Integration; Install" />
<Target Name="DevBuild2StageWithTests" DependsOnTargets="Stage2; CompilerTests; _Integration; IdeEngineTests; Install" />
<Target Name="DevBuildFull" DependsOnTargets="Stage4; Validate; CompilerTests; _Integration; IdeEngineTests; Install" />
<!--Helper target to build installer.-->
<Target Name="_Installer" Condition=" '$(Configuration)' != 'Debug' ">
<RemoveDir Directories="$(NRoot)\misc\packages\wix\dist" />
<MSBuild Projects="$(NRoot)\misc\packages\wix\nemerle.sln" Targets="$(NTargetName)" Properties="Nemerle=$(NCurBin); Configuration=$(Configuration)" />
</Target>
</Project>