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 =" " $(NuGetPath)" pack " $(NuGetPackageDir)/ServiceStack.Text.Core/servicestack.text.core.nuspec" -OutputDirectory " $(NuGetPackageDir)" -Version $(PackageCoreVersion) -Symbols"
95
+ LogStandardErrorAsError =" true" />
96
+
97
+ </Target >
98
+ </Project >
0 commit comments