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

Commit 64e89d9

Browse files
committed
Clean up build script
1 parent 8f3e82e commit 64e89d9

File tree

1 file changed

+8
-36
lines changed

1 file changed

+8
-36
lines changed

build.cake

Lines changed: 8 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ Task("nuget")
122122
var xmlns = (XNamespace)"http://schemas.microsoft.com/developer/msbuild/2003";
123123
var itemGroup = new XElement(xmlns + "ItemGroup");
124124
foreach (var nupkg in GetFiles("./output/*.nupkg")) {
125+
// Skip Wear as it has special implications requiring more packages to be used properly in an app
126+
if (nupkg.FullPath.Contains(".Wear."))
127+
continue;
125128
var filename = nupkg.GetFilenameWithoutExtension();
126129
var match = Regex.Match(filename.ToString(), @"(.+?)\.([\.\d+]+)");
127130
itemGroup.Add(new XElement(xmlns + "PackageReference",
@@ -157,38 +160,7 @@ Task("samples")
157160
});
158161
});
159162

160-
Task("nuget-fat")
161-
.Does(() =>
162-
{
163-
// Make a temp folder to move the created nugets to before we fat package them
164-
EnsureDirectoryExists("./tmp");
165-
CleanDirectories("./tmp");
166-
EnsureDirectoryExists("./tmp/nuget");
167-
EnsureDirectoryExists("./tmp/output");
168-
169-
// Move all of the nupkg files from output into the temp folder we just created
170-
MoveFiles("./output/*.nupkg", "./tmp/nuget");
171-
172-
// Move the remaining output bits to a temp location so they don't get overwritten
173-
MoveFiles("./output/*", "./tmp/output");
174-
175-
// Run the fat NuGet script
176-
CakeExecuteScript("nuget.cake", new CakeSettings {
177-
Arguments = new Dictionary<string, string> {
178-
{ "localSource", "./tmp/nuget" },
179-
{ "packagesPath", "./tmp/pkgs" },
180-
{ "workingPath", "./tmp/working" },
181-
{ "outputPath", "./output" },
182-
{ "incrementVersion", "false" },
183-
{ "packLatestOnly", "true" },
184-
{ "useExplicitVersion", "true" },
185-
{ "verbosity", VERBOSITY.ToString() },
186-
}
187-
});
188-
189-
// Move the other output bits back to the original output folder
190-
MoveFiles("./tmp/output/*", "./output");
191-
});
163+
Task("nuget-fat");
192164

193165
Task("nuget-validation")
194166
.Does(() =>
@@ -239,7 +211,7 @@ Task ("diff")
239211
MONODROID_PATH,
240212
};
241213

242-
MonoApiInfo ("./output/AndroidSupport.Merged.dll", "./output/api-info.xml", new MonoApiInfoToolSettings {
214+
MonoApiInfo ("./output/AndroidXt.Merged.dll", "./output/api-info.xml", new MonoApiInfoToolSettings {
243215
SearchPaths = SEARCH_DIRS
244216
});
245217

@@ -259,8 +231,8 @@ Task ("merge")
259231
{
260232
EnsureDirectoryExists("./output/");
261233

262-
if (FileExists ("./output/AndroidSupport.Merged.dll"))
263-
DeleteFile ("./output/AndroidSupport.Merged.dll");
234+
if (FileExists ("./output/AndroidX.Merged.dll"))
235+
DeleteFile ("./output/AndroidX.Merged.dll");
264236

265237
var allDlls = GetFiles ($"./generated/*/bin/{BUILD_CONFIG}/{TF_MONIKER}/Xamarin.AndroidX.*.dll");
266238

@@ -271,7 +243,7 @@ Task ("merge")
271243

272244
Information("Merging: \n - {0}", string.Join("\n - ", mergeDlls));
273245

274-
ILRepack ("./output/AndroidSupport.Merged.dll", mergeDlls.First(), mergeDlls.Skip(1), new ILRepackSettings {
246+
ILRepack ("./output/AndroidX.Merged.dll", mergeDlls.First(), mergeDlls.Skip(1), new ILRepackSettings {
275247
CopyAttrs = true,
276248
AllowMultiple = true,
277249
//TargetKind = ILRepack.TargetKind.Dll,

0 commit comments

Comments
 (0)