This repository has been archived by the owner on Dec 24, 2022. It is now read-only.
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
5 changed files
with
153 additions
and
3 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 |
---|---|---|
|
@@ -107,4 +107,6 @@ _UpgradeReport_Files/ | |
Backup*/ | ||
UpgradeLog*.XML | ||
*.cmd | ||
*.nupkg | ||
*.nupkg | ||
|
||
*.txt |
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
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,108 @@ | ||
<?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) == ''">4</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> | ||
<NuGetPath>$(BuildSolutionDir)/src/.nuget/nuget.exe</NuGetPath> | ||
<NuGetPackageDir>$(BuildSolutionDir)/NuGet/</NuGetPackageDir> | ||
<Version>$(MajorVersion).$(MinorVersion).$(PatchVersion).0</Version> | ||
<UnstableTag Condition="$(RELEASE) == ''">-unstable</UnstableTag> | ||
<PackageVersion>$(MajorVersion).$(MinorVersion).$(PatchVersion)$(UnstableTag)</PackageVersion> | ||
<EnvVersion>$(MajorVersion).$(MinorVersion)$(PatchVersion)</EnvVersion> | ||
</PropertyGroup> | ||
|
||
|
||
<ItemGroup> | ||
<NugetPackageFilesToDelete Include="$(NuGetPackageDir)/*.nupkg"/> | ||
</ItemGroup> | ||
|
||
|
||
<PropertyGroup> | ||
<DoBuildSolutionsDependsOn> | ||
BeforeBuildSolutions; | ||
BuildSolutions | ||
</DoBuildSolutionsDependsOn> | ||
</PropertyGroup> | ||
|
||
<Target Name="Default" DependsOnTargets="$(DoBuildSolutionsDependsOn)" /> | ||
|
||
<Target Name="TeamCityBuild"> | ||
<CallTarget Targets="Default" /> | ||
</Target> | ||
|
||
<Target Name="BeforeBuildSolutions"> | ||
<Message Text="*****Before building solution*****" Importance="high"/> | ||
<!--<Copy SourceFiles="Test/ci.app.config" DestinationFiles="Test/app.config" />--> | ||
</Target> | ||
|
||
<Target Name="UnitTests" DependsOnTargets="$(DoBuildSolutionsDependsOn)"> | ||
<Exec Command="$(BuildSolutionDir)/lib/tests/nunit-console/nunit-console-x86.exe $(BuildSolutionDir)/tests/Stripe.Tests/bin/$(Configuration)/Stripe.Tests.dll"/> | ||
</Target> | ||
|
||
<Target Name="BuildSolutions"> | ||
<MSBuild Projects="$(BuildSolutionDir)/src/Stripe.sln" Targets="Build" | ||
Properties="Configuration=$(Configuration)" /> | ||
</Target> | ||
|
||
<Target Name="UpdateVersion"> | ||
<!-- Update Version --> | ||
<ItemGroup> | ||
<RegexTransform Include="$(SrcDir)/**/AssemblyInfo.cs"> | ||
<Find>\d+\.\d+\.\d+\.\d+</Find> | ||
<ReplaceWith>$(Version)</ReplaceWith> | ||
</RegexTransform> | ||
<RegexTransform Include="$(BuildSolutionDir)/tests/**/*.config"> | ||
<Find>key="servicestack:license".*</Find> | ||
<ReplaceWith>key="servicestack:license" value="$([System.IO.File]::ReadAllText($(MSBuildProjectDirectory)/appsettings.license.txt))" /></ReplaceWith> | ||
</RegexTransform> | ||
<!--Update Min Dependency Version --> | ||
<RegexTransform Include="$(NuGetPackageDir)/**/*.nuspec"> | ||
<Find>version="4\.0[^"]*"</Find> | ||
<ReplaceWith>version="$(PackageVersion)"</ReplaceWith> | ||
</RegexTransform> | ||
</ItemGroup> | ||
|
||
<RegexTransform Items="@(RegexTransform)" /> | ||
</Target> | ||
|
||
<Target Name="NuGetPack"> | ||
<CallTarget Targets="UpdateVersion" /> | ||
|
||
<Delete Files="@(NugetPackageFilesToDelete)" /> | ||
|
||
<ItemGroup> | ||
<StripeFiles Include="$(SrcDir)/Stripe/bin/$(Configuration)/Stripe.*"></StripeFiles> | ||
<StripePclFiles Include="$(SrcDir)/Stripe.Pcl/bin/$(Configuration)/Stripe.*"></StripePclFiles> | ||
</ItemGroup> | ||
|
||
<!-- PCL --> | ||
<MSBuild Projects="$(BuildSolutionDir)/src/Stripe.Pcl/Stripe.Pcl.csproj" | ||
Targets="Build" | ||
Properties="Version=$(PackageVersion);Configuration=$(Configuration);DefineConstants=PCL" /> | ||
|
||
<MakeDir Directories="$(NuGetPackageDir)/ServiceStack.Stripe/lib/portable-net45+win8+monotouch+monoandroid" Condition="!Exists('$(NuGetPackageDir)/ServiceStack.Stripe/lib/portable-net45+win8+monotouch+monoandroid')" /> | ||
<Copy SourceFiles="%(StripePclFiles.Identity)" DestinationFolder="$(NuGetPackageDir)/ServiceStack.Stripe/lib/portable-net45+win8+monotouch+monoandroid" /> | ||
|
||
<!-- .NET 4.0 --> | ||
<MSBuild Projects="$(BuildSolutionDir)/src/Stripe/Stripe.csproj" | ||
Targets="Build" | ||
Properties="Version=$(PackageVersion);Configuration=$(Configuration)" /> | ||
|
||
<MakeDir Directories="$(NuGetPackageDir)/ServiceStack.Stripe/lib/net40" Condition="!Exists('$(NuGetPackageDir)/ServiceStack.Stripe/lib/net40')" /> | ||
<Copy SourceFiles="%(StripeFiles.Identity)" DestinationFolder="$(NuGetPackageDir)/ServiceStack.Stripe/lib/net40" /> | ||
|
||
<Exec Command=""$(NuGetPath)" pack "$(NuGetPackageDir)/ServiceStack.Stripe/servicestack.stripe.nuspec" -OutputDirectory "$(NuGetPackageDir)" -Version $(PackageVersion) -Symbols" | ||
LogStandardErrorAsError="true" /> | ||
|
||
</Target> | ||
</Project> |
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,34 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" DefaultTargets="Go" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<UsingTask TaskName="RegexTransform" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll"> | ||
<ParameterGroup> | ||
<Items ParameterType="Microsoft.Build.Framework.ITaskItem[]" /> | ||
</ParameterGroup> | ||
<Task> | ||
<Using Namespace="System.IO" /> | ||
<Using Namespace="System.Text.RegularExpressions" /> | ||
<Using Namespace="Microsoft.Build.Framework" /> | ||
<Code Type="Fragment" Language="cs"> | ||
<![CDATA[ | ||
foreach(ITaskItem item in Items) { | ||
string fileName = item.GetMetadata("FullPath"); | ||
string find = item.GetMetadata("Find"); | ||
string replaceWith = item.GetMetadata("ReplaceWith"); | ||
if(!File.Exists(fileName)) { | ||
Log.LogError(null, null, null, null, 0, 0, 0, 0, String.Format("Could not find version file: {0}", fileName), new object[0]); | ||
} | ||
string content = File.ReadAllText(fileName); | ||
File.WriteAllText( | ||
fileName, | ||
Regex.Replace( | ||
content, | ||
find, | ||
replaceWith | ||
) | ||
); | ||
} | ||
]]></Code> | ||
</Task> | ||
</UsingTask> | ||
</Project> |
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,6 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<appSettings> | ||
<add key="servicestack:license" value="1001-e1JlZjoxMDAxLE5hbWU6VGVzdCBCdXNpbmVzcyxUeXBlOkJ1c2luZXNzLEhhc2g6UHVNTVRPclhvT2ZIbjQ5MG5LZE1mUTd5RUMzQnBucTFEbTE3TDczVEF4QUNMT1FhNXJMOWkzVjFGL2ZkVTE3Q2pDNENqTkQyUktRWmhvUVBhYTBiekJGUUZ3ZE5aZHFDYm9hL3lydGlwUHI5K1JsaTBYbzNsUC85cjVJNHE5QVhldDN6QkE4aTlvdldrdTgyTk1relY2eis2dFFqTThYN2lmc0JveHgycFdjPSxFeHBpcnk6MjAxMy0wMS0wMX0=" /> | ||
</appSettings> | ||
</configuration> |