forked from agc93/ClickTwice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathusage.cake
66 lines (58 loc) · 2.2 KB
/
usage.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
//#r "src/packages/Newtonsoft.Json.8.0.2/lib/net45/Newtonsoft.Json.dll"
#r "artifacts/build/Cake.ClickTwice/Cake.ClickTwice.dll"
//#r "artifacts/ClickTwice.dll"
#r "artifacts/lib/ClickTwice.Publisher.Core/ClickTwice.Publisher.Core.dll"
#r "artifacts/lib/ClickTwice.Handlers.AppDetailsPage/ClickTwice.Handlers.AppDetailsPage.dll"
var target = Argument<string>("target", "Publish");
//using ClickTwice.Handlers.AppDetailsPage;
//using ClickTwice.Publisher.Core.Handlers;
//using ClickTwice.Publisher.Core;
var projectPath = File(@"./path/to/the/project.proj");
Setup(ctx =>
{
// Executed BEFORE the first task.
Information("Running tasks...");
CleanDirectory("./artifacts/publish");
CreateDirectory("./artifacts/publish");
});
Task("Publish")
.Does(() =>
{
PublishApp(projectPath)
.SetConfiguration("Debug")
.ThrowOnHandlerFailure()
.WithHandler(new AppInfoHandler(new AppInfoManager()))
.WithHandler(new AppDetailsPageHandler("ClickTwice.Templates.SolidState") {
FileNameMap = new Dictionary<string, string> {
{"index.html", "details.html"}
}
})
.WithHandler(new InstallPageHandler(fileName: "index.html", linkText: "Details", linkTarget: "details.html"))
.PublishTo("./artifacts/publish/");
});
Task("Long-Form")
.Does(() => {
var handler = new AppInfoHandler(new AppInfoManager());
ClickTwice.RunInputHandlers(projectPath, handler);
MSBuild(projectPath, settings =>
settings.SetPlatformTarget(PlatformTarget.MSIL)
.WithProperty("PublishDir", Directory("./artifacts/publish").Path.MakeAbsolute(Context.Environment).ToString() + "\\")
.SetVerbosity(Verbosity.Quiet)
.WithTarget("Build")
.WithTarget("Publish")
.SetConfiguration("Debug"));
//build here
ClickTwice.GenerateManifest(projectPath).Publish("./artifacts/publish");
ClickTwice.RunOutputHandlers("./artifacts/publish", handler, new InstallPageHandler());
});
Task("Template-Publishing")
.Does(() => {
ClickTwice.PublishTemplate("./artifacts/template/", s =>
s.AddAuthor("Alistair Chapman")
.UsePackageId("TemplatePackage")
.UseVersion("0.0.1")
.UseDescription("Optional description"))
.ToPackageFile("artifacts/publish.nupkg")
.ToGallery(galleryUri: "http://nuget.org/api/v2");
});
RunTarget(target);