Skip to content
This repository has been archived by the owner on Oct 13, 2020. It is now read-only.

Commit

Permalink
switched to gitversion
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoertgen committed Aug 30, 2015
1 parent 7dde1f8 commit 6420f88
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 45 deletions.
File renamed without changes.
6 changes: 0 additions & 6 deletions .nuget/packages.config

This file was deleted.

6 changes: 4 additions & 2 deletions MyLib/MyLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,16 @@
<None Include="Package.nuspec" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\OneClickBuild.1.5.0.0\build\OneClickBuild.targets" Condition="Exists('..\packages\OneClickBuild.1.5.0.0\build\OneClickBuild.targets')" />
<Import Project="MyLib.targets" />
<Import Project="..\packages\GitVersionTask.3.0.2\Build\GitVersionTask.targets" Condition="Exists('..\packages\GitVersionTask.3.0.2\Build\GitVersionTask.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\GitVersionTask.3.0.2\Build\GitVersionTask.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\GitVersionTask.3.0.2\Build\GitVersionTask.targets'))" />
<Error Condition="!Exists('..\packages\OneClickBuild.1.5.0.0\build\OneClickBuild.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\OneClickBuild.1.5.0.0\build\OneClickBuild.targets'))" />
</Target>
<Import Project="MyLib.targets" />
<Import Project="..\packages\OneClickBuild.1.5.0.0\build\OneClickBuild.targets" Condition="Exists('..\packages\OneClickBuild.1.5.0.0\build\OneClickBuild.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
5 changes: 0 additions & 5 deletions MyLib/MyLib.targets
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- MSBuildTasks -->
<PropertyGroup>
<PackageVersion>1.0.0</PackageVersion>
</PropertyGroup>

<Target Name="Deploy">
<Message Text="Skipping 'Deploy' for $(ProjectName)" Importance="High" />
</Target>
Expand Down
Binary file added MyLib/MyLib.v2.ncrunchproject
Binary file not shown.
2 changes: 1 addition & 1 deletion MyLib/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MSBuildTasks" version="1.4.0.88" targetFramework="net4" />
<package id="GitVersionTask" version="3.0.2" targetFramework="net4" developmentDependency="true" />
<package id="NUnit" version="2.6.4" targetFramework="net4" />
<package id="NUnit.Runners" version="2.6.4" targetFramework="net4" />
<package id="OneClickBuild" version="1.5.0.0" targetFramework="net4" />
Expand Down
1 change: 1 addition & 0 deletions OneClickBuild.sln
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".build", ".build", "{73075679-9D33-4F3E-8ED4-73261F88F90B}"
ProjectSection(SolutionItems) = preProject
build.bat = build.bat
.build\OneClickBuild.targets = .build\OneClickBuild.targets
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OneClickBuild", "OneClickBuild\OneClickBuild.csproj", "{02B527C6-BE5E-4245-8B08-6D11E5825986}"
Expand Down
22 changes: 14 additions & 8 deletions OneClickBuild/build/OneClickBuild.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<Target Name="Version" DependsOnTargets="UpdateAssemblyInfo" />
<Target Name="Version" BeforeTargets="BeforeBuild" DependsOnTargets="VersionWithGit" />
<Target Name="Test" DependsOnTargets="Build;TestWithNunit"/>
<Target Name="Coverage" DependsOnTargets="Build;OpenCoverWithNUnit"/>
<Target Name="CoverageReport" DependsOnTargets="Coverage;OpenCoverReport"/>
Expand All @@ -18,7 +18,6 @@
</PropertyGroup>

<PropertyGroup>
<MSBuildCommunityTasksPath>$(SolutionDir).build</MSBuildCommunityTasksPath>
<TestsProjectPattern Condition="'$(TestsProjectPattern)' == '' And $(OutputType.EndsWith('Exe'))">$(OutDir)$(AssemblyName).exe</TestsProjectPattern>
<TestsProjectPattern Condition="'$(TestsProjectPattern)' == '' And '$(OutputType)' == 'Library'">$(OutDir)$(AssemblyName).dll</TestsProjectPattern>
<TestResultsDir Condition="'$(TestResultsDir)' == ''">$(SolutionDir)testresults\</TestResultsDir>
Expand Down Expand Up @@ -46,16 +45,26 @@

</PropertyGroup>

<!--Git Versioning -->
<Target Name="VersionWithGit">
<GitVersionTask.GetVersion SolutionDirectory="$(SolutionDir)" />
</Target>

<!-- NuGet Packaging -->
<Target Name="PackageWithNuGet" DependsOnTargets="Build">
<Target Name="PackageWithNuGet" DependsOnTargets="Build;Version">
<PropertyGroup>
<PackageVersion>$(GitVersion_MajorMinorPatch).$(Build)</PackageVersion>
<Revision>$(GitVersion_Sha)</Revision>
</PropertyGroup>

<Warning Condition="!Exists($(NuspecFile))" Text="Skipping target because .nuspec-file is missing (expected '$(NuspecFile)')" />
<Exec Condition="Exists($(NuspecFile))"
Command="nuget pack $(NuspecFile) -Properties Version=$(NuGetVersionV2);Revision=$(Sha);Configuration=$(Configuration)"/>
Command="nuget pack $(NuspecFile) -Properties Version=$(PackageVersion);Revision=$(Revision);Configuration=$(Configuration)"/>
</Target>

<Target Name="DeployWithNuGet" DependsOnTargets="PackageWithNuGet">
<PropertyGroup>
<PackageFile>$(ProjectName.$(NuGetVersionV2).nupkg)</PackageFile>
<PackageFile>$(ProjectName.$(GitVersion_MajorMinorPatch).$(Build).nupkg</PackageFile>
</PropertyGroup>
<Warning Condition="'$(PackageFile)'=='' Or !Exists($(PackageFile))" Text="Skipping target because package file has not been built." />
<!-- To set API key use "NuGet.exe setApiKey <key> -Source <source>" -->
Expand Down Expand Up @@ -133,9 +142,6 @@
<Delete Files="$(CoverageReportDir)" />
</Target>

<!-- import msbuild tasks -->
<Import Project="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.Targets" />

<!-- import custom user solution targets -->
<Import Project="$(SolutionDir)\solution.targets" />
</Project>
15 changes: 0 additions & 15 deletions OneClickBuild/tools/VersionInfo.g.cs

This file was deleted.

8 changes: 0 additions & 8 deletions OneClickBuild/tools/solution.targets
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<!-- TODO: Adjust version -->
<PackageVersion>1.0.0.$(Build)</PackageVersion>
</PropertyGroup>

<ItemGroup>
<Compile Include="$(SolutionDir)SolutionInfo.cs">
<Link>Properties\SolutionInfo.cs</Link>
</Compile>
<Compile Include="$(SolutionDir)VersionInfo.g.cs">
<Link>Properties\VersionInfo.g.cs</Link>
</Compile>
</ItemGroup>


Expand Down

0 comments on commit 6420f88

Please sign in to comment.