-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.cake
68 lines (57 loc) · 1.78 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
var TARGET = Argument ("t", Argument ("target", "nuget"));
var NUGET_VERSION = Argument<string>("nugetVersion", "1.45.0");
var AAR_VERSION = "1.45.0";
var OBJ_VERSION = "0.4.0";
var AAR_URL = string.Format("https://dl.google.com/dl/android/maven2/com/google/ar/core/{0}/core-{0}.aar", AAR_VERSION);
var OBJ_URL = string.Format("https://oss.sonatype.org/content/repositories/releases/de/javagl/obj/{0}/obj-{0}.jar", OBJ_VERSION);
Task ("externals")
.Does (() =>
{
var AAR_FILE = string.Format("./externals/arcore-{0}.aar", AAR_VERSION);
var OBJ_JAR_FILE = string.Format("./externals/obj-{0}.jar", OBJ_VERSION);;
if (!DirectoryExists ("./externals/"))
CreateDirectory ("./externals");
if (!FileExists (AAR_FILE))
{
DownloadFile (AAR_URL, AAR_FILE);
if(FileExists ("./externals/arcore.aar"))
DeleteFile("./externals/arcore.aar");
CopyFile(AAR_FILE, "./externals/arcore.aar");
}
if (!FileExists (OBJ_JAR_FILE))
{
DownloadFile (OBJ_URL, OBJ_JAR_FILE);
if(FileExists ("./externals/obj.aar"))
DeleteFile("./externals/obj.aar");
CopyFile(OBJ_JAR_FILE, "./externals/obj.jar");
}
});
Task("libs")
.IsDependentOn("externals")
.Does(() =>
{
DotNetBuild("./ARCore.sln", new DotNetBuildSettings {
Configuration = "Release"
});
});
Task("nuget")
.IsDependentOn("libs")
.Does(() =>
{
var dotnetPackSettings = new DotNetPackSettings {
Configuration = "Release",
OutputDirectory = "./output",
MSBuildSettings = new DotNetMSBuildSettings {
PackageVersion = NUGET_VERSION,
Version = NUGET_VERSION,
}
};
DotNetPack("./ARCore.sln", dotnetPackSettings);
});
Task ("clean")
.Does (() =>
{
if (DirectoryExists ("./externals/"))
DeleteDirectory ("./externals", new DeleteDirectorySettings { Force=true });
});
RunTarget (TARGET);