forked from danielwertheim/structurizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildconfig.cake
33 lines (28 loc) · 1.12 KB
/
buildconfig.cake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
public class BuildConfig
{
private const string Version = "4.0.0";
private const bool IsPreRelease = false;
public readonly string SrcDir = "./src/";
public readonly string OutDir = "./build/";
public string Target { get; private set; }
public string SemVer { get; private set; }
public string BuildVersion { get; private set; }
public string BuildProfile { get; private set; }
public bool IsTeamCityBuild { get; private set; }
public static BuildConfig Create(
ICakeContext context,
BuildSystem buildSystem)
{
if (context == null)
throw new ArgumentNullException("context");
var buildRevision = context.Argument("buildrevision", "0");
return new BuildConfig
{
Target = context.Argument("target", "Default"),
SemVer = Version + (IsPreRelease ? $"-pre{buildRevision}" : string.Empty),
BuildVersion = Version + "." + buildRevision,
BuildProfile = context.Argument("configuration", "Release"),
IsTeamCityBuild = buildSystem.TeamCity.IsRunningOnTeamCity
};
}
}