Skip to content

Commit 5f2377b

Browse files
committed
Add build script
1 parent 85c9252 commit 5f2377b

33 files changed

+429
-116
lines changed

IncrementalCompiler.sln

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{092669A2-5
99
EndProject
1010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Extra", "Extra", "{A22672B3-D1C4-47C0-AB82-6D22BBB94BBB}"
1111
EndProject
12-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharp60Support", "extra\CSharp60Support\CSharp60Support.csproj", "{E8330F9B-BA07-4344-9067-C14B1FB76B26}"
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompilerPlugin.Unity4", "extra\CompilerPlugin.Unity4\CompilerPlugin.Unity4.csproj", "{A848498C-64E7-444F-83FD-FCFE42E79E53}"
1313
EndProject
14-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "smcs", "extra\smcs\smcs.csproj", "{FAF6CAB7-0C7A-4B64-8662-5BF4944AEA8C}"
14+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompilerPlugin.Unity5", "extra\CompilerPlugin.Unity5\CompilerPlugin.Unity5.csproj", "{67FE81D8-C1BF-4D15-A512-E9E8078DEECF}"
15+
EndProject
16+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniversalCompiler", "extra\UniversalCompiler\UniversalCompiler.csproj", "{B19F1DAC-FA9A-4749-9E03-1848D29BFCCD}"
1517
EndProject
1618
Global
1719
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -23,21 +25,26 @@ Global
2325
{44B41B02-CCE7-40BE-8B98-164AEEF1D4B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
2426
{44B41B02-CCE7-40BE-8B98-164AEEF1D4B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
2527
{44B41B02-CCE7-40BE-8B98-164AEEF1D4B1}.Release|Any CPU.Build.0 = Release|Any CPU
26-
{E8330F9B-BA07-4344-9067-C14B1FB76B26}.Debug|Any CPU.ActiveCfg = Unity 5 Debug|Any CPU
27-
{E8330F9B-BA07-4344-9067-C14B1FB76B26}.Debug|Any CPU.Build.0 = Unity 5 Debug|Any CPU
28-
{E8330F9B-BA07-4344-9067-C14B1FB76B26}.Release|Any CPU.ActiveCfg = Unity 5 Release|Any CPU
29-
{E8330F9B-BA07-4344-9067-C14B1FB76B26}.Release|Any CPU.Build.0 = Unity 5 Release|Any CPU
30-
{FAF6CAB7-0C7A-4B64-8662-5BF4944AEA8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
31-
{FAF6CAB7-0C7A-4B64-8662-5BF4944AEA8C}.Debug|Any CPU.Build.0 = Debug|Any CPU
32-
{FAF6CAB7-0C7A-4B64-8662-5BF4944AEA8C}.Release|Any CPU.ActiveCfg = Release|Any CPU
33-
{FAF6CAB7-0C7A-4B64-8662-5BF4944AEA8C}.Release|Any CPU.Build.0 = Release|Any CPU
28+
{A848498C-64E7-444F-83FD-FCFE42E79E53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29+
{A848498C-64E7-444F-83FD-FCFE42E79E53}.Debug|Any CPU.Build.0 = Debug|Any CPU
30+
{A848498C-64E7-444F-83FD-FCFE42E79E53}.Release|Any CPU.ActiveCfg = Release|Any CPU
31+
{A848498C-64E7-444F-83FD-FCFE42E79E53}.Release|Any CPU.Build.0 = Release|Any CPU
32+
{67FE81D8-C1BF-4D15-A512-E9E8078DEECF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33+
{67FE81D8-C1BF-4D15-A512-E9E8078DEECF}.Debug|Any CPU.Build.0 = Debug|Any CPU
34+
{67FE81D8-C1BF-4D15-A512-E9E8078DEECF}.Release|Any CPU.ActiveCfg = Release|Any CPU
35+
{67FE81D8-C1BF-4D15-A512-E9E8078DEECF}.Release|Any CPU.Build.0 = Release|Any CPU
36+
{B19F1DAC-FA9A-4749-9E03-1848D29BFCCD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37+
{B19F1DAC-FA9A-4749-9E03-1848D29BFCCD}.Debug|Any CPU.Build.0 = Debug|Any CPU
38+
{B19F1DAC-FA9A-4749-9E03-1848D29BFCCD}.Release|Any CPU.ActiveCfg = Release|Any CPU
39+
{B19F1DAC-FA9A-4749-9E03-1848D29BFCCD}.Release|Any CPU.Build.0 = Release|Any CPU
3440
EndGlobalSection
3541
GlobalSection(SolutionProperties) = preSolution
3642
HideSolutionNode = FALSE
3743
EndGlobalSection
3844
GlobalSection(NestedProjects) = preSolution
3945
{44B41B02-CCE7-40BE-8B98-164AEEF1D4B1} = {092669A2-567F-4C73-A01E-AEBA2C733994}
40-
{E8330F9B-BA07-4344-9067-C14B1FB76B26} = {A22672B3-D1C4-47C0-AB82-6D22BBB94BBB}
41-
{FAF6CAB7-0C7A-4B64-8662-5BF4944AEA8C} = {A22672B3-D1C4-47C0-AB82-6D22BBB94BBB}
46+
{A848498C-64E7-444F-83FD-FCFE42E79E53} = {A22672B3-D1C4-47C0-AB82-6D22BBB94BBB}
47+
{67FE81D8-C1BF-4D15-A512-E9E8078DEECF} = {A22672B3-D1C4-47C0-AB82-6D22BBB94BBB}
48+
{B19F1DAC-FA9A-4749-9E03-1848D29BFCCD} = {A22672B3-D1C4-47C0-AB82-6D22BBB94BBB}
4249
EndGlobalSection
4350
EndGlobal

build.cmd

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@echo off
2+
3+
pushd %~dp0
4+
5+
tools\nuget\NuGet.exe update -self
6+
tools\nuget\NuGet.exe install FAKE -ConfigFile tools\nuget\Nuget.Config -OutputDirectory packages -ExcludeVersion -Version 4.12
7+
tools\nuget\NuGet.exe install ILRepack -ConfigFile tools\nuget\Nuget.Config -OutputDirectory packages -ExcludeVersion -Version 2.0.9
8+
9+
set encoding=utf-8
10+
packages\FAKE\tools\FAKE.exe build.fsx %*
11+
12+
popd

build.fsx

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#I @"packages/FAKE/tools"
2+
#r "FakeLib.dll"
3+
4+
open Fake
5+
open Fake.FileHelper
6+
open Fake.ProcessHelper
7+
open Fake.ZipHelper
8+
9+
// ------------------------------------------------------------------------------ Project
10+
11+
let buildSolutionFile = "./IncrementalCompiler.sln"
12+
let buildConfiguration = "Release"
13+
14+
// ---------------------------------------------------------------------------- Variables
15+
16+
let binDir = "bin"
17+
let testDir = binDir @@ "test"
18+
19+
// ------------------------------------------------------------------------------ Targets
20+
21+
Target "Clean" (fun _ ->
22+
CleanDirs [binDir]
23+
)
24+
25+
Target "Build" (fun _ ->
26+
!! buildSolutionFile
27+
|> MSBuild "" "Rebuild" [ "Configuration", buildConfiguration ]
28+
|> Log "Build-Output: "
29+
)
30+
31+
Target "Package" (fun _ ->
32+
// pack IncrementalCompiler.exe with dependent module dlls to ics.exe
33+
let errorCode = Shell.Exec("./packages/ILRepack/tools/ILRepack.exe",
34+
"/wildcards /out:ics.exe IncrementalCompiler.exe *.dll",
35+
"./core/IncrementalCompiler/bin/Release")
36+
// let's make package
37+
for target in ["Unity4"; "Unity5"] do
38+
let targetDir = binDir @@ target
39+
let editorDir = targetDir @@ "Assets" @@ "Editor"
40+
let compilerDir = targetDir @@ "Compiler"
41+
// create dirs
42+
CreateDir targetDir
43+
CreateDir editorDir
44+
CreateDir compilerDir
45+
// copy output files
46+
"./core/IncrementalCompiler/bin/Release/ics.exe" |> CopyFile compilerDir
47+
"./extra/CompilerPlugin." + target + "/bin/Release/Unity.PureCSharpTests.dll" |> CopyFile (editorDir @@ "CompilerPlugin.dll")
48+
"./extra/UniversalCompiler/bin/Release/smcs.exe" |> CopyFile compilerDir
49+
"./tools/pdb2mdb/pdb2mdb.exe" |> CopyFile compilerDir
50+
// create zipped packages
51+
!! (targetDir @@ "**") |> Zip targetDir (binDir @@ "IncrementalCompiler." + target + ".zip")
52+
)
53+
54+
Target "Help" (fun _ ->
55+
List.iter printfn [
56+
"usage:"
57+
"build [target]"
58+
""
59+
" Targets for building:"
60+
" * Build Build"
61+
" * Package Make packages"
62+
""]
63+
)
64+
65+
// --------------------------------------------------------------------------- Dependency
66+
67+
// Build order
68+
"Clean"
69+
// ==> "Build"
70+
==> "Package"
71+
72+
RunTargetOrDefault "Help"

extra/CSharp60Support/CSharp60Support.csproj

Lines changed: 0 additions & 90 deletions
This file was deleted.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{A848498C-64E7-444F-83FD-FCFE42E79E53}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>Unity.PureCSharpTests</RootNamespace>
11+
<AssemblyName>Unity.PureCSharpTests</AssemblyName>
12+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<DebugSymbols>true</DebugSymbols>
17+
<DebugType>full</DebugType>
18+
<Optimize>false</Optimize>
19+
<OutputPath>bin\Debug\</OutputPath>
20+
<DefineConstants>TRACE;DEBUG;UNITY4</DefineConstants>
21+
<ErrorReport>prompt</ErrorReport>
22+
<WarningLevel>4</WarningLevel>
23+
</PropertyGroup>
24+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25+
<DebugType>pdbonly</DebugType>
26+
<Optimize>true</Optimize>
27+
<OutputPath>bin\Release\</OutputPath>
28+
<DefineConstants>TRACE;UNITY4</DefineConstants>
29+
<ErrorReport>prompt</ErrorReport>
30+
<WarningLevel>4</WarningLevel>
31+
</PropertyGroup>
32+
<ItemGroup>
33+
<Reference Include="System" />
34+
<Reference Include="System.Core" />
35+
<Reference Include="System.Xml.Linq" />
36+
<Reference Include="System.Data.DataSetExtensions" />
37+
<Reference Include="System.Data" />
38+
<Reference Include="System.Xml" />
39+
<Reference Include="UnityEditor">
40+
<HintPath>Unity4\UnityEditor.dll</HintPath>
41+
</Reference>
42+
<Reference Include="UnityEngine">
43+
<HintPath>Unity4\UnityEngine.dll</HintPath>
44+
</Reference>
45+
</ItemGroup>
46+
<ItemGroup>
47+
<Compile Include="..\CompilerPlugin\CSharp60SupportActivator.cs">
48+
<Link>CSharp60SupportActivator.cs</Link>
49+
</Compile>
50+
<Compile Include="..\CompilerPlugin\CustomCSharpCompiler.cs">
51+
<Link>CustomCSharpCompiler.cs</Link>
52+
</Compile>
53+
<Compile Include="..\CompilerPlugin\CustomCSharpLanguage.cs">
54+
<Link>CustomCSharpLanguage.cs</Link>
55+
</Compile>
56+
<Compile Include="..\CompilerPlugin\Properties\AssemblyInfo.cs">
57+
<Link>Properties\AssemblyInfo.cs</Link>
58+
</Compile>
59+
</ItemGroup>
60+
<ItemGroup />
61+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
62+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
63+
Other similar extension points exist, see Microsoft.Common.targets.
64+
<Target Name="BeforeBuild">
65+
</Target>
66+
<Target Name="AfterBuild">
67+
</Target>
68+
-->
69+
</Project>
2.89 MB
Binary file not shown.
682 KB
Binary file not shown.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{67FE81D8-C1BF-4D15-A512-E9E8078DEECF}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>Unity.PureCSharpTests</RootNamespace>
11+
<AssemblyName>Unity.PureCSharpTests</AssemblyName>
12+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<DebugSymbols>true</DebugSymbols>
17+
<DebugType>full</DebugType>
18+
<Optimize>false</Optimize>
19+
<OutputPath>bin\Debug\</OutputPath>
20+
<DefineConstants>TRACE;DEBUG;UNITY5</DefineConstants>
21+
<ErrorReport>prompt</ErrorReport>
22+
<WarningLevel>4</WarningLevel>
23+
</PropertyGroup>
24+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25+
<DebugType>pdbonly</DebugType>
26+
<Optimize>true</Optimize>
27+
<OutputPath>bin\Release\</OutputPath>
28+
<DefineConstants>TRACE;UNITY5</DefineConstants>
29+
<ErrorReport>prompt</ErrorReport>
30+
<WarningLevel>4</WarningLevel>
31+
</PropertyGroup>
32+
<ItemGroup>
33+
<Reference Include="System" />
34+
<Reference Include="System.Core" />
35+
<Reference Include="System.Xml.Linq" />
36+
<Reference Include="System.Data.DataSetExtensions" />
37+
<Reference Include="System.Data" />
38+
<Reference Include="System.Xml" />
39+
<Reference Include="UnityEditor">
40+
<HintPath>Unity5\UnityEditor.dll</HintPath>
41+
</Reference>
42+
<Reference Include="UnityEngine">
43+
<HintPath>Unity5\UnityEngine.dll</HintPath>
44+
</Reference>
45+
</ItemGroup>
46+
<ItemGroup />
47+
<ItemGroup>
48+
<Compile Include="..\CompilerPlugin\CSharp60SupportActivator.cs">
49+
<Link>CSharp60SupportActivator.cs</Link>
50+
</Compile>
51+
<Compile Include="..\CompilerPlugin\CustomCSharpCompiler.cs">
52+
<Link>CustomCSharpCompiler.cs</Link>
53+
</Compile>
54+
<Compile Include="..\CompilerPlugin\CustomCSharpLanguage.cs">
55+
<Link>CustomCSharpLanguage.cs</Link>
56+
</Compile>
57+
<Compile Include="..\CompilerPlugin\Properties\AssemblyInfo.cs">
58+
<Link>Properties\AssemblyInfo.cs</Link>
59+
</Compile>
60+
</ItemGroup>
61+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
62+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
63+
Other similar extension points exist, see Microsoft.Common.targets.
64+
<Target Name="BeforeBuild">
65+
</Target>
66+
<Target Name="AfterBuild">
67+
</Target>
68+
-->
69+
</Project>

tools/unity3d/UnityEditor.dll renamed to extra/CompilerPlugin.Unity5/Unity5/UnityEditor.dll

File renamed without changes.

tools/unity3d/UnityEngine.dll renamed to extra/CompilerPlugin.Unity5/Unity5/UnityEngine.dll

File renamed without changes.

0 commit comments

Comments
 (0)