-
Notifications
You must be signed in to change notification settings - Fork 85
/
Build.proj
121 lines (100 loc) · 4.6 KB
/
Build.proj
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
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<RootDir>$(MSBuildThisFileDirectory)</RootDir>
<Solution>$(RootDir)\Dlr.sln</Solution>
<UtilDir>$(RootDir)\Util</UtilDir>
<BinDir>$(RootDir)\bin</BinDir>
<BuildSysDir>$(RootDir)\Build</BuildSysDir>
</PropertyGroup>
<Import Project="$(BuildSysDir)\Tasks.Targets" />
<Import Project="$(RootDir)\CurrentVersion.props" />
<PropertyGroup>
<PackageVersion Condition="'$(ReleaseLevel)' == 'final'">$(MajorVersion).$(MinorVersion).$(MicroVersion)</PackageVersion>
<PackageVersion Condition="'$(ReleaseLevel)' != 'final' or '$(ReleaseSerial)' != '0'">$(MajorVersion).$(MinorVersion).$(MicroVersion)-$(ReleaseLevel)$(ReleaseSerial)</PackageVersion>
<StageDir>$(RootDir)\Package\$(Configuration)\Stage\DynamicLanguageRuntime.$(PackageVersion)</StageDir>
<PackageDir>$(RootDir)\Package\$(Configuration)\Packages\DynamicLanguageRuntime.$(PackageVersion)</PackageDir>
</PropertyGroup>
<PropertyGroup>
<BuildProperties>
RootDir=$(RootDir);
Solution=$(Solution);
Configuration=$(Configuration);
BinDir=$(BinDir);
StageDir=$(StageDir);
PackageDir=$(PackageDir);
PackageVersion=$(PackageVersion);
BuildSysDir=$(BuildSysDir);
</BuildProperties>
</PropertyGroup>
<Target Name="RestoreReferences">
<MSBuild Projects="$(Solution)" Targets="Restore" />
</Target>
<Target Name="Build" DependsOnTargets="RestoreReferences">
<MSBuild
Projects="$(Solution)"
Targets="Build"
Properties="$(BuildProperties);Configuration=$(Configuration)" />
</Target>
<Target Name="Rebuild">
<MSBuild
Projects="$(Solution)"
Targets="Rebuild"
Properties="$(BuildProperties);Configuration=$(Configuration)" />
</Target>
<Target Name="Clean">
<MSBuild
Projects="$(Solution)"
Targets="Clean"
Properties="$(BuildProperties);Configuration=$(Configuration)" />
</Target>
<Target Name="StageBuild" DependsOnTargets="RestoreReferences">
<MSBuild
Projects="$(Solution)"
Targets="Build"
Properties="$(BuildProperties);Configuration=$(Configuration);Staging=true" />
</Target>
<Target Name="Stage" DependsOnTargets="StageBuild">
<ItemGroup>
<InfoFiles Include="$(RootDir)\LICENSE" />
<InfoFiles Include="$(RootDir)\README.md" />
</ItemGroup>
<Copy DestinationFolder="$(StageDir)" SourceFiles="@(InfoFiles)" />
<ItemGroup>
<AssemblyFiles Include="$(BinDir)\$(Configuration)\**\Microsoft.Scripting.*;$(BinDir)\$(Configuration)\**\Microsoft.Dynamic.*" Exclude="$(BinDir)\$(Configuration)\**\Microsoft.*.Test.*" />
</ItemGroup>
<Copy DestinationFolder="$(StageDir)\%(RecursiveDir)" SourceFiles="@(AssemblyFiles)" />
</Target>
<Target Name="Package" DependsOnTargets="ZipPackage;NuGetPackage;DebPackage" />
<Target Name="MakePackageDir">
<MakeDir Directories="$(PackageDir)" Condition="!Exists('$(PackageDir)')" />
</Target>
<ItemGroup>
<Package Include="DynamicLanguageRuntime">
<NuSpecDir>$(RootDir)/Package/nuget</NuSpecDir>
</Package>
</ItemGroup>
<ItemGroup>
<NuGetPackageInputs Include="@(Package->'%(NuSpecDir)/*.nuspec')" />
<NuGetPackageOutputs Include="@(Package->'$(PackageDir)/$(Filename).$(PackageVersion).nupkg')" />
</ItemGroup>
<Target Name="NuGetPackage" DependsOnTargets="Stage;MakePackageDir"
Inputs="@(NuGetPackageInputs);@(StageOutputs)"
Outputs="@(NuGetPackageOutputs)">
<MSBuild Projects="%(Package.NuSpecDir)\NuGet.Packaging.csproj" Targets="Restore" />
<MSBuild Projects="%(Package.NuSpecDir)\NuGet.Packaging.csproj" Targets="Pack" Properties="$(BuildProperties);NuspecFile=%(Package.Identity).nuspec" />
</Target>
<Target Name="ZipPackage" DependsOnTargets="Stage;MakePackageDir"
Outputs="$(PackageDir)\DynamicLanguageRuntime.$(PackageVersion).zip">
<ItemGroup>
<ZipFiles Include="$(StageDir)\**\*.dll;$(StageDir)\**\*.xml;$(StageDir)\README.md;$(StageDir)\LICENSE"
Exclude="$(StageDir)\netcoreapp3.1\*;$(StageDir)\net9.0*\*" />
</ItemGroup>
<Message Text="$(ZipFiles)" />
<Zip Files="@(ZipFiles)" ZipFileName="$(PackageDir)\DynamicLanguageRuntime.$(PackageVersion).zip" WorkingDirectory="$(StageDir)"/>
</Target>
<Target Name="DebPackage" DependsOnTargets="Stage;MakePackageDir" Condition="'$(OS)' == 'Unix' ">
<!-- TODO: Implement deb packaging here -->
</Target>
</Project>