This repository has been archived by the owner on Dec 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 630
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Default" | ||
xmlns='http://schemas.microsoft.com/developer/msbuild/2003' ToolsVersion="4.0"> | ||
<Import Project="$(MSBuildProjectDirectory)/build.tasks" /> | ||
|
||
<PropertyGroup> | ||
<MajorVersion Condition="$(MajorVersion) == ''">5</MajorVersion> | ||
<MinorVersion Condition="$(MinorVersion) == ''">0</MinorVersion> | ||
<PatchVersion Condition="$(PatchVersion) == ''">$(BUILD_NUMBER)</PatchVersion> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<BuildSolutionDir>$(MSBuildProjectDirectory)/..</BuildSolutionDir> | ||
<SrcDir>$(BuildSolutionDir)/src</SrcDir> | ||
<Configuration Condition="$(Configuration) == ''">Release</Configuration> | ||
<NuGetPackageDir>$(BuildSolutionDir)/NuGet/</NuGetPackageDir> | ||
<PackageVersion>$(MajorVersion).$(MinorVersion).$(PatchVersion)</PackageVersion> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<DoBuildSolutionsDependsOn> | ||
BeforeBuildSolutions; | ||
BuildSolutions | ||
</DoBuildSolutionsDependsOn> | ||
</PropertyGroup> | ||
|
||
<Target Name="BeforeBuildSolutions"> | ||
<Message Text="*****Before building solution*****" Importance="high"/> | ||
<CallTarget Targets="UpdateVersion" /> | ||
</Target> | ||
|
||
<Target Name="BuildSolutions"> | ||
<CallTarget Targets="ClearNuGetRestoreCaches" /> | ||
<MSBuild Projects="$(BuildSolutionDir)/src/ServiceStack.Text/ServiceStack.Text.csproj" Targets="Restore" /> | ||
</Target> | ||
|
||
<!-- need to remove old caches from nuget restore from .Core csproj's --> | ||
<Target Name="ClearNuGetRestoreCaches"> | ||
<RemoveDir Directories="$(SrcDir)/ServiceStack.Text/obj" /> | ||
</Target> | ||
|
||
<Target Name="UpdateVersion"> | ||
<!-- Update Version --> | ||
<ItemGroup> | ||
<RegexTransform Include="$(SrcDir)/ServiceStack.Text/Env.cs"> | ||
<Find>ServiceStackVersion = \d+\.\d+m;</Find> | ||
<ReplaceWith>ServiceStackVersion = $(MajorVersion).$(MinorVersion)$(PatchVersion)m;</ReplaceWith> | ||
</RegexTransform> | ||
|
||
<RegexTransform Include="$(SrcDir)/ServiceStack.Text/Env.cs"> | ||
<Find>new DateTime.*</Find> | ||
<ReplaceWith>new DateTime($([System.DateTime]::Now.ToString(`yyyy,MM,dd`)));</ReplaceWith> | ||
</RegexTransform> | ||
|
||
<!--Update Min Dependency Version --> | ||
<RegexTransform Include="$(BuildSolutionDir)/src/Directory.Build.props;$(BuildSolutionDir)/tests/Directory.Build.props"> | ||
<Find><Version>[^<]*</Find> | ||
<ReplaceWith><Version>$(PackageVersion)</ReplaceWith> | ||
</RegexTransform> | ||
</ItemGroup> | ||
|
||
<RegexTransform Items="@(RegexTransform)" /> | ||
</Target> | ||
|
||
<Target Name="Default" DependsOnTargets="$(DoBuildSolutionsDependsOn)"> | ||
|
||
<!-- ServiceStack.Memory --> | ||
<MSBuild Projects="$(BuildSolutionDir)/src/ServiceStack.Memory/ServiceStack.Memory.csproj" | ||
Targets="Build;Pack" | ||
Properties="Configuration=$(Configuration)" /> | ||
|
||
<!-- ServiceStack.Text --> | ||
<MSBuild Projects="$(BuildSolutionDir)/src/ServiceStack.Text/ServiceStack.Text.csproj" | ||
Targets="Build;Pack" | ||
Properties="Configuration=$(Configuration)" /> | ||
|
||
|
||
<!-- Copy all *.nupkg to /NuGet --> | ||
<ItemGroup> | ||
<NugetPackagesToMove Include="$(BuildSolutionDir)/src/**/bin/$(Configuration)/*.nupkg"/> | ||
</ItemGroup> | ||
<Move SourceFiles="@(NugetPackagesToMove)" DestinationFolder="$(NuGetPackageDir)" /> | ||
|
||
</Target> | ||
</Project> |