-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.cake
107 lines (88 loc) · 3.94 KB
/
build.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
var _target = Argument("target", "Default");
/* T4Config Build script */
//*****************************************
// Variables
var _configuration = Argument("configuration", "Release");
var _version = "1.0.5.1";
var _project = "T4Config";
var _srcDir = "./src/";
var _projectDir = _srcDir + "T4Config/";
var _buildDir = "./build/";
var _packgeOutput = _buildDir + "nuget/";
var _buildMsg = @"
_________ ___ ___ ________ ________ ________ ________ ___ ________
|\___ ___\\ \ |\ \|\ ____\|\ __ \|\ ___ \|\ _____\\ \|\ ____\
\|___ \ \_\ \ \\_\ \ \ \___|\ \ \|\ \ \ \\ \ \ \ \__/\ \ \ \ \___|
\ \ \ \ \______ \ \ \ \ \ \\\ \ \ \\ \ \ \ __\\ \ \ \ \ ___
\ \ \ \|_____|\ \ \ \____\ \ \\\ \ \ \\ \ \ \ \_| \ \ \ \ \|\ \
\ \__\ \ \__\ \_______\ \_______\ \__\\ \__\ \__\ \ \__\ \_______\
\|__| \|__|\|_______|\|_______|\|__| \|__|\|__| \|__|\|_______|";
//*****************************************
// Setup & Teardown
Setup(ctx => {
Information(_buildMsg);
});
Teardown(ctx => {
Information("T4Config Build Completed!");
});
//*****************************************
//*****************************************
// Clean
Task("clean")
.Does(() =>
{
if (DirectoryExists(_buildDir))
{
DeleteDirectory(_buildDir, new DeleteDirectorySettings { Recursive = true, Force = true});
}
CreateDirectory(_buildDir);
});
//*****************************************
//*****************************************
// Build
//*****************************************
//*****************************************
// Pack & Publish
Task("pack")
.IsDependentOn("clean")
.Does(() => {
var nuGetPackSettings = new NuGetPackSettings {
Id = "T4Config",
Version = _version,
Title = "The tile of the package",
Authors = new[] {"Ryan Anders"},
Description = "Configuration class generator for app.config and web.config appsettings and connectionStrings.",
Summary = "This package contains a T4 template which read the appsettings and connections strings from your app/web config files and generates and interface and concrete implementation using lazy loading to reach into config manager to grab setting values.",
ProjectUrl = new Uri("https://github.com/ryanande/T4Config"),
Copyright = "Buzzuti 2019",
Tags = new [] {"T4", "Configuration", "appsettings", "connectionString", "Build"},
LicenseUrl = new Uri("https://github.com/ryanande/T4Config/blob/master/LICENSE.md"),
RequireLicenseAcceptance= false,
Symbols = false,
NoPackageAnalysis = true,
Files = new [] {
new NuSpecContent {Source = "Configurations.tt", Target = "content"},
new NuSpecContent {Source = "install.ps1", Target = "tools"},
},
BasePath = _projectDir,
OutputDirectory = _packgeOutput
};
if(!DirectoryExists(_packgeOutput))
{
CreateDirectory(_packgeOutput);
}
NuGetPack(nuGetPackSettings);
});
Task("push")
.IsDependentOn("pack")
.Does(() => {
// Get the path to the package.
var package = _packgeOutput + _project + "." + _version + ".nupkg";
// Push the package.
NuGetPush(package, new NuGetPushSettings {
Source = "https://www.nuget.org/api/v2/package/",
ApiKey = "oy2pb2m53pxccu652lsq2stfzj3xequubnuzxbrsr774wq"
});
});
//*****************************************
RunTarget(_target);