Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 00ac3a7

Browse files
committed
Extract .NET Core into build-core.proj
1 parent c2bf1ce commit 00ac3a7

File tree

3 files changed

+102
-26
lines changed

3 files changed

+102
-26
lines changed

build/build-core.proj

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Default"
3+
xmlns='http://schemas.microsoft.com/developer/msbuild/2003' ToolsVersion="4.0">
4+
<Import Project="$(MSBuildProjectDirectory)/build.tasks" />
5+
6+
<PropertyGroup>
7+
<MajorVersion Condition="$(MajorVersion) == ''">1</MajorVersion>
8+
<MinorVersion Condition="$(MinorVersion) == ''">0</MinorVersion>
9+
<PatchVersion Condition="$(PatchVersion) == ''">$(BUILD_NUMBER)</PatchVersion>
10+
</PropertyGroup>
11+
12+
<PropertyGroup>
13+
<BuildSolutionDir>$(MSBuildProjectDirectory)/..</BuildSolutionDir>
14+
<SrcDir>$(BuildSolutionDir)/src</SrcDir>
15+
<Configuration Condition="$(Configuration) == ''">Release</Configuration>
16+
<NuGetPath>$(BuildSolutionDir)/src/.nuget/nuget.exe</NuGetPath>
17+
<NuGetPackageDir>$(BuildSolutionDir)/NuGet.Core/</NuGetPackageDir>
18+
<Version>$(MajorVersion).$(MinorVersion).$(PatchVersion).0</Version>
19+
<PackageVersion>$(MajorVersion).$(MinorVersion).$(PatchVersion)</PackageVersion>
20+
<EnvVersion>$(MajorVersion).$(MinorVersion)$(PatchVersion)</EnvVersion>
21+
</PropertyGroup>
22+
23+
<ItemGroup>
24+
<NugetPackageFilesToDelete Include="$(NuGetPackageDir)/*.nupkg"/>
25+
</ItemGroup>
26+
27+
<PropertyGroup>
28+
<DoBuildSolutionsDependsOn>
29+
BeforeBuildSolutions;
30+
BuildSolutions
31+
</DoBuildSolutionsDependsOn>
32+
</PropertyGroup>
33+
34+
<Target Name="Default" DependsOnTargets="$(DoBuildSolutionsDependsOn)" />
35+
36+
<Target Name="TeamCityBuild">
37+
<CallTarget Targets="Default" />
38+
</Target>
39+
40+
<Target Name="BeforeBuildSolutions">
41+
<Message Text="*****Before building solution*****" Importance="high"/>
42+
</Target>
43+
44+
<Target Name="BuildSolutions">
45+
<MSBuild Projects="$(BuildSolutionDir)/src/ServiceStack.Text.sln" Targets="Build"
46+
Properties="Configuration=$(Configuration)" />
47+
</Target>
48+
49+
<Target Name="UpdateVersion">
50+
<!-- Update Version -->
51+
<ItemGroup>
52+
<RegexTransform Include="$(SrcDir)/**/AssemblyInfo.cs">
53+
<Find>\d+\.\d+\.\d+\.\d+</Find>
54+
<ReplaceWith>$(Version)</ReplaceWith>
55+
</RegexTransform>
56+
<RegexTransform Include="$(SrcDir)/ServiceStack.Text/Env.cs">
57+
<Find>ServiceStackVersion = \d+\.\d+m;</Find>
58+
<ReplaceWith>ServiceStackVersion = $(EnvVersion)m;</ReplaceWith>
59+
</RegexTransform>
60+
<RegexTransform Include="$(SrcDir)/ServiceStack.Text/Env.cs">
61+
<Find>new DateTime.*</Find>
62+
<ReplaceWith>new DateTime($([System.DateTime]::Now.ToString(`yyyy,MM,dd`)));</ReplaceWith>
63+
</RegexTransform>
64+
<!--Update Min Dependency Version -->
65+
<RegexTransform Include="$(NuGetPackageDir)/**/*.nuspec">
66+
<Find>version="1\.0\.[^"]*"</Find>
67+
<ReplaceWith>version="$(PackageVersion)"</ReplaceWith>
68+
</RegexTransform>
69+
</ItemGroup>
70+
71+
<RegexTransform Items="@(RegexTransform)" />
72+
</Target>
73+
74+
<Target Name="NuGetPack">
75+
<CallTarget Targets="UpdateVersion" />
76+
77+
<Delete Files="@(NugetPackageFilesToDelete)" />
78+
79+
<ItemGroup>
80+
<TextFilesNetStardard11 Include="$(SrcDir)/ServiceStack.Text/bin/$(Configuration)/netstandard1.1/ServiceStack.Text.*"></TextFilesNetStardard11>
81+
<TextFilesNetStardard13 Include="$(SrcDir)/ServiceStack.Text/bin/$(Configuration)/netstandard1.3/ServiceStack.Text.*"></TextFilesNetStardard13>
82+
</ItemGroup>
83+
84+
<MSBuild Projects="$(BuildSolutionDir)/src/ServiceStack.Text/ServiceStack.Text.csproj"
85+
Targets="Build"
86+
Properties="Version=$(PackageVersion);Configuration=$(Configuration)" />
87+
88+
<MakeDir Directories="$(NuGetPackageDir)/ServiceStack.Text.Core/lib/netstandard1.1" Condition="!Exists('$(NuGetPackageDir)/ServiceStack.Text.Core/lib/netstandard1.1')" />
89+
<Copy SourceFiles="%(TextFilesNetStardard11.Identity)" DestinationFolder="$(NuGetPackageDir)/ServiceStack.Text.Core/lib/netstandard1.1" />
90+
91+
<MakeDir Directories="$(NuGetPackageDir)/ServiceStack.Text.Core/lib/netstandard1.3" Condition="!Exists('$(NuGetPackageDir)/ServiceStack.Text.Core/lib/netstandard1.3')" />
92+
<Copy SourceFiles="%(TextFilesNetStardard13.Identity)" DestinationFolder="$(NuGetPackageDir)/ServiceStack.Text.Core/lib/netstandard1.3" />
93+
94+
<Exec Command="&quot;$(NuGetPath)&quot; pack &quot;$(NuGetPackageDir)/ServiceStack.Text.Core/servicestack.text.core.nuspec&quot; -OutputDirectory &quot;$(NuGetPackageDir)&quot; -Version $(PackageCoreVersion) -Symbols"
95+
LogStandardErrorAsError="true" />
96+
97+
</Target>
98+
</Project>

build/build.bat

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
SET MSBUILD="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe"
22

3-
%MSBUILD% build.proj /target:NuGetPack /property:Configuration=Release;RELEASE=true;PatchVersion=0;PatchCoreVersion=0
4-
REM %MSBUILD% build-sn.proj /target:NuGetPack /property:Configuration=Signed;RELEASE=true;PatchVersion=0;PatchCoreVersion=0
3+
REM %MSBUILD% build-sn.proj /target:NuGetPack /property:Configuration=Signed;RELEASE=true;PatchVersion=9
4+
%MSBUILD% build-core.proj /target:NuGetPack /property:Configuration=Release;PatchVersion=41
5+
%MSBUILD% build.proj /target:NuGetPack /property:Configuration=Release;PatchVersion=9
6+

build/build.proj

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,13 @@
1515
<Configuration Condition="$(Configuration) == ''">Release</Configuration>
1616
<NuGetPath>$(BuildSolutionDir)/src/.nuget/nuget.exe</NuGetPath>
1717
<NuGetPackageDir>$(BuildSolutionDir)/NuGet/</NuGetPackageDir>
18-
<NuGetPackageCoreDir>$(BuildSolutionDir)/NuGet.Core/</NuGetPackageCoreDir>
1918
<Version>$(MajorVersion).$(MinorVersion).$(PatchVersion).0</Version>
2019
<PackageVersion>$(MajorVersion).$(MinorVersion).$(PatchVersion)</PackageVersion>
21-
<PackageCoreVersion>1.0.$(PatchCoreVersion)</PackageCoreVersion>
2220
<EnvVersion>$(MajorVersion).$(MinorVersion)$(PatchVersion)</EnvVersion>
2321
</PropertyGroup>
2422

2523
<ItemGroup>
2624
<NugetPackageFilesToDelete Include="$(NuGetPackageDir)/*.nupkg"/>
27-
<NugetPackageFilesToDelete Include="$(NuGetPackageCoreDir)/*.nupkg"/>
2825
</ItemGroup>
2926

3027
<PropertyGroup>
@@ -64,19 +61,11 @@
6461
<Find>new DateTime.*</Find>
6562
<ReplaceWith>new DateTime($([System.DateTime]::Now.ToString(`yyyy,MM,dd`)));</ReplaceWith>
6663
</RegexTransform>
67-
<RegexTransform Include="$(BuildSolutionDir)/tests/**/*.config">
68-
<Find>key="servicestack:license".*</Find>
69-
<ReplaceWith>key="servicestack:license" value="$([System.IO.File]::ReadAllText($(MSBuildProjectDirectory)/appsettings.license.txt))" /&gt;</ReplaceWith>
70-
</RegexTransform>
7164
<!--Update Min Dependency Version -->
7265
<RegexTransform Include="$(NuGetPackageDir)/**/*.nuspec">
7366
<Find>version="4\.5[^"]*"</Find>
7467
<ReplaceWith>version="$(PackageVersion)"</ReplaceWith>
7568
</RegexTransform>
76-
<RegexTransform Include="$(NuGetPackageCoreDir)/**/*.nuspec">
77-
<Find>version="1\.0\.[^"]*"</Find>
78-
<ReplaceWith>version="$(PackageCoreVersion)"</ReplaceWith>
79-
</RegexTransform>
8069
</ItemGroup>
8170

8271
<RegexTransform Items="@(RegexTransform)" />
@@ -91,9 +80,6 @@
9180
<TextFiles Include="$(SrcDir)/ServiceStack.Text/bin/$(Configuration)/net45/ServiceStack.Text.*"></TextFiles>
9281
<TextFilesPortable Include="$(SrcDir)/ServiceStack.Text/bin/$(Configuration)/portable45-net45+win8/ServiceStack.Text.*"></TextFilesPortable>
9382
<TextSl5Files Include="$(SrcDir)/ServiceStack.Text/bin/SL5/ServiceStack.Text.*"></TextSl5Files>
94-
95-
<TextFilesNetStardard11 Include="$(SrcDir)/ServiceStack.Text/bin/$(Configuration)/netstandard1.1/ServiceStack.Text.*"></TextFilesNetStardard11>
96-
<TextFilesNetStardard13 Include="$(SrcDir)/ServiceStack.Text/bin/$(Configuration)/netstandard1.3/ServiceStack.Text.*"></TextFilesNetStardard13>
9783
</ItemGroup>
9884

9985
<MSBuild Projects="$(BuildSolutionDir)/src/ServiceStack.Text/ServiceStack.Text.csproj"
@@ -118,15 +104,5 @@
118104
<Exec Command="&quot;$(NuGetPath)&quot; pack &quot;$(NuGetPackageDir)/ServiceStack.Text/servicestack.text.nuspec&quot; -OutputDirectory &quot;$(NuGetPackageDir)&quot; -Version $(PackageVersion) -Symbols"
119105
LogStandardErrorAsError="true" />
120106

121-
<!-- .NET Core -->
122-
<MakeDir Directories="$(NuGetPackageCoreDir)/ServiceStack.Text.Core/lib/netstandard1.1" Condition="!Exists('$(NuGetPackageCoreDir)/ServiceStack.Text.Core/lib/netstandard1.1')" />
123-
<Copy SourceFiles="%(TextFilesNetStardard11.Identity)" DestinationFolder="$(NuGetPackageCoreDir)/ServiceStack.Text.Core/lib/netstandard1.1" />
124-
125-
<MakeDir Directories="$(NuGetPackageCoreDir)/ServiceStack.Text.Core/lib/netstandard1.3" Condition="!Exists('$(NuGetPackageCoreDir)/ServiceStack.Text.Core/lib/netstandard1.3')" />
126-
<Copy SourceFiles="%(TextFilesNetStardard13.Identity)" DestinationFolder="$(NuGetPackageCoreDir)/ServiceStack.Text.Core/lib/netstandard1.3" />
127-
128-
<Exec Command="&quot;$(NuGetPath)&quot; pack &quot;$(NuGetPackageCoreDir)/ServiceStack.Text.Core/servicestack.text.core.nuspec&quot; -OutputDirectory &quot;$(NuGetPackageCoreDir)&quot; -Version $(PackageCoreVersion) -Symbols"
129-
LogStandardErrorAsError="true" />
130-
131107
</Target>
132108
</Project>

0 commit comments

Comments
 (0)