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

Commit 4cc9c1b

Browse files
committed
Persuade GenAPI.exe to running on windows as well
1 parent e16e03d commit 4cc9c1b

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

build.cake

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -211,22 +211,22 @@ Task ("diff")
211211
"/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mono/2.1/"
212212
};
213213

214-
MonoApiInfo ("./output/AndroidSupport.Merged.dll",
215-
"./output/AndroidSupport.api-info.xml",
214+
MonoApiInfo ("./output/AndroidSupport.Merged.dll",
215+
"./output/AndroidSupport.api-info.xml",
216216
new MonoApiInfoToolSettings { SearchPaths = SEARCH_DIRS });
217217

218218
// Grab the last public release's api-info.xml to use as a base to compare and make an API diff
219219
DownloadFile (BASE_API_INFO_URL, "./output/AndroidSupport.api-info.previous.xml");
220220

221221
// Now diff against current release'd api info
222222
// eg: mono mono-api-diff.exe ./gps.r26.xml ./gps.r27.xml > gps.diff.xml
223-
MonoApiDiff ("./output/AndroidSupport.api-info.previous.xml",
223+
MonoApiDiff ("./output/AndroidSupport.api-info.previous.xml",
224224
"./output/AndroidSupport.api-info.xml",
225225
"./output/AndroidSupport.api-diff.xml");
226226

227227
// Now let's make a purty html file
228228
// eg: mono mono-api-html.exe -c -x ./gps.previous.info.xml ./gps.current.info.xml > gps.diff.html
229-
MonoApiHtml ("./output/AndroidSupport.api-info.previous.xml",
229+
MonoApiHtml ("./output/AndroidSupport.api-info.previous.xml",
230230
"./output/AndroidSupport.api-info.xml",
231231
"./output/AndroidSupport.api-diff.html");
232232
});
@@ -349,26 +349,31 @@ Task ("genapi").IsDependentOn ("libs-base").IsDependentOn ("externals").Does (()
349349

350350
// For some reason GenAPI.exe can't handle absolute paths on mac/unix properly, so always make them relative
351351
// GenAPI.exe -libPath:$(MONOANDROID) -out:Some.generated.cs -w:TypeForwards ./relative/path/to/Assembly.dll
352+
var libDirPrefix = IsRunningOnWindows () ? "output/" : "";
352353

353354
var libs = new FilePath [] {
354-
"./Xamarin.Android.Support.Compat.dll",
355-
"./Xamarin.Android.Support.Core.UI.dll",
356-
"./Xamarin.Android.Support.Core.Utils.dll",
357-
"./Xamarin.Android.Support.Fragment.dll",
358-
"./Xamarin.Android.Support.Media.Compat.dll",
359-
};
355+
"./" + libDirPrefix + "Xamarin.Android.Support.Compat.dll",
356+
"./" + libDirPrefix + "Xamarin.Android.Support.Core.UI.dll",
357+
"./" + libDirPrefix + "Xamarin.Android.Support.Core.Utils.dll",
358+
"./" + libDirPrefix + "Xamarin.Android.Support.Fragment.dll",
359+
"./" + libDirPrefix + "Xamarin.Android.Support.Media.Compat.dll",
360+
};
360361

361362

362363
foreach (var lib in libs) {
363364
var genName = lib.GetFilename () + ".generated.cs";
364365

366+
var libPath = IsRunningOnWindows () ? MakeAbsolute (lib).FullPath : lib.FullPath;
367+
var monoDroidPath = IsRunningOnWindows () ? "\"" + MONODROID_PATH + "\"" : MONODROID_PATH;
368+
365369
Information ("GenAPI: {0}", lib.FullPath);
366370

367371
StartProcess (GenApiToolPath, new ProcessSettings {
368-
Arguments = string.Format("-libPath:{0} -out:./{1} -w:TypeForwards {2}",
369-
MONODROID_PATH + "," + MSCORLIB_PATH,
372+
Arguments = string.Format("-libPath:{0} -out:{1}{2} -w:TypeForwards {3}",
373+
monoDroidPath + "," + MSCORLIB_PATH,
374+
IsRunningOnWindows () ? "" : "./",
370375
genName,
371-
lib.FullPath),
376+
libPath),
372377
WorkingDirectory = "./output/",
373378
});
374379
}

0 commit comments

Comments
 (0)