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

Commit 2654117

Browse files
committed
Get artifacts for android arch components
1 parent 2d158a6 commit 2654117

File tree

2 files changed

+25
-15
lines changed

2 files changed

+25
-15
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ Resource.designer.cs
2727
component.yaml
2828
Details.md
2929
/generated.targets
30-
*.commit
30+
*.commit
31+
cake.sh

build.cake

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@ var BUILD_CONFIG = Argument ("config", "Release");
1414
// Master list of all the packages in the repo:
1515
// https://dl.google.com/dl/android/maven2/master-index.xml
1616

17-
var NUGET_VERSION = "26.0.2";
18-
var COMPONENT_VERSION = "26.0.2.0";
19-
var AAR_VERSION = "26.0.2";
20-
var DOC_VERSION = "2017-09-05";
17+
var NUGET_VERSION = "26.1.0";
18+
var COMPONENT_VERSION = "26.1.0.0";
19+
var AAR_VERSION = "26.1.0";
20+
var DOC_VERSION = "2017-10-02";
21+
22+
2123

2224
var SUPPORT_PKG_NAME = "com.android.support";
25+
var ARCH_LIFECYCLE_PKG_NAME = "android.arch.lifecycle";
26+
var ARCH_CORE_PKG_NAME = "android.arch.core";
2327

2428
// FROM: https://dl.google.com/android/repository/addon2-1.xml
2529
var MAVEN_REPO_URL = "https://dl.google.com/dl/android/maven2/";
@@ -38,6 +42,10 @@ if (!IsRunningOnWindows())
3842
CPU_COUNT = 1;
3943

4044
var ARTIFACTS = new [] {
45+
new ArtifactInfo (ARCH_CORE_PKG_NAME, "common", "Xamarin.Android.Arch.Core.Common", "1.0.0", "1.0.0", "1.0.0.0") { PathPrefix = "arch-core/" },
46+
new ArtifactInfo (ARCH_LIFECYCLE_PKG_NAME, "common", "Xamarin.Android.Arch.Lifecycle.Common", "1.0.1", "1.0.1", "1.0.1.0") { PathPrefix = "arch-lifecycle/" },
47+
new ArtifactInfo (ARCH_LIFECYCLE_PKG_NAME, "runtime", "Xamarin.Android.Arch.Lifecycle.Runtime", "1.0.0", "1.0.0", "1.0.0.0" { PathPrefix = "arch-lifecycle/" }),
48+
4149
//new ArtifactInfo (SUPPORT_PKG_NAME, "support-v4", "Xamarin.Android.Support.v4", AAR_VERSION, NUGET_VERSION, COMPONENT_VERSION),
4250
new ArtifactInfo (SUPPORT_PKG_NAME, "support-v13", "Xamarin.Android.Support.v13", AAR_VERSION, NUGET_VERSION, COMPONENT_VERSION),
4351
new ArtifactInfo (SUPPORT_PKG_NAME, "appcompat-v7", "Xamarin.Android.Support.v7.AppCompat", AAR_VERSION, NUGET_VERSION, COMPONENT_VERSION),
@@ -102,6 +110,7 @@ class ArtifactInfo
102110
public string NuGetVersion { get; set; }
103111
public string ComponentVersion { get; set; }
104112
public bool IsJar { get; set; }
113+
public string PathPrefix { get;set; }
105114
}
106115

107116
var MONODROID_PATH = "/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mandroid/platforms/" + ANDROID_SDK_VERSION + "/";
@@ -119,7 +128,7 @@ if (IsRunningOnWindows ()) {
119128
MSCORLIB_PATH = MakeAbsolute (DOTNETDIR.Combine("Framework/v4.0.30319/")).FullPath;
120129
}
121130

122-
var nugetInfos = ARTIFACTS.Select (a => new NuGetInfo { NuSpec = "./" + a.ArtifactId + "/nuget/" + a.NugetId + ".nuspec", Version = NUGET_VERSION, RequireLicenseAcceptance = true }).ToList ();
131+
var nugetInfos = ARTIFACTS.Select (a => new NuGetInfo { NuSpec = "./" + a.PathPrefix + a.ArtifactId + "/nuget/" + a.NugetId + ".nuspec", Version = NUGET_VERSION, RequireLicenseAcceptance = true }).ToList ();
123132
nugetInfos.Add (new NuGetInfo { NuSpec = "./support-v4/nuget/Xamarin.Android.Support.v4.nuspec", Version = NUGET_VERSION, RequireLicenseAcceptance = true });
124133

125134
var buildSpec = new BuildSpec {
@@ -130,7 +139,7 @@ var buildSpec = new BuildSpec {
130139
MaxCpuCount = CPU_COUNT,
131140
AlwaysUseMSBuild = USE_MSBUILD_ON_MAC,
132141
Verbosity = Cake.Core.Diagnostics.Verbosity.Diagnostic,
133-
OutputFiles = ARTIFACTS.Select (a => new OutputFileCopy { FromFile = "./" + a.ArtifactId + "/source/bin/" + BUILD_CONFIG + "/" + a.NugetId + ".dll" }).ToArray (),
142+
OutputFiles = ARTIFACTS.Select (a => new OutputFileCopy { FromFile = "./" + a.PathPrefix + a.ArtifactId + "/source/bin/" + BUILD_CONFIG + "/" + a.NugetId + ".dll" }).ToArray (),
134143
}
135144
},
136145

@@ -202,7 +211,7 @@ Task ("externals")
202211
if (art.ArtifactId == "renderscript-v8")
203212
continue;
204213

205-
var localArtifact = "./externals/" + art.ArtifactId + (art.IsJar ? ".jar" : ".aar");
214+
var localArtifact = "./externals/" + art.PathPrefix + art.ArtifactId + (art.IsJar ? ".jar" : ".aar");
206215
var artifactUrl = MAVEN_REPO_URL + art.Package.Replace (".", "/") + "/" + art.ArtifactId + "/" + art.ArtifactVersion + "/" + art.ArtifactId + "-" + art.ArtifactVersion + (art.IsJar ? ".jar" : ".aar");
207216

208217
if (!FileExists (localArtifact))
@@ -215,8 +224,8 @@ Task ("externals")
215224
FixAndroidAarFile(localArtifact, art.ArtifactId, true, true);
216225

217226
// Only unzip if it doesn't exist
218-
if (!DirectoryExists("./externals/" + art.ArtifactId))
219-
Unzip (localArtifact, "./externals/" + art.ArtifactId);
227+
if (!DirectoryExists("./externals/" + art.PathPrefix + art.ArtifactId))
228+
Unzip (localArtifact, "./externals/" + art.PathPrefix + art.ArtifactId);
220229
}
221230
}
222231

@@ -326,10 +335,10 @@ Task ("nuget-setup").IsDependentOn ("buildtasks").IsDependentOn ("externals")
326335

327336
foreach (var art in nugetArtifacts) {
328337

329-
var proguardFile = new FilePath(string.Format("./externals/{0}/proguard.txt", art.ArtifactId));
338+
var proguardFile = new FilePath(string.Format("./externals/{0}/proguard.txt", art.PathPrefix + art.ArtifactId));
330339

331340
var targetsText = templateText;
332-
var targetsFile = new FilePath(string.Format ("{0}/nuget/{1}.targets", art.ArtifactId, art.NugetId));
341+
var targetsFile = new FilePath(string.Format ("{0}/nuget/{1}.targets", art.PathPrefix + art.ArtifactId, art.NugetId));
333342
FileWriteText (targetsFile, targetsText);
334343

335344
// Transform all .targets files
@@ -353,7 +362,7 @@ Task ("nuget-setup").IsDependentOn ("buildtasks").IsDependentOn ("externals")
353362
// nuget only allows one automatic .targets file in the build/ folder
354363
// of the nuget package, which must be named {nuget-package-id}.targets
355364
// so we need to merge them all into one
356-
var mergeFile = new FilePath (art.ArtifactId + "/nuget/merge.targets");
365+
var mergeFile = new FilePath (art.PathPrefix + art.ArtifactId + "/nuget/merge.targets");
357366

358367
if (FileExists (mergeFile)) {
359368
Information ("merge.targets found, merging into generated file...");
@@ -362,9 +371,9 @@ Task ("nuget-setup").IsDependentOn ("buildtasks").IsDependentOn ("externals")
362371

363372

364373
// Transform all template.nuspec files
365-
var nuspecText = FileReadText(art.ArtifactId + "/nuget/template.nuspec");
374+
var nuspecText = FileReadText(art.PathPrefix + art.ArtifactId + "/nuget/template.nuspec");
366375
//nuspecText = nuspecText.Replace ("$xbdversion$", XBD_VERSION);
367-
var nuspecFile = new FilePath(art.ArtifactId + "/nuget/" + art.NugetId + ".nuspec");
376+
var nuspecFile = new FilePath(art.PathPrefix + art.ArtifactId + "/nuget/" + art.NugetId + ".nuspec");
368377
FileWriteText(nuspecFile, nuspecText);
369378
var xNuspec = System.Xml.Linq.XDocument.Load (MakeAbsolute(nuspecFile).FullPath);
370379
System.Xml.Linq.XNamespace nsNuspec = xNuspec.Root.Name.Namespace;

0 commit comments

Comments
 (0)