Skip to content

Commit

Permalink
Version stamping.
Browse files Browse the repository at this point in the history
Fixes #30
  • Loading branch information
dazinator committed Mar 11, 2018
1 parent 8f0bd8f commit 4fe1251
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 20 deletions.
19 changes: 2 additions & 17 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ var configuration = Argument("configuration", "Release");
///////////////////////////////////////////////////////////////////////////////
var artifactsDir = "./artifacts";
var projectName = "DotNet.Glob";
var globalAssemblyFile = "./src/GlobalAssemblyInfo.cs";
var projectToPackage = $"./src/{projectName}";
var repoBranchName = "master";
var benchMarksEnabled = EnvironmentVariable("BENCHMARKS") == "on";
Expand Down Expand Up @@ -92,20 +91,6 @@ Task("__SetAppVeyorBuildNumber")
Task("__Restore")
.Does(() => DotNetCoreRestore(solutionPath));

Task("__UpdateAssemblyVersionInformation")
.WithCriteria(isContinuousIntegrationBuild)
.Does(() =>
{
GitVersion(new GitVersionSettings {
UpdateAssemblyInfo = true,
UpdateAssemblyInfoFilePath = globalAssemblyFile
});

Information("AssemblyVersion -> {0}", gitVersionInfo.AssemblySemVer);
Information("AssemblyFileVersion -> {0}", $"{gitVersionInfo.MajorMinorPatch}.0");
Information("AssemblyInformationalVersion -> {0}", gitVersionInfo.InformationalVersion);
});

Task("__Build")
.Does(() =>
{
Expand Down Expand Up @@ -162,12 +147,12 @@ Task("__Pack")
.Does(() =>
{

var versionarg = "/p:PackageVersion=" + nugetVersion;
// var versionarg = "/p:PackageVersion=" + nugetVersion;
var settings = new DotNetCorePackSettings
{
Configuration = "Release",
OutputDirectory = $"{artifactsDir}",
ArgumentCustomization = args=>args.Append(versionarg)
// ArgumentCustomization = args=>args.Append(versionarg)
};

DotNetCorePack($"{projectToPackage}", settings);
Expand Down
12 changes: 9 additions & 3 deletions src/DotNet.Glob/DotNet.Glob.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,18 @@
<Authors>Darrell Tunnell &lt;[email protected]&gt;</Authors>
<PackageLicenseUrl>https://github.com/dazinator/DotNet.Glob/blob/master/LICENSE</PackageLicenseUrl>
<PackageTags>glob;globbing;dotnet;pattern;match</PackageTags>
<PackageReleaseNotes>This is a hotfix release to support tilde characters (~), thanks goes to @ming4883</PackageReleaseNotes>
<PackageReleaseNotes>New features and fixes. See README in Github Repo.</PackageReleaseNotes>
<RootNamespace>DotNet.Glob</RootNamespace>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net4' ">
<DefineConstants>NET40</DefineConstants>
<DefineConstants>NET40</DefineConstants>
</PropertyGroup>


<ItemGroup>
<PackageReference Include="GitVersionTask" Version="4.0.0-pullrequest1269-1531">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

</Project>
25 changes: 25 additions & 0 deletions src/NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
<config>
<add key="repositoryPath" value="packages" />
</config>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<packageSourceCredentials>
</packageSourceCredentials>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
<packageSources>
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
<add key="gitversiontemp" value="https://ci.appveyor.com/nuget/gitversion-8nigugxjftrw" />
</packageSources>
<disabledPackageSources>
</disabledPackageSources>
</configuration>

0 comments on commit 4fe1251

Please sign in to comment.