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) == ''" >5</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
+ <NuGetPackageDir >$(BuildSolutionDir)/NuGet/</NuGetPackageDir >
17
+ <PackageVersion >$(MajorVersion).$(MinorVersion).$(PatchVersion)</PackageVersion >
18
+ </PropertyGroup >
19
+
20
+ <PropertyGroup >
21
+ <DoBuildSolutionsDependsOn >
22
+ BeforeBuildSolutions;
23
+ BuildSolutions
24
+ </DoBuildSolutionsDependsOn >
25
+ </PropertyGroup >
26
+
27
+ <Target Name =" BeforeBuildSolutions" >
28
+ <Message Text =" *****Before building solution*****" Importance =" high" />
29
+ <CallTarget Targets =" UpdateVersion" />
30
+ </Target >
31
+
32
+ <Target Name =" BuildSolutions" >
33
+ <CallTarget Targets =" ClearNuGetRestoreCaches" />
34
+ <MSBuild Projects =" $(BuildSolutionDir)/src/ServiceStack.Text/ServiceStack.Text.csproj" Targets =" Restore" />
35
+ </Target >
36
+
37
+ <!-- need to remove old caches from nuget restore from .Core csproj's -->
38
+ <Target Name =" ClearNuGetRestoreCaches" >
39
+ <RemoveDir Directories =" $(SrcDir)/ServiceStack.Text/obj" />
40
+ </Target >
41
+
42
+ <Target Name =" UpdateVersion" >
43
+ <!-- Update Version -->
44
+ <ItemGroup >
45
+ <RegexTransform Include =" $(SrcDir)/ServiceStack.Text/Env.cs" >
46
+ <Find >ServiceStackVersion = \d+\.\d+m;</Find >
47
+ <ReplaceWith >ServiceStackVersion = $(MajorVersion).$(MinorVersion)$(PatchVersion)m;</ReplaceWith >
48
+ </RegexTransform >
49
+
50
+ <RegexTransform Include =" $(SrcDir)/ServiceStack.Text/Env.cs" >
51
+ <Find >new DateTime.*</Find >
52
+ <ReplaceWith >new DateTime($([System.DateTime]::Now.ToString(`yyyy,MM,dd`)));</ReplaceWith >
53
+ </RegexTransform >
54
+
55
+ <!-- Update Min Dependency Version -->
56
+ <RegexTransform Include =" $(BuildSolutionDir)/src/Directory.Build.props;$(BuildSolutionDir)/tests/Directory.Build.props" >
57
+ <Find >< Version> [^< ]*</Find >
58
+ <ReplaceWith >< Version> $(PackageVersion)</ReplaceWith >
59
+ </RegexTransform >
60
+ </ItemGroup >
61
+
62
+ <RegexTransform Items =" @(RegexTransform)" />
63
+ </Target >
64
+
65
+ <Target Name =" Default" DependsOnTargets =" $(DoBuildSolutionsDependsOn)" >
66
+
67
+ <!-- ServiceStack.Memory -->
68
+ <MSBuild Projects =" $(BuildSolutionDir)/src/ServiceStack.Memory/ServiceStack.Memory.csproj"
69
+ Targets =" Build;Pack"
70
+ Properties =" Configuration=$(Configuration)" />
71
+
72
+ <!-- ServiceStack.Text -->
73
+ <MSBuild Projects =" $(BuildSolutionDir)/src/ServiceStack.Text/ServiceStack.Text.csproj"
74
+ Targets =" Build;Pack"
75
+ Properties =" Configuration=$(Configuration)" />
76
+
77
+
78
+ <!-- Copy all *.nupkg to /NuGet -->
79
+ <ItemGroup >
80
+ <NugetPackagesToMove Include =" $(BuildSolutionDir)/src/**/bin/$(Configuration)/*.nupkg" />
81
+ </ItemGroup >
82
+ <Move SourceFiles =" @(NugetPackagesToMove)" DestinationFolder =" $(NuGetPackageDir)" />
83
+
84
+ </Target >
85
+ </Project >
0 commit comments