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

Commit 3b8ed0b

Browse files
committed
Make sure we have the folders and files in place
1 parent 840d6c4 commit 3b8ed0b

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

build.cake

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ Task ("diff")
222222
MONODROID_PATH,
223223
};
224224

225+
EnsureDirectoryExists("./output/");
225226
MonoApiInfo ("./output/AndroidX.Merged.dll", "./output/api-info.xml", new MonoApiInfoToolSettings {
226227
SearchPaths = SEARCH_DIRS
227228
});
@@ -239,39 +240,43 @@ Task ("diff")
239240
Task ("generate-mapping")
240241
.IsDependentOn ("androidxmapper")
241242
.IsDependentOn ("merge")
243+
.IsDependentOn ("diff")
242244
.Does (() =>
243245
{
246+
EnsureDirectoryExists("./output/");
244247
DownloadFile (BASE_API_INFO_URL, "./output/api-info.previous.xml");
245248

246-
StartProcess(ANDROIDX_MAPPER_EXE,
249+
var result = StartProcess(ANDROIDX_MAPPER_EXE,
247250
$"generate -v " +
248251
$" -s " + MakeAbsolute((FilePath)"./output/api-info.previous.xml") +
249252
$" -x " + MakeAbsolute((FilePath)"./output/api-info.xml") +
250253
$" -j " + MakeAbsolute((FilePath)"./util/AndroidXMapper/Resources/androidx-class-mapping.csv") +
251254
$" -m " + MakeAbsolute((FilePath)"./util/AndroidXMapper/Resources/override-mapping.csv") +
252255
$" -o " + MakeAbsolute((FilePath)"./output/androidx-mapping.csv"));
256+
if (result != 0)
257+
throw new Exception($"The androidxmapper failed with error code {result}.");
253258
});
254259

255260
Task ("merge")
256261
.IsDependentOn ("androidxmapper")
257262
.IsDependentOn ("libs")
258263
.Does (() =>
259264
{
260-
EnsureDirectoryExists("./output/");
261-
262265
var allDlls = GetFiles ($"./generated/*/bin/{BUILD_CONFIG}/{TF_MONIKER}/Xamarin.*.dll");
263-
264266
var mergeDlls = allDlls
265267
.GroupBy(d => new FileInfo(d.FullPath).Name)
266268
.Select(g => g.FirstOrDefault())
267269
.ToList();
268270

269-
StartProcess(ANDROIDX_MAPPER_EXE,
271+
EnsureDirectoryExists("./output/");
272+
var result = StartProcess(ANDROIDX_MAPPER_EXE,
270273
$"merge" +
271274
$" -a {string.Join(" -a ", mergeDlls)} " +
272275
$" -o " + MakeAbsolute((FilePath)"./output/AndroidX.Merged.dll") +
273276
$" -s \"{MONODROID_PATH}\" " +
274277
$" --inject-assemblyname");
278+
if (result != 0)
279+
throw new Exception($"The androidxmapper failed with error code {result}.");
275280
});
276281

277282
Task ("ci-setup")

0 commit comments

Comments
 (0)