|
66 | 66 | <None Include="NugetAssets\chocolateyUninstall.ps1">
|
67 | 67 | <SubType>Designer</SubType>
|
68 | 68 | </None>
|
| 69 | + <None Include="NugetAssets\GitVersion.CommandLine.nuspec" /> |
69 | 70 | <None Include="NugetAssets\GitVersion.nuspec">
|
70 | 71 | <SubType>Designer</SubType>
|
71 | 72 | </None>
|
|
97 | 98 | </ItemGroup>
|
98 | 99 | <Delete Files="@(ExeFilesToDelete)" />
|
99 | 100 | </Target>
|
| 101 | + <UsingTask TaskName="ReplaceFileText" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll"> |
| 102 | + <ParameterGroup> |
| 103 | + <InputFilename ParameterType="System.String" Required="true" /> |
| 104 | + <OutputFilename ParameterType="System.String" Required="true" /> |
| 105 | + <MatchExpression ParameterType="System.String" Required="true" /> |
| 106 | + <ReplacementText ParameterType="System.String" Required="true" /> |
| 107 | + </ParameterGroup> |
| 108 | + <Task> |
| 109 | + <Reference Include="System.Core" /> |
| 110 | + <Using Namespace="System" /> |
| 111 | + <Using Namespace="System.IO" /> |
| 112 | + <Using Namespace="System.Text.RegularExpressions" /> |
| 113 | + <Code Type="Fragment" Language="cs"> |
| 114 | + <![CDATA[ |
| 115 | + File.WriteAllText( |
| 116 | + OutputFilename, |
| 117 | + Regex.Replace(File.ReadAllText(InputFilename), MatchExpression, ReplacementText) |
| 118 | + ); |
| 119 | + ]]> |
| 120 | + </Code> |
| 121 | + </Task> |
| 122 | + </UsingTask> |
100 | 123 | <Target Name="AfterBuild" DependsOnTargets="Clean">
|
101 | 124 | <!-- NugetExeBuild -->
|
102 | 125 | <MakeDir Directories="$(SolutionDir)NuGetExeBuild" />
|
103 | 126 | <Copy SourceFiles="$(OutputPath)\GitVersion.pdb" DestinationFolder="$(SolutionDir)NuGetExeBuild\Tools" />
|
104 | 127 | <Copy SourceFiles="$(OutputPath)\GitVersion.exe" DestinationFolder="$(SolutionDir)NuGetExeBuild\Tools" />
|
105 | 128 | <Copy SourceFiles="$(ProjectDir)NugetAssets\chocolateyInstall.ps1" DestinationFolder="$(SolutionDir)NuGetExeBuild\Tools" />
|
106 | 129 | <Copy SourceFiles="$(ProjectDir)NugetAssets\chocolateyUninstall.ps1" DestinationFolder="$(SolutionDir)NuGetExeBuild\Tools" />
|
107 |
| - <Copy SourceFiles="$(ProjectDir)NugetAssets\GitVersion.nuspec" DestinationFolder="$(SolutionDir)NuGetExeBuild" /> |
| 130 | + <Copy SourceFiles="$(ProjectDir)NugetAssets\GitVersion.Portable.nuspec" DestinationFolder="$(SolutionDir)NuGetExeBuild" /> |
108 | 131 | <PepitaPackage.CreatePackageTask NuGetBuildDirectory="$(SolutionDir)NuGetExeBuild" MetadataAssembly="$(OutputPath)GitVersion.exe" />
|
| 132 | + <!-- NugetCommandLineBuild --> |
| 133 | + <MakeDir Directories="$(SolutionDir)NuGetCommandLineBuild" /> |
| 134 | + <Copy SourceFiles="$(OutputPath)\GitVersion.pdb" DestinationFolder="$(SolutionDir)NuGetCommandLineBuild\Tools" /> |
| 135 | + <Copy SourceFiles="$(OutputPath)\GitVersion.exe" DestinationFolder="$(SolutionDir)NuGetCommandLineBuild\Tools" /> |
| 136 | + <Copy SourceFiles="$(ProjectDir)NugetAssets\GitVersion.CommandLine.nuspec" DestinationFolder="$(SolutionDir)NuGetCommandLineBuild" /> |
| 137 | + <PepitaPackage.CreatePackageTask NuGetBuildDirectory="$(SolutionDir)NuGetCommandLineBuild" MetadataAssembly="$(OutputPath)GitVersion.exe" /> |
109 | 138 | <!-- Gem -->
|
110 | 139 | <Copy SourceFiles="$(OutputPath)\GitVersion.pdb" DestinationFolder="$(SolutionDir)GemBuild\bin" />
|
111 | 140 | <Copy SourceFiles="$(OutputPath)\GitVersion.exe" DestinationFolder="$(SolutionDir)GemBuild\bin" />
|
112 | 141 | <ItemGroup>
|
113 | 142 | <GemFiles Include="$(ProjectDir)GemAssets\bin*\**\*.*" />
|
114 | 143 | <GemFiles Include="$(ProjectDir)GemAssets\lib*\**\*.*" />
|
| 144 | + <GemFiles Include="$(ProjectDir)GemAssets\spec*\**\*.*" /> |
115 | 145 | <GemFiles Include="$(ProjectDir)GemAssets\*.gemspec" />
|
| 146 | + <GemFiles Include="$(ProjectDir)GemAssets\.rspec" /> |
| 147 | + <GemFiles Include="$(ProjectDir)GemAssets\Guardfile" /> |
| 148 | + <GemFiles Include="$(ProjectDir)GemAssets\Gemfile" /> |
116 | 149 | </ItemGroup>
|
117 | 150 | <Copy SourceFiles="@(GemFiles)" DestinationFiles="@(GemFiles->'$(SolutionDir)GemBuild\%(RecursiveDir)%(Filename)%(Extension)')" />
|
| 151 | + |
| 152 | + <PropertyGroup> |
| 153 | + <GemVersion Condition="'$(GitVersion_PreReleaseTag)' == ''">$(GitVersion_MajorMinorPatch)</GemVersion> |
| 154 | + <GemVersion Condition="'$(GitVersion_PreReleaseTag)' != ''">$(GitVersion_MajorMinorPatch).$(GitVersion_PreReleaseTag)</GemVersion> |
| 155 | + </PropertyGroup> |
| 156 | + |
| 157 | + <ReplaceFileText |
| 158 | + InputFilename="$(SolutionDir)GemBuild\gitversion.gemspec" |
| 159 | + OutputFilename="$(SolutionDir)GemBuild\gitversion.gemspec" |
| 160 | + MatchExpression="\$version\$" |
| 161 | + ReplacementText="$(GemVersion)" |
| 162 | + Condition="'$(GitVersion_SemVer)' != ''"/> |
| 163 | + |
| 164 | + <Exec Command="gem build gitversion.gemspec" ContinueOnError="True" |
| 165 | + WorkingDirectory="$(SolutionDir)GemBuild" Condition="'$(GitVersion_SemVer)' != ''" /> |
118 | 166 | </Target>
|
119 | 167 | <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
120 | 168 | <PropertyGroup>
|
|
0 commit comments