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
+ </PropertyGroup >
21
+
22
+ <ItemGroup >
23
+ <NugetPackageFilesToDelete Include =" $(NuGetPackageDir)/*.nupkg" />
24
+ </ItemGroup >
25
+
26
+ <PropertyGroup >
27
+ <DoBuildSolutionsDependsOn >
28
+ BeforeBuildSolutions;
29
+ BuildSolutions
30
+ </DoBuildSolutionsDependsOn >
31
+ </PropertyGroup >
32
+
33
+ <Target Name =" Default" DependsOnTargets =" $(DoBuildSolutionsDependsOn)" />
34
+
35
+ <Target Name =" TeamCityBuild" >
36
+ <CallTarget Targets =" Default" />
37
+ </Target >
38
+
39
+ <Target Name =" BeforeBuildSolutions" >
40
+ <Message Text =" *****Before building solution*****" Importance =" high" />
41
+ </Target >
42
+
43
+ <Target Name =" BuildSolutions" >
44
+ <MSBuild Projects =" $(BuildSolutionDir)/src/ServiceStack.Redis.sln" Targets =" Build"
45
+ Properties =" Configuration=$(Configuration)" />
46
+ </Target >
47
+
48
+ <Target Name =" UpdateVersion" >
49
+ <ItemGroup >
50
+ <RegexTransform Include =" $(SrcDir)/**/AssemblyInfo.cs" >
51
+ <Find >AssemblyFileVersion\(\"\d+\.\d+\.\d+\.\d+\"\)</Find >
52
+ <ReplaceWith >AssemblyFileVersion("$(Version)")</ReplaceWith >
53
+ </RegexTransform >
54
+ <RegexTransform Include =" $(SrcDir)/**/AssemblyInfo.cs" >
55
+ <Find >AssemblyVersion\(\"\d+\.\d+\.\d+\.\d+\"\)</Find >
56
+ <ReplaceWith >AssemblyVersion("$(Version)")</ReplaceWith >
57
+ </RegexTransform >
58
+ <!-- Update Min Dependency Version -->
59
+ <RegexTransform Include =" $(NuGetPackageDir)/**/*.nuspec" >
60
+ <Find >version="1\.0\.[^"]*"</Find >
61
+ <ReplaceWith >version="$(PackageVersion)"</ReplaceWith >
62
+ </RegexTransform >
63
+ </ItemGroup >
64
+
65
+ <RegexTransform Items =" @(RegexTransform)" />
66
+ </Target >
67
+
68
+ <Target Name =" NuGetPack" >
69
+
70
+ <CallTarget Targets =" UpdateVersion" />
71
+
72
+ <Delete Files =" @(NugetPackageFilesToDelete)" />
73
+
74
+ <ItemGroup >
75
+ <RedisCoreFiles Include =" $(SrcDir)/ServiceStack.Redis/bin/$(Configuration)/netstandard1.3/ServiceStack.Redis.*" ></RedisCoreFiles >
76
+ </ItemGroup >
77
+
78
+ <MSBuild Projects =" $(BuildSolutionDir)/src/ServiceStack.Redis/ServiceStack.Redis.csproj"
79
+ Targets =" Build"
80
+ Properties =" Version=$(PackageVersion);Configuration=$(Configuration)" />
81
+
82
+ <MakeDir Directories =" $(NuGetPackageDir)/ServiceStack.Redis.Core/lib/netstandard1.3" Condition =" !Exists('$(NuGetPackageDir)/ServiceStack.Redis.Core/lib/netstandard1.3')" />
83
+ <Copy SourceFiles =" %(RedisCoreFiles.Identity)" DestinationFolder =" $(NuGetPackageDir)/ServiceStack.Redis.Core/lib/netstandard1.3" />
84
+
85
+ <Exec Command =" " $(NuGetPath)" pack " $(NuGetPackageDir)/ServiceStack.Redis.Core/servicestack.redis.core.nuspec" -OutputDirectory " $(NuGetPackageDir)" -Version $(PackageVersion)"
86
+ LogStandardErrorAsError =" true" />
87
+
88
+ </Target >
89
+ </Project >
0 commit comments