Skip to content

Commit 9a1b153

Browse files
committed
add cake and versioning (#32)
1 parent 0c8b0b6 commit 9a1b153

File tree

7 files changed

+56
-12
lines changed

7 files changed

+56
-12
lines changed

.vscode/tasks.json

+11
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@
1010
"kind": "build",
1111
"isDefault": true
1212
}
13+
},
14+
{
15+
"type": "cake",
16+
"script": "Test",
17+
"problemMatcher": [],
18+
"group": "test"
19+
},
20+
{
21+
"type": "cake",
22+
"script": "Clean",
23+
"problemMatcher": []
1324
}
1425
]
1526
}

GitVersion.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
mode: Mainline
2+
assembly-informational-format: '{SemVer}-{CommitDate}'
3+
branches: {}
4+
ignore:
5+
sha: []

build.cake

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#tool "xunit.runner.console"
2+
#tool "nuget:?package=GitVersion.CommandLine"
23

34
var target = Argument("target", "Default");
45
var configuration = Argument("configuration", "Release");
6+
var debugConfiguration = Argument("configuration", "Debug");
57
var buildDir = Directory("./build");
68
var distDir = Directory("./dist");
79
var solutionFile = GetFiles("./*.sln").First();
@@ -16,6 +18,11 @@ Task("Clean")
1618
.SetConfiguration(configuration)
1719
.WithTarget("Clean")
1820
.SetVerbosity(Verbosity.Minimal));
21+
22+
MSBuild(solutionFile, settings => settings
23+
.SetConfiguration(debugConfiguration)
24+
.WithTarget("Clean")
25+
.SetVerbosity(Verbosity.Minimal));
1926
});
2027

2128
Task("Clean-Outputs")
@@ -30,7 +37,7 @@ Task("Build")
3037
.Does(() =>
3138
{
3239
NuGetRestore(solutionFile);
33-
40+
GitVersion(new GitVersionSettings { UpdateAssemblyInfo = true });
3441
MSBuild(solutionFile, settings => settings
3542
.SetConfiguration(configuration)
3643
.WithTarget("Rebuild")
@@ -41,13 +48,13 @@ Task("Test")
4148
.IsDependentOn("Build")
4249
.Does(() =>
4350
{
44-
XUnit2(string.Format("./test/**/bin/{0}/*.Tests.dll", configuration), new XUnit2Settings {
51+
XUnit2(string.Format("./test/**/bin/Release/**/*.Tests.dll", configuration), new XUnit2Settings {
4552
XmlReport = true,
4653
OutputDirectory = buildDir
4754
});
4855
});
4956

5057
Task("Default")
51-
.IsDependentOn("Build");
58+
.IsDependentOn("Test");
5259

5360
RunTarget(target);

examples/LightStep.CSharpAspectTestApp/Properties/AssemblyInfo.cs

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Reflection;
1+
using System.Reflection;
22
using System.Runtime.CompilerServices;
33
using System.Runtime.InteropServices;
44

@@ -31,6 +31,8 @@
3131
//
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
34-
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.0.0.0")]
36-
[assembly: AssemblyFileVersion("1.0.0.0")]
34+
// [assembly: AssemblyVersion("0.1.29.0")]
35+
[assembly: AssemblyVersion("0.1.29.0")]
36+
[assembly: AssemblyFileVersion("0.1.29.0")]
37+
38+
[assembly: AssemblyInformationalVersion("0.1.29-enhancement-addCake.1-2018-11-12")]

src/LightStep/LightStep.csproj

+1-4
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,11 @@
3232

3333
<PropertyGroup>
3434
<Authors>Austin Parker</Authors>
35-
<PackageVersion>0.0.8-alpha-$(CIRCLE_BUILD_NUM)</PackageVersion>
3635
<Company>LightStep</Company>
3736
<NeutralLanguage>en-US</NeutralLanguage>
3837
<AssemblyTitle>LightStep</AssemblyTitle>
3938
<Description>OpenTracing compliant tracer for LightStep.</Description>
4039
<Copyright>LightStep 2018</Copyright>
41-
</PropertyGroup>
42-
43-
<PropertyGroup>
4440
<PackageTags>tracing</PackageTags>
4541
<PackageReleaseNotes>https://github.com/lightstep/lightstep-tracer-csharp/blob/master/CHANGELOG.md</PackageReleaseNotes>
4642
<PackageIconUrl>https://raw.githubusercontent.com/lightstep/lightstep-tracer-csharp/master/ls128x128.png</PackageIconUrl>
@@ -57,5 +53,6 @@
5753
<AssemblyOriginatorKeyFile>tracerSign.snk</AssemblyOriginatorKeyFile>
5854
<_UseRoslynPublicSignHack>false</_UseRoslynPublicSignHack>
5955
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
56+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
6057
</PropertyGroup>
6158
</Project>

src/LightStep/Options.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,19 @@ private IDictionary<string, object> InitializeDefaultTags()
102102
{
103103
[LightStepConstants.TracerPlatformKey] = LightStepConstants.TracerPlatformValue,
104104
[LightStepConstants.TracerPlatformVersionKey] = GetPlatformVersion(),
105-
[LightStepConstants.TracerVersionKey] = "0.0.7-alpha",
105+
[LightStepConstants.TracerVersionKey] = GetTracerVersion(),
106106
[LightStepConstants.ComponentNameKey] = GetComponentName(),
107107
[LightStepConstants.HostnameKey] = GetHostName(),
108108
[LightStepConstants.CommandLineKey] = GetCommandLine()
109109
};
110110
return attributes;
111111
}
112112

113+
private static string GetTracerVersion()
114+
{
115+
return typeof(LightStep.Tracer).Assembly.GetName().Version.ToString();
116+
}
117+
113118
private static string GetComponentName()
114119
{
115120
var entryAssembly = "";
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// Version information for an assembly consists of the following four values:
6+
//
7+
// Major Version
8+
// Minor Version
9+
// Build Number
10+
// Revision
11+
//
12+
// You can specify all the values or you can default the Build and Revision Numbers
13+
// by using the '*' as shown below:
14+
// [assembly: AssemblyVersion("0.1.29.0")]
15+
[assembly: AssemblyVersion("0.1.29.0")]
16+
[assembly: AssemblyFileVersion("0.1.29.0")]
17+
[assembly: AssemblyInformationalVersion("0.1.29-enhancement-addCake.1-2018-11-12")]

0 commit comments

Comments
 (0)