@@ -16,6 +16,7 @@ var AAR_VERSION = "23.4.0";
16
16
var M2_REPOSITORY_URL = "https://dl-ssl.google.com/android/repository/android_m2repository_r32.zip" ;
17
17
var BUILD_TOOLS_URL = "https://dl-ssl.google.com/android/repository/build-tools_r23-macosx.zip" ;
18
18
var DOCS_URL = "https://dl-ssl.google.com/android/repository/docs-23_r01.zip" ;
19
+ var MONO_API_TOOLS_URL = "http://xamarin-components-apiinfo.s3.amazonaws.com/mono-api-tools.zip" ;
19
20
20
21
var AAR_DIRS = new [ ] {
21
22
"support-v4" , "support-v13" , "appcompat-v7" , "gridlayout-v7" , "mediarouter-v7" , "recyclerview-v7" ,
@@ -169,6 +170,9 @@ Task ("externals")
169
170
170
171
Task ( "merge" ) . IsDependentOn ( "libs" ) . Does ( ( ) =>
171
172
{
173
+ if ( FileExists ( "./output/AndroidSupport.Merged.dll" ) )
174
+ DeleteFile ( "./output/AndroidSupport.Merged.dll" ) ;
175
+
172
176
var mergeDlls = GetFiles ( "./output/*.dll" ) ;
173
177
174
178
// Wait for ILRepack support in cake-0.5.2
@@ -181,45 +185,51 @@ Task ("merge").IsDependentOn ("libs").Does (() =>
181
185
} ,
182
186
} ) ;
183
187
188
+ Information ( "Completed: {0}" , "ILRepack" ) ;
189
+
184
190
// Don't want to think about what the paths will do to this on windows right now
185
191
if ( ! IsRunningOnWindows ( ) ) {
192
+ // Download the tools needed to run the next steps
193
+ if ( ! DirectoryExists ( "./tools/mono-api-tools" ) ) {
194
+ EnsureDirectoryExists ( "./tools/mono-api-tools/" ) ;
195
+ DownloadFile ( MONO_API_TOOLS_URL , "./tools/mono-api-tools.zip" ) ;
196
+ Unzip ( "./tools/mono-api-tools.zip" , "./tools/mono-api-tools/" ) ;
197
+ }
198
+
186
199
// Next run the mono-api-info.exe to generate xml api info we can later diff with
187
- var monoApiInfoExe = GetFiles ( "../.. /**/mono-api-info.exe" ) . FirstOrDefault ( ) ;
188
- var monoApiDiffExe = GetFiles ( "../.. /**/mono-api-diff.exe" ) . FirstOrDefault ( ) ;
189
- var monoApiHtmlExe = GetFiles ( "../.. /**/mono-api-html.exe" ) . FirstOrDefault ( ) ;
200
+ var monoApiInfoExe = GetFiles ( "./tools /**/mono-api-info.exe" ) . FirstOrDefault ( ) ;
201
+ var monoApiDiffExe = GetFiles ( "./tools /**/mono-api-diff.exe" ) . FirstOrDefault ( ) ;
202
+ var monoApiHtmlExe = GetFiles ( "./tools /**/mono-api-html.exe" ) . FirstOrDefault ( ) ;
190
203
204
+ IEnumerable < string > procStdOut ;
205
+
206
+ var interopPath = "/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mono/2.1/" ;
191
207
//eg: mono mono-api-info.exe --search-directory=/Library/Frameworks/Xamarin.Android.framework/Libraries/mandroid/platforms/android-23 ./Some.dll > api-info.xml
192
- using ( var process = StartAndReturnProcess ( monoApiInfoExe , new ProcessSettings {
193
- Arguments = "--search-directory=" + MONODROID_PATH + " ./output/AndroidSupport.Merged.dll" ,
208
+ StartProcess ( monoApiInfoExe , new ProcessSettings {
209
+ Arguments = "--search-directory=" + MONODROID_PATH + " --search-directory=" + interopPath + " ./output/AndroidSupport.Merged.dll",
194
210
RedirectStandardOutput = true ,
195
- } ) ) {
196
- process . WaitForExit ( ) ;
197
- FileWriteLines ( "./output/AndroidSupport.api-info.xml" , process . GetStandardOutput ( ) . ToArray ( ) ) ;
198
- }
211
+ } , out procStdOut ) ;
212
+ FileWriteLines ( "./output/AndroidSupport.api-info.xml" , procStdOut . ToArray ( ) ) ;
199
213
200
214
// Grab the latest published api info from S3
201
215
var latestReleasedApiInfoUrl = "http://xamarin-components-apiinfo.s3.amazonaws.com/Support.Android-Latest.xml" ;
202
216
DownloadFile ( latestReleasedApiInfoUrl , "./output/AndroidSupport.api-info.previous.xml" ) ;
203
217
204
218
// Now diff against current release'd api info
205
219
// eg: mono mono-api-diff.exe ./gps.r26.xml ./gps.r27.xml > gps.diff.xml
206
- using ( var process = StartAndReturnProcess ( monoApiDiffExe , new ProcessSettings {
220
+ StartProcess ( monoApiDiffExe , new ProcessSettings {
207
221
Arguments = "./output/AndroidSupport.api-info.previous.xml ./output/AndroidSupport.api-info.xml" ,
208
222
RedirectStandardOutput = true ,
209
- } ) ) {
210
- process . WaitForExit ( ) ;
211
- FileWriteLines ( "./output/AndroidSupport.api-diff.xml" , process . GetStandardOutput ( ) . ToArray ( ) ) ;
212
- }
223
+ } , out procStdOut ) ;
224
+ FileWriteLines ( "./output/AndroidSupport.api-diff.xml" , procStdOut . ToArray ( ) ) ;
213
225
214
226
// Now let's make a purty html file
215
227
// eg: mono mono-api-html.exe -c -x ./gps.previous.info.xml ./gps.current.info.xml > gps.diff.html
216
- using ( var process = StartAndReturnProcess ( monoApiHtmlExe , new ProcessSettings {
228
+ StartProcess ( monoApiHtmlExe , new ProcessSettings {
217
229
Arguments = "-c -x ./output/AndroidSupport.api-info.previous.xml ./output/AndroidSupport.api-info.xml" ,
218
230
RedirectStandardOutput = true ,
219
- } ) ) {
220
- process . WaitForExit ( ) ;
221
- FileWriteLines ( "./output/AndroidSupport.api-diff.html" , process . GetStandardOutput ( ) . ToArray ( ) ) ;
222
- }
231
+ } , out procStdOut ) ;
232
+ FileWriteLines ( "./output/AndroidSupport.api-diff.html" , procStdOut . ToArray ( ) ) ;
223
233
}
224
234
} ) ;
225
235
0 commit comments