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
+ <ItemGroup >
34
+ <NugetPackageFilesToDelete Include =" $(NuGetPackageDir)/*.nupkg" />
35
+ </ItemGroup >
36
+ <Delete Files =" @(NugetPackageFilesToDelete)" />
37
+ <CallTarget Targets =" ClearNuGetRestoreCaches" />
38
+ </Target >
39
+
40
+ <!-- need to remove old caches from nuget restore from .Core csproj's -->
41
+ <Target Name =" ClearNuGetRestoreCaches" >
42
+ <RemoveDir Directories =" $(SrcDir)/ServiceStack.OrmLite/obj" />
43
+ <RemoveDir Directories =" $(SrcDir)/ServiceStack.OrmLite.Firebird/obj" />
44
+ <RemoveDir Directories =" $(SrcDir)/ServiceStack.OrmLite.MySql/obj" />
45
+ <RemoveDir Directories =" $(SrcDir)/ServiceStack.OrmLite.MySqlConnector/obj" />
46
+ <RemoveDir Directories =" $(SrcDir)/ServiceStack.OrmLite.PostgreSQL/obj" />
47
+ <RemoveDir Directories =" $(SrcDir)/ServiceStack.OrmLite.Sqlite/obj" />
48
+ <RemoveDir Directories =" $(SrcDir)/ServiceStack.OrmLite.SqlServer/obj" />
49
+ </Target >
50
+
51
+ <Target Name =" UpdateVersion" >
52
+ <!-- Update Version -->
53
+ <ItemGroup >
54
+ <RegexTransform Include =" $(BuildSolutionDir)/src/Directory.Build.props;$(BuildSolutionDir)/tests/Directory.Build.props" >
55
+ <Find >< Version> [^< ]*</Find >
56
+ <ReplaceWith >< Version> $(PackageVersion)</ReplaceWith >
57
+ </RegexTransform >
58
+ </ItemGroup >
59
+
60
+ <RegexTransform Items =" @(RegexTransform)" />
61
+ </Target >
62
+
63
+ <Target Name =" Default" DependsOnTargets =" $(DoBuildSolutionsDependsOn)" >
64
+
65
+ <!-- ServiceStack.OrmLite.Core -->
66
+ <MSBuild Projects =" $(BuildSolutionDir)/src/ServiceStack.OrmLite/ServiceStack.OrmLite.Core.csproj" Targets =" Restore" />
67
+ <MSBuild Projects =" $(BuildSolutionDir)/src/ServiceStack.OrmLite/ServiceStack.OrmLite.Core.csproj"
68
+ Targets =" Build;Pack"
69
+ Properties =" Configuration=$(Configuration)" />
70
+
71
+ <!-- ServiceStack.OrmLite.Firebird.Core -->
72
+ <MSBuild Projects =" $(BuildSolutionDir)/src/ServiceStack.OrmLite.Firebird/ServiceStack.OrmLite.Firebird.Core.csproj" Targets =" Restore" />
73
+ <MSBuild Projects =" $(BuildSolutionDir)/src/ServiceStack.OrmLite.Firebird/ServiceStack.OrmLite.Firebird.Core.csproj"
74
+ Targets =" Build;Pack"
75
+ Properties =" Configuration=$(Configuration)" />
76
+
77
+ <!-- ServiceStack.OrmLite.MySql.Core -->
78
+ <MSBuild Projects =" $(BuildSolutionDir)/src/ServiceStack.OrmLite.MySql/ServiceStack.OrmLite.MySql.Core.csproj" Targets =" Restore" />
79
+ <MSBuild Projects =" $(BuildSolutionDir)/src/ServiceStack.OrmLite.MySql/ServiceStack.OrmLite.MySql.Core.csproj"
80
+ Targets =" Build;Pack"
81
+ Properties =" Configuration=$(Configuration)" />
82
+
83
+ <!-- ServiceStack.OrmLite.MySqlConnector.Core -->
84
+ <MSBuild Projects =" $(BuildSolutionDir)/src/ServiceStack.OrmLite.MySqlConnector/ServiceStack.OrmLite.MySqlConnector.Core.csproj" Targets =" Restore" />
85
+ <MSBuild Projects =" $(BuildSolutionDir)/src/ServiceStack.OrmLite.MySqlConnector/ServiceStack.OrmLite.MySqlConnector.Core.csproj"
86
+ Targets =" Build;Pack"
87
+ Properties =" Configuration=$(Configuration)" />
88
+
89
+ <!-- ServiceStack.OrmLite.PostgreSQL.Core -->
90
+ <MSBuild Projects =" $(BuildSolutionDir)/src/ServiceStack.OrmLite.PostgreSQL/ServiceStack.OrmLite.PostgreSQL.Core.csproj" Targets =" Restore" />
91
+ <MSBuild Projects =" $(BuildSolutionDir)/src/ServiceStack.OrmLite.PostgreSQL/ServiceStack.OrmLite.PostgreSQL.Core.csproj"
92
+ Targets =" Build;Pack"
93
+ Properties =" Configuration=$(Configuration)" />
94
+
95
+ <!-- ServiceStack.OrmLite.Sqlite.Core -->
96
+ <MSBuild Projects =" $(BuildSolutionDir)/src/ServiceStack.OrmLite.Sqlite/ServiceStack.OrmLite.Sqlite.Core.csproj" Targets =" Restore" />
97
+ <MSBuild Projects =" $(BuildSolutionDir)/src/ServiceStack.OrmLite.Sqlite/ServiceStack.OrmLite.Sqlite.Core.csproj"
98
+ Targets =" Build;Pack"
99
+ Properties =" Configuration=$(Configuration)" />
100
+
101
+ <!-- ServiceStack.OrmLite.SqlServer.Core -->
102
+ <MSBuild Projects =" $(BuildSolutionDir)/src/ServiceStack.OrmLite.SqlServer/ServiceStack.OrmLite.SqlServer.Core.csproj" Targets =" Restore" />
103
+ <MSBuild Projects =" $(BuildSolutionDir)/src/ServiceStack.OrmLite.SqlServer/ServiceStack.OrmLite.SqlServer.Core.csproj"
104
+ Targets =" Build;Pack"
105
+ Properties =" Configuration=$(Configuration)" />
106
+
107
+
108
+ <!-- Copy all *.nupkg to /NuGet -->
109
+ <ItemGroup >
110
+ <NugetPackagesToMove Include =" $(BuildSolutionDir)/src/**/bin/$(Configuration)/*.nupkg" />
111
+ </ItemGroup >
112
+ <Move SourceFiles =" @(NugetPackagesToMove)" DestinationFolder =" $(NuGetPackageDir)" />
113
+
114
+ <!-- leave .sln in optimal state then NuGet restore .sln to build -->
115
+ <CallTarget Targets =" ClearNuGetRestoreCaches" />
116
+
117
+ </Target >
118
+ </Project >
0 commit comments