Skip to content

Commit a18016e

Browse files
author
bog1978
committed
1. Added msbuild scripts to build compiler, tools, vsintegration, shell and installer
2. Added ExternalDependences folder a. NAnt assemblies to build Nemerle.NAnt.Tasks b. MSBuild.Community.Tasks assemblies to support regex file content replacement 3. wix package improvements a. nemerle.wixproj modified to prepare dist folder before building installer b. added docs folder, containing html documentation git-svn-id: https://nemerle.googlecode.com/svn/nemerle/trunk@8073 c8a6711f-211a-0410-a8d5-2f220496d6d1
1 parent 916a02d commit a18016e

17 files changed

+7263
-7
lines changed
140 KB
Binary file not shown.
208 KB
Binary file not shown.

ExternalDependences/NAnt.Core.dll

360 KB
Binary file not shown.
128 KB
Binary file not shown.

NemerleAll.nproj

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
<Project DefaultTargets="NccFull" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
2+
3+
<UsingTask TaskName="MSBuild.Community.Tasks.FileUpdate" AssemblyFile="$(MSBuildProjectDirectory)\ExternalDependences\MSBuild.Community.Tasks.dll" />
4+
5+
<PropertyGroup>
6+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
7+
<NInstall Condition=" '$(NInstall)' == '' ">$(ProgramFiles)\Nemerle</NInstall>
8+
<NRoot>$(MSBuildProjectDirectory)</NRoot>
9+
<NBoot>$(NRoot)\boot</NBoot>
10+
<NBin>$(NRoot)\bin\$(Configuration)</NBin>
11+
</PropertyGroup>
12+
13+
<Target Name="RunTests">
14+
<!--Build tester-->
15+
<MSBuild Projects="$(NRoot)\Tests.nproj">
16+
</MSBuild>
17+
<!--Run negative tests-->
18+
<Exec Command="tests.exe -d:negative -p &quot;-nowarn:10003 -def:RUNTIME_MS&quot; -s" WorkingDirectory="$(NRoot)\ncc\testsuite" />
19+
<!--Run positive tests-->
20+
<Exec Command="tests.exe -d:positive -p &quot;-nowarn:10003 -def:RUNTIME_MS&quot; -s" WorkingDirectory="$(NRoot)\ncc\testsuite" />
21+
</Target>
22+
23+
<Target Name="RegProgFiles" DependsOnTargets="_InitTools">
24+
<ItemGroup>
25+
<FilesToCopyToProgFiles Include="$(NBin)\*.*" />
26+
</ItemGroup>
27+
<Copy SourceFiles="@(FilesToCopyToProgFiles)" DestinationFolder="$(NInstall)" />
28+
<Copy SourceFiles="$(NRoot)\tools\msbuild-task\Nemerle.MSBuild.targets" DestinationFolder="$(NInstall)" />
29+
<ItemGroup>
30+
<FilesToRegInProgFiles Include="$(NInstall)\Nemerle.dll" />
31+
<FilesToRegInProgFiles Include="$(NInstall)\Nemerle.Compiler.dll" />
32+
<FilesToRegInProgFiles Include="$(NInstall)\Nemerle.Macros.dll" />
33+
<FilesToRegInProgFiles Include="$(NInstall)\Nemerle.MSBuild.Tasks.dll" />
34+
<FilesToRegInProgFiles Include="$(NInstall)\ncc.exe" />
35+
</ItemGroup>
36+
<Exec Command="$(GacUtil) /u %(FilesToRegInProgFiles.Filename)" IgnoreExitCode="True" WorkingDirectory="$(NInstall)" />
37+
<Exec Command="$(NGen) uninstall %(FilesToRegInProgFiles.Filename)" WorkingDirectory="$(NInstall)" IgnoreExitCode="True" />
38+
<Exec Command="$(NGen) install &quot;%(FilesToRegInProgFiles.FullPath)&quot;" WorkingDirectory="$(NInstall)" />
39+
<PropertyGroup>
40+
<TargetLocation>"$(NInstall)\Nemerle.MSBuild.targets"</TargetLocation>
41+
</PropertyGroup>
42+
<Exec Command="reg.exe add HKLM\SOFTWARE\Microsoft\VisualStudio\9.0\MSBuild\SafeImports /v NemerleTarget /d $(TargetLocation) /f" StdOutEncoding="Windows-1251" />
43+
<Exec Command="reg.exe add HKCU\Software\Microsoft\VisualStudio\9.0\Configuration\MSBuild\SafeImports /v NemerleTarget /d $(TargetLocation) /f" StdOutEncoding="Windows-1251" />
44+
<Exec Command="reg.exe add HKCU\Software\Microsoft\VisualStudio\9.0Exp\Configuration\MSBuild\SafeImports /v NemerleTarget /d $(TargetLocation) /f" StdOutEncoding="Windows-1251" />
45+
</Target>
46+
47+
<Target Name="NccFast" DependsOnTargets="_InitTools; _Stage1; RegProgFiles">
48+
<OnError ExecuteTargets="_RestoreBoot" />
49+
</Target>
50+
51+
<Target Name="NccFull" DependsOnTargets="_InitTools; _Stage4; _Validate; RegProgFiles; RunTests">
52+
<OnError ExecuteTargets="_RestoreBoot" />
53+
</Target>
54+
55+
<Target Name="Tools">
56+
<MSBuild Projects="Tools.sln" />
57+
</Target>
58+
59+
<Target Name="Shell">
60+
<MSBuild Projects="VSIntegration\Shell\NemerleStudio.sln" />
61+
</Target>
62+
63+
<Target Name="VSIntegration">
64+
<MSBuild Projects="VSIntegration\Nemerle.VSIP.sln" />
65+
</Target>
66+
67+
<Target Name="Installer" DependsOnTargets="NccFull; Tools; VSIntegration; Shell">
68+
<RemoveDir Directories="$(NRoot)\misc\packages\wix\dist;$(NRoot)\misc\packages\wix\bin;$(NRoot)\misc\packages\wix\obj">
69+
</RemoveDir>
70+
<MSBuild Projects="$(NRoot)\misc\packages\wix\nemerle.sln" />
71+
</Target>
72+
73+
74+
<Target Name="InstallerOnly">
75+
<RemoveDir Directories="$(NRoot)\misc\packages\wix\dist;$(NRoot)\misc\packages\wix\bin;$(NRoot)\misc\packages\wix\obj" />
76+
<MSBuild Projects="$(NRoot)\misc\packages\wix\nemerle.wixproj" />
77+
</Target>
78+
79+
<!--Builds compiler using boot-->
80+
<Target Name="_Stage1">
81+
82+
<Exec Command="$(MSBuild) Nemerle-2008.sln /p:Configuration=$(Configuration) /t:clean" />
83+
<!--Rebuild compiler-->
84+
<Exec Command="$(MSBuild) Nemerle-2008.sln /p:Configuration=$(Configuration)" />
85+
</Target>
86+
87+
<Target Name="_Stage2" DependsOnTargets="_Stage1;_BackupBoot">
88+
<ItemGroup>
89+
<BinFiles1 Include="$(NBin)\*.*" />
90+
</ItemGroup>
91+
<!--Copy output of stage1 to boot.-->
92+
<Copy SourceFiles="@(BinFiles1)" DestinationFolder="$(NBoot)" />
93+
94+
<Exec Command="$(MSBuild) Nemerle-2008.sln /p:Configuration=$(Configuration) /t:clean" />
95+
<!--Rebuild compiler-->
96+
<Exec Command="$(MSBuild) Nemerle-2008.sln /p:Configuration=$(Configuration)" />
97+
</Target>
98+
99+
<Target Name="_Stage3" DependsOnTargets="_Stage2">
100+
<ItemGroup>
101+
<BinFiles2 Include="$(NBin)\*.*" />
102+
</ItemGroup>
103+
<!--Copy output of stage2 to boot.-->
104+
<Copy SourceFiles="@(BinFiles2)" DestinationFolder="$(NBoot)" />
105+
106+
<Exec Command="$(MSBuild) Nemerle-2008.sln /p:Configuration=$(Configuration) /t:clean" />
107+
<!--Rebuild compiler-->
108+
<Exec Command="$(MSBuild) Nemerle-2008.sln /p:Configuration=$(Configuration)" />
109+
</Target>
110+
111+
112+
<Target Name="_Stage4" DependsOnTargets="_Stage3">
113+
<ItemGroup>
114+
<BinFiles3 Include="$(NBin)\*.*" />
115+
</ItemGroup>
116+
<!--Copy output of stage2 to boot.-->
117+
<Copy SourceFiles="@(BinFiles3)" DestinationFolder="$(NBoot)" />
118+
119+
<Exec Command="$(MSBuild) Nemerle-2008.sln /p:Configuration=$(Configuration) /t:clean" />
120+
<!--Rebuild compiler-->
121+
<Exec Command="$(MSBuild) Nemerle-2008.sln /p:Configuration=$(Configuration)" />
122+
</Target>
123+
124+
125+
<!--Initialize FX and SDK tools location-->
126+
<Target Name="_InitTools">
127+
<GetFrameworkPath>
128+
<Output TaskParameter="Path" PropertyName="FW" />
129+
</GetFrameworkPath>
130+
<GetFrameworkSdkPath>
131+
<Output TaskParameter="Path" PropertyName="SDK" />
132+
</GetFrameworkSdkPath>
133+
<PropertyGroup>
134+
<GacUtil>"$(SDK)\bin\gacutil.exe"</GacUtil>
135+
<NGen>"$(SystemRoot)\Microsoft.NET\Framework\v2.0.50727\ngen.exe"</NGen>
136+
<Ildasm>"$(SDK)\bin\ildasm.exe"</Ildasm>
137+
<PEVerify>"$(SDK)\bin\peverify.exe"</PEVerify>
138+
<MSBuild>$(MSBuildBinPath)\msbuild.exe</MSBuild>
139+
</PropertyGroup>
140+
<Exec Command="echo Tools found at folowing locations" />
141+
<Exec Command="echo GacUtil - $(GacUtil)" />
142+
<Exec Command="echo NGen - $(NGen)" />
143+
<Exec Command="echo Ildasm - $(Ildasm)" />
144+
<Exec Command="echo PEVerify - $(PEVerify)" />
145+
<Exec Command="echo MSBuild - $(MSBuild)" />
146+
</Target>
147+
148+
149+
<!--Compare last two stages on IL level-->
150+
<Target Name="_Validate" DependsOnTargets="_InitTools">
151+
<ItemGroup>
152+
<Asm2 Include="$(NBoot)\*.dll" />
153+
<Asm2 Include="$(NBoot)\ncc.exe" />
154+
<Asm3 Include="$(NBin)\*.dll" />
155+
<Asm3 Include="$(NBin)\ncc.exe" />
156+
</ItemGroup>
157+
<Exec Command="$(Ildasm) %(Asm2.FullPath) /output:%(Asm2.FullPath).il /nobar" WorkingDirectory="$(NBoot)" />
158+
<Exec Command="$(Ildasm) %(Asm3.FullPath) /output:%(Asm3.FullPath).il /nobar" WorkingDirectory="$(NBin)" />
159+
<ItemGroup>
160+
<IL_PREV Include="$(NBoot)\*.il" />
161+
<IL_LAST Include="$(NBin)\*.il" />
162+
</ItemGroup>
163+
<MSBuild.Community.Tasks.FileUpdate Files="@(IL_PREV)" Regex="^(//.*)(?=\r)" ReplacementText="// REPLACED" Multiline="True" />
164+
<MSBuild.Community.Tasks.FileUpdate Files="@(IL_LAST)" Regex="^(//.*)(?=\r)" ReplacementText="// REPLACED" Multiline="True" />
165+
<Exec Command="fc $(NBoot)\*.il $(NBin)\*.il" />
166+
<Exec Command="$(PEVerify) %(Asm2.FullPath)" ContinueOnError="True" />
167+
<Delete Files="@(IL_PREV)" />
168+
<Delete Files="@(IL_LAST)" />
169+
</Target>
170+
171+
172+
<!--Copy current boot content to boot\old directory-->
173+
<Target Name="_BackupBoot">
174+
<ItemGroup>
175+
<BootFilesToBackup Include="$(NBoot)\*.*" />
176+
</ItemGroup>
177+
<Copy SourceFiles="@(BootFilesToBackup)" DestinationFolder="$(NBoot)\old" />
178+
</Target>
179+
<!--Restore boot content from boot\old directory-->
180+
<Target Name="_RestoreBoot" Condition="Exists('$(NBoot)\old')">
181+
<ItemGroup>
182+
<BootFilesToDelete Include="$(NBoot)\*.*" />
183+
<BootFilesToBackup Include="$(NBoot)\old\*.*" />
184+
</ItemGroup>
185+
<Delete Files="@(BootFilesToDelete)" />
186+
<Copy SourceFiles="@(BootFilesToBackup)" DestinationFolder="$(NBoot)" />
187+
</Target>
188+
</Project>

NemerleAllTest.cmd

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
set MSBuild="%SystemRoot%\Microsoft.NET\Framework\v3.5\msbuild.exe"
2+
3+
rem First you must run one of these two commands to compile and reg compiler
4+
%MSBuild% NemerleAll.nproj /t:NccFast
5+
%MSBuild% NemerleAll.nproj /t:NccFull
6+
7+
rem then you can compile ohter packages
8+
%MSBuild% NemerleAll.nproj /t:VSIntegration
9+
%MSBuild% NemerleAll.nproj /t:Shell
10+
%MSBuild% NemerleAll.nproj /t:Tools
11+
12+
rem Installer target calls NccFull, VSIntegration, Tools and Shell first
13+
%MSBuild% NemerleAll.nproj /t:Installer /p:Configuration=Release
14+
15+
rem Support targets for developers only
16+
%MSBuild% NemerleAll.nproj /t:RegProgFiles
17+
%MSBuild% NemerleAll.nproj /t:RunTests

Tools.sln

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 10.00
3+
# Visual Studio 2008
4+
Project("{EDCC3B85-0BAD-11DB-BC1A-00112FDE8B61}") = "Nemerle.Evaluation", "tools\Nemerle.Evaluation.nproj", "{30EC93B9-43DD-47C2-A18D-AA6B907EF4BE}"
5+
EndProject
6+
Project("{EDCC3B85-0BAD-11DB-BC1A-00112FDE8B61}") = "nemish", "tools\nemish.nproj", "{70754C6C-3ACA-438A-9C52-03C544EC0A8D}"
7+
EndProject
8+
Project("{EDCC3B85-0BAD-11DB-BC1A-00112FDE8B61}") = "Nemerle.NAnt.Tasks", "tools\Nemerle.NAnt.Tasks.nproj", "{48ADC8E6-B8EE-40BF-883A-6BCAEE53AB2A}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{30EC93B9-43DD-47C2-A18D-AA6B907EF4BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{30EC93B9-43DD-47C2-A18D-AA6B907EF4BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{30EC93B9-43DD-47C2-A18D-AA6B907EF4BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{30EC93B9-43DD-47C2-A18D-AA6B907EF4BE}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{70754C6C-3ACA-438A-9C52-03C544EC0A8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{70754C6C-3ACA-438A-9C52-03C544EC0A8D}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{70754C6C-3ACA-438A-9C52-03C544EC0A8D}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{70754C6C-3ACA-438A-9C52-03C544EC0A8D}.Release|Any CPU.Build.0 = Release|Any CPU
24+
{48ADC8E6-B8EE-40BF-883A-6BCAEE53AB2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25+
{48ADC8E6-B8EE-40BF-883A-6BCAEE53AB2A}.Debug|Any CPU.Build.0 = Debug|Any CPU
26+
{48ADC8E6-B8EE-40BF-883A-6BCAEE53AB2A}.Release|Any CPU.ActiveCfg = Release|Any CPU
27+
{48ADC8E6-B8EE-40BF-883A-6BCAEE53AB2A}.Release|Any CPU.Build.0 = Release|Any CPU
28+
EndGlobalSection
29+
GlobalSection(SolutionProperties) = preSolution
30+
HideSolutionNode = FALSE
31+
EndGlobalSection
32+
EndGlobal

VsIntegration/ConsoleTest/ConsoleTest.csproj

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
44
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5-
<ProductVersion>8.0.50727</ProductVersion>
5+
<ProductVersion>9.0.21022</ProductVersion>
66
<SchemaVersion>2.0</SchemaVersion>
77
<ProjectGuid>{D5EB7C03-398D-4C41-91C9-4ED474CC1312}</ProjectGuid>
88
<OutputType>Exe</OutputType>
@@ -14,6 +14,7 @@
1414
<OldToolsVersion>2.0</OldToolsVersion>
1515
<UpgradeBackupLocation>
1616
</UpgradeBackupLocation>
17+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
1718
</PropertyGroup>
1819
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1920
<DebugSymbols>true</DebugSymbols>
@@ -33,11 +34,10 @@
3334
<WarningLevel>4</WarningLevel>
3435
</PropertyGroup>
3536
<ItemGroup>
36-
<Reference Include="Nemerle.Compiler.Utils, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c4c0f22444bf4088, processorArchitecture=MSIL">
37-
<SpecificVersion>False</SpecificVersion>
38-
<HintPath>..\Nemerle.Compiler.Utils\bin\Debug\Nemerle.Compiler.Utils.dll</HintPath>
39-
</Reference>
4037
<Reference Include="System" />
38+
<Reference Include="System.Core">
39+
<RequiredTargetFramework>3.5</RequiredTargetFramework>
40+
</Reference>
4141
<Reference Include="System.Data" />
4242
<Reference Include="System.Xml" />
4343
</ItemGroup>
@@ -48,6 +48,12 @@
4848
<ItemGroup>
4949
<Service Include="{B4F97281-0DBD-4835-9ED8-7DFB966E87FF}" />
5050
</ItemGroup>
51+
<ItemGroup>
52+
<ProjectReference Include="..\Nemerle.Compiler.Utils\Nemerle.Compiler.Utils.csproj">
53+
<Project>{DBC77173-9367-485F-B425-74E6D6AB3F82}</Project>
54+
<Name>Nemerle.Compiler.Utils</Name>
55+
</ProjectReference>
56+
</ItemGroup>
5157
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
5258
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
5359
Other similar extension points exist, see Microsoft.Common.targets.

0 commit comments

Comments
 (0)