Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Commit 0a0c613

Browse files
committed
Added build script option for build config
Default is still release, but now we can build in Debug mode with an arg.
1 parent 1e927f7 commit 0a0c613

File tree

1 file changed

+39
-33
lines changed

1 file changed

+39
-33
lines changed

build.cake

Lines changed: 39 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
LogSystemInfo ();
1515

1616
var TARGET = Argument ("t", Argument ("target", "Default"));
17+
var BUILD_CONFIG = Argument ("config", "Release");
1718

1819
var NUGET_VERSION = "25.3.1-beta1";
1920
var COMPONENT_VERSION = "25.3.1.0";
@@ -109,35 +110,35 @@ var buildSpec = new BuildSpec {
109110
BuildsOn = BuildPlatforms.Windows | BuildPlatforms.Mac,
110111
MaxCpuCount = CPU_COUNT,
111112
OutputFiles = new [] {
112-
new OutputFileCopy { FromFile = "./customtabs/source/bin/Release/Xamarin.Android.Support.CustomTabs.dll" },
113-
new OutputFileCopy { FromFile = "./design/source/bin/Release/Xamarin.Android.Support.Design.dll" },
114-
new OutputFileCopy { FromFile = "./dynamic-animation/source/bin/Release/Xamarin.Android.Support.Dynamic.Animation.dll" },
115-
new OutputFileCopy { FromFile = "./percent/source/bin/Release/Xamarin.Android.Support.Percent.dll" },
116-
new OutputFileCopy { FromFile = "./recommendation/source/bin/Release/Xamarin.Android.Support.Recommendation.dll" },
117-
//new OutputFileCopy { FromFile = "./v4/source/bin/Release/Xamarin.Android.Support.v4.dll" },
118-
new OutputFileCopy { FromFile = "./v7-appcompat/source/bin/Release/Xamarin.Android.Support.v7.AppCompat.dll" },
119-
new OutputFileCopy { FromFile = "./v7-cardview/source/bin/Release/Xamarin.Android.Support.v7.CardView.dll" },
120-
new OutputFileCopy { FromFile = "./v7-gridlayout/source/bin/Release/Xamarin.Android.Support.v7.GridLayout.dll" },
121-
new OutputFileCopy { FromFile = "./v7-mediarouter/source/bin/Release/Xamarin.Android.Support.v7.MediaRouter.dll" },
122-
new OutputFileCopy { FromFile = "./v7-palette/source/bin/Release/Xamarin.Android.Support.v7.Palette.dll" },
123-
new OutputFileCopy { FromFile = "./v7-preference/source/bin/Release/Xamarin.Android.Support.v7.Preference.dll" },
124-
new OutputFileCopy { FromFile = "./v7-recyclerview/source/bin/Release/Xamarin.Android.Support.v7.RecyclerView.dll" },
125-
new OutputFileCopy { FromFile = "./v8-renderscript/source/bin/Release/Xamarin.Android.Support.v8.RenderScript.dll" },
126-
new OutputFileCopy { FromFile = "./v13/source/bin/Release/Xamarin.Android.Support.v13.dll" },
127-
new OutputFileCopy { FromFile = "./v14-preference/source/bin/Release/Xamarin.Android.Support.v14.Preference.dll" },
128-
new OutputFileCopy { FromFile = "./v17-leanback/source/bin/Release/Xamarin.Android.Support.v17.Leanback.dll" },
129-
new OutputFileCopy { FromFile = "./v17-preference-leanback/source/bin/Release/Xamarin.Android.Support.v17.Preference.Leanback.dll" },
130-
new OutputFileCopy { FromFile = "./animated-vector-drawable/source/bin/Release/Xamarin.Android.Support.Animated.Vector.Drawable.dll" },
131-
new OutputFileCopy { FromFile = "./vector-drawable/source/bin/Release/Xamarin.Android.Support.Vector.Drawable.dll" },
132-
new OutputFileCopy { FromFile = "./support-compat/source/bin/Release/Xamarin.Android.Support.Compat.dll" },
133-
new OutputFileCopy { FromFile = "./support-core-utils/source/bin/Release/Xamarin.Android.Support.Core.Utils.dll" },
134-
new OutputFileCopy { FromFile = "./support-core-ui/source/bin/Release/Xamarin.Android.Support.Core.UI.dll" },
135-
new OutputFileCopy { FromFile = "./support-fragment/source/bin/Release/Xamarin.Android.Support.Fragment.dll" },
136-
new OutputFileCopy { FromFile = "./support-media-compat/source/bin/Release/Xamarin.Android.Support.Media.Compat.dll" },
137-
new OutputFileCopy { FromFile = "./transition/source/bin/Release/Xamarin.Android.Support.Transition.dll" },
138-
new OutputFileCopy { FromFile = "./exifinterface/source/bin/Release/Xamarin.Android.Support.Exif.dll" },
139-
140-
new OutputFileCopy { FromFile = "./support-annotations/source/bin/Release/Xamarin.Android.Support.Annotations.dll" },
113+
new OutputFileCopy { FromFile = "./customtabs/source/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.CustomTabs.dll" },
114+
new OutputFileCopy { FromFile = "./design/source/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.Design.dll" },
115+
new OutputFileCopy { FromFile = "./dynamic-animation/source/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.Dynamic.Animation.dll" },
116+
new OutputFileCopy { FromFile = "./percent/source/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.Percent.dll" },
117+
new OutputFileCopy { FromFile = "./recommendation/source/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.Recommendation.dll" },
118+
//new OutputFileCopy { FromFile = "./v4/source/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.v4.dll" },
119+
new OutputFileCopy { FromFile = "./v7-appcompat/source/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.v7.AppCompat.dll" },
120+
new OutputFileCopy { FromFile = "./v7-cardview/source/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.v7.CardView.dll" },
121+
new OutputFileCopy { FromFile = "./v7-gridlayout/source/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.v7.GridLayout.dll" },
122+
new OutputFileCopy { FromFile = "./v7-mediarouter/source/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.v7.MediaRouter.dll" },
123+
new OutputFileCopy { FromFile = "./v7-palette/source/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.v7.Palette.dll" },
124+
new OutputFileCopy { FromFile = "./v7-preference/source/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.v7.Preference.dll" },
125+
new OutputFileCopy { FromFile = "./v7-recyclerview/source/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.v7.RecyclerView.dll" },
126+
new OutputFileCopy { FromFile = "./v8-renderscript/source/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.v8.RenderScript.dll" },
127+
new OutputFileCopy { FromFile = "./v13/source/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.v13.dll" },
128+
new OutputFileCopy { FromFile = "./v14-preference/source/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.v14.Preference.dll" },
129+
new OutputFileCopy { FromFile = "./v17-leanback/source/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.v17.Leanback.dll" },
130+
new OutputFileCopy { FromFile = "./v17-preference-leanback/source/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.v17.Preference.Leanback.dll" },
131+
new OutputFileCopy { FromFile = "./animated-vector-drawable/source/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.Animated.Vector.Drawable.dll" },
132+
new OutputFileCopy { FromFile = "./vector-drawable/source/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.Vector.Drawable.dll" },
133+
new OutputFileCopy { FromFile = "./support-compat/source/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.Compat.dll" },
134+
new OutputFileCopy { FromFile = "./support-core-utils/source/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.Core.Utils.dll" },
135+
new OutputFileCopy { FromFile = "./support-core-ui/source/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.Core.UI.dll" },
136+
new OutputFileCopy { FromFile = "./support-fragment/source/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.Fragment.dll" },
137+
new OutputFileCopy { FromFile = "./support-media-compat/source/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.Media.Compat.dll" },
138+
new OutputFileCopy { FromFile = "./transition/source/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.Transition.dll" },
139+
new OutputFileCopy { FromFile = "./exifinterface/source/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.Exif.dll" },
140+
141+
new OutputFileCopy { FromFile = "./support-annotations/source/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.Annotations.dll" },
141142
}
142143
}
143144
},
@@ -248,6 +249,11 @@ Task ("externals")
248249

249250
if (FileExists (implFile))
250251
MoveFile (implFile, path + aarDir + "/libs/internal_impl.jar");
252+
253+
var srcsFile = string.Format (path + "m2repository/com/android/support/{0}/{1}/{2}-{3}-sources.jar", aarDir, AAR_VERSION, aarDir, AAR_VERSION);
254+
if (FileExists(srcsFile))
255+
CopyFile (srcsFile, string.Format (path + "{0}-docs.jar", aarDir));
256+
251257
}
252258

253259
CopyFile (string.Format (path + "m2repository/com/android/support/support-annotations/{0}/support-annotations-{0}.jar", AAR_VERSION), path + "support-annotations.jar");
@@ -578,18 +584,18 @@ Task ("genapi").IsDependentOn ("libs-base").IsDependentOn ("externals").Does (()
578584
});
579585
}
580586

581-
DotNetBuild ("./AndroidSupport.TypeForwarders.sln", c => c.Configuration = "Release");
587+
DotNetBuild ("./AndroidSupport.TypeForwarders.sln", c => c.Configuration = BUILD_CONFIG);
582588

583-
CopyFile ("./v4/source/bin/Release/Xamarin.Android.Support.v4.dll", "./output/Xamarin.Android.Support.v4.dll");
589+
CopyFile ("./v4/source/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.v4.dll", "./output/Xamarin.Android.Support.v4.dll");
584590
});
585591

586592
Task ("buildtasks").Does (() =>
587593
{
588594
NuGetRestore ("./vector-drawable/buildtask/Vector-Drawable-BuildTasks.csproj");
589595

590-
DotNetBuild ("./vector-drawable/buildtask/Vector-Drawable-BuildTasks.csproj", c => c.Configuration = "Release");
596+
DotNetBuild ("./vector-drawable/buildtask/Vector-Drawable-BuildTasks.csproj", c => c.Configuration = BUILD_CONFIG);
591597

592-
CopyFile ("./vector-drawable/buildtask/bin/Release/Xamarin.Android.Support.Tasks.VectorDrawable.targets", "./vector-drawable/nuget/merge.targets");
598+
CopyFile ("./vector-drawable/buildtask/bin/" + BUILD_CONFIG + "/Xamarin.Android.Support.Tasks.VectorDrawable.targets", "./vector-drawable/nuget/merge.targets");
593599
});
594600

595601
SetupXamarinBuildTasks (buildSpec, Tasks, Task);

0 commit comments

Comments
 (0)