This repository has been archived by the owner on Jun 19, 2024. It is now read-only.
forked from chrisntr/MonoMobile.Extensions
-
Notifications
You must be signed in to change notification settings - Fork 85
/
build.cake
109 lines (83 loc) · 4.93 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
108
109
#addin "Cake.Xamarin"
var TARGET = Argument ("t", Argument ("target", Argument ("Target", "Default")));
Task ("libs").Does (() =>
{
if (IsRunningOnWindows ()) {
CreateDirectory ("./output/");
CreateDirectory ("./output/wp8/");
CreateDirectory ("./output/winrt/");
NuGetRestore ("./Xamarin.Mobile.Windows.sln");
MSBuild("./WindowsPhone8/Xamarin.Mobile/Xamarin.Mobile.csproj", c => c.SetConfiguration("Release").SetPlatformTarget(PlatformTarget.x86));
CopyFiles ("./WindowsPhone8/Xamarin.Mobile/Bin/**/Release/*.dll", "./output/wp8");
MSBuild ("./WindowsRT/Xamarin.Mobile/Xamarin.Mobile.csproj", c => c.SetConfiguration("Release").SetPlatformTarget(PlatformTarget.x86));
CopyFiles ("./WindowsRT/Xamarin.Mobile/bin/**/Release/*.dll", "./output/winrt");
} else {
CreateDirectory ("./output/");
CreateDirectory ("./output/android/");
CreateDirectory ("./output/ios-unified/");
CreateDirectory ("./output/ios/");
NuGetRestore ("./Xamarin.Mobile.Mac.sln");
DotNetBuild ("./MonoDroid/Xamarin.Mobile/Xamarin.Mobile.Android.csproj", c => c.Configuration = "Release");
CopyFiles ("./MonoDroid/Xamarin.Mobile/bin/Release/*.dll", "./output/android");
iOSBuild ("./MonoTouch/Xamarin.Mobile/Xamarin.Mobile.iOS.csproj", new MDToolSettings { Configuration = "Release|iPhone" });
CopyFiles ("./MonoTouch/Xamarin.Mobile/bin/unified/iPhone/Release/*.dll", "./output/ios-unified");
iOSBuild ("./MonoTouch/Xamarin.Mobile/Xamarin.Mobile.iOS-Classic.csproj", new MDToolSettings { Configuration = "Release|iPhone" });
CopyFiles ("./MonoTouch/Xamarin.Mobile/bin/classic/iPhone/Release/*.dll", "./output/ios");
}
});
Task ("Default").IsDependentOn ("libs").Does (() => { });
Task ("samples").IsDependentOn ("libs").Does (() =>
{
if (IsRunningOnWindows ()) {
MSBuild ("./WindowsPhone8/Samples/ContactsSample/ContactsSample.csproj", c => c.SetConfiguration("Release").SetPlatformTarget(PlatformTarget.x86));
MSBuild ("./WindowsPhone8/Samples/GeolocationSample/GeolocationSample.csproj", c => c.SetConfiguration("Release").SetPlatformTarget(PlatformTarget.x86));
MSBuild ("./WindowsPhone8/Samples/MediaPickerSample/MediaPickerSample.csproj", c => c.SetConfiguration("Release").SetPlatformTarget(PlatformTarget.x86));
MSBuild ("./WindowsRT/Samples/GeolocationSample/GeolocationSample.csproj", c => c.SetConfiguration("Release").SetPlatformTarget(PlatformTarget.x86));
MSBuild ("./WindowsRT/Samples/MediaPickerSample/MediaPickerSample.csproj", c => c.SetConfiguration("Release").SetPlatformTarget(PlatformTarget.x86));
} else {
DotNetBuild ("./MonoDroid/Samples/ContactsSample/Contacts Sample.csproj", c => c.Configuration = "Release");
DotNetBuild ("./MonoDroid/Samples/GeolocationSample/Geolocation Sample.csproj", c => c.Configuration = "Release");
DotNetBuild ("./MonoDroid/Samples/MediaPickerSample/MediaPicker Sample.csproj", c => c.Configuration = "Release");
DotNetBuild ("./MonoTouch/Samples/ContactsSample/Contacts Sample.csproj", c => c.Configuration = "Release"); //new MDToolSettings { Configuration = "Release|iPhone" });
DotNetBuild ("./MonoTouch/Samples/Geolocation/Geolocation Sample.csproj", c => c.Configuration = "Release"); // new MDToolSettings { Configuration = "Release|iPhone" });
DotNetBuild ("./MonoTouch/Samples/MediaPickerSample/MediaPicker Sample.csproj", c => c.Configuration = "Release"); //new MDToolSettings { Configuration = "Release|iPhone" });
DotNetBuild ("./MonoTouch/Samples/ContactsSample-Classic/Contacts Sample-Classic.csproj", c => c.Configuration = "Release"); // new MDToolSettings { Configuration = "Release|iPhone" });
DotNetBuild ("./MonoTouch/Samples/Geolocation-Classic/Geolocation Sample-Classic.csproj", c => c.Configuration = "Release"); //new MDToolSettings { Configuration = "Release|iPhone" });
DotNetBuild ("./MonoTouch/Samples/MediaPickerSample-Classic/MediaPicker Sample-Classic.csproj", c => c.Configuration = "Release"); //new MDToolSettings { Configuration = "Release|iPhone" });
}
});
Task ("component").IsDependentOn ("samples").Does (() =>
{
if (!FileExists ("./tools/xamarin-component.exe")) {
DownloadFile ("https://components.xamarin.com/submit/xpkg", "./tools/xpkg.zip");
Unzip ("./tools/xpkg.zip", "./tools/");
}
StartProcess (MakeAbsolute (new FilePath ("./tools/xamarin-component.exe")), new ProcessSettings {
Arguments = "package ./"
});
DeleteFiles ("./output/*.xam");
MoveFiles ("./*.xam", "./output/");
});
Task ("clean").Does (() =>
{
if (DirectoryExists ("./output/"))
DeleteDirectory ("./output/", true);
if (DirectoryExists ("./tools/"))
DeleteDirectory ("./tools/", true);
CleanDirectories ("./**/bin");
CleanDirectories ("./**/obj");
});
Task ("zip").Does (() =>
{
if (IsRunningOnWindows ()) {
if (FileExists ("./win-output.zip"))
DeleteFile ("./win-output.zip");
Zip ("./output/", "./win-output.zip");
}
else {
if (FileExists ("./osx-output.zip"))
DeleteFile ("./osx-output.zip");
Zip ("./output/", "./osx-output.zip");
}
});
RunTarget (TARGET);