1
1
#tool nuget : ? package= ILRepack & version = 2.0 .10
2
2
#tool nuget: ? package = XamarinComponent
3
+ #tool nuget: ? package= Cake . MonoApiTools
3
4
4
5
#addin nuget: ? package = Cake . XCode
5
6
#addin nuget: ? package = Cake . Xamarin
6
7
#addin nuget: ? package = Cake . Xamarin . Build
7
8
#addin nuget: ? package = Cake . FileHelpers
9
+ #addin nuget: ? package = Cake . MonoApiTools
8
10
9
11
var TARGET = Argument ( "t" , Argument ( "target" , "Default" ) ) ;
10
12
@@ -168,6 +170,38 @@ Task ("externals")
168
170
}
169
171
} ) ;
170
172
173
+ Task ( "diff" )
174
+ . WithCriteria ( ! IsRunningOnWindows ( ) )
175
+ . IsDependentOn ( "merge" )
176
+ . Does ( ( ) =>
177
+ {
178
+ var SEARCH_DIRS = new FilePath [ ] {
179
+ MONODROID_PATH ,
180
+ "/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/xbuild-frameworks/MonoAndroid/v1.0/" ,
181
+ "/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mono/2.1/"
182
+ } ;
183
+
184
+ MonoApiInfo ( "./output/AndroidSupport.Merged.dll" ,
185
+ "./output/AndroidSupport.api-info.xml" ,
186
+ new MonoApiInfoToolSettings { SearchPaths = SEARCH_DIRS } ) ;
187
+
188
+ // Grab the latest published api info from S3
189
+ var latestReleasedApiInfoUrl = "http://xamarin-components-apiinfo.s3.amazonaws.com/Support.Android-Latest.xml" ;
190
+ DownloadFile ( latestReleasedApiInfoUrl , "./output/AndroidSupport.api-info.previous.xml" ) ;
191
+
192
+ // Now diff against current release'd api info
193
+ // eg: mono mono-api-diff.exe ./gps.r26.xml ./gps.r27.xml > gps.diff.xml
194
+ MonoApiDiff ( "./output/AndroidSupport.api-info.previous.xml" ,
195
+ "./output/AndroidSupport.api-info.xml" ,
196
+ "./output/AndroidSupport.api-diff.xml" ) ;
197
+
198
+ // Now let's make a purty html file
199
+ // eg: mono mono-api-html.exe -c -x ./gps.previous.info.xml ./gps.current.info.xml > gps.diff.html
200
+ MonoApiHtml ( "./output/AndroidSupport.api-info.previous.xml" ,
201
+ "./output/AndroidSupport.api-info.xml" ,
202
+ "./output/AndroidSupport.api-diff.html" ) ;
203
+ } ) ;
204
+
171
205
Task ( "merge" ) . IsDependentOn ( "libs" ) . Does ( ( ) =>
172
206
{
173
207
if ( FileExists ( "./output/AndroidSupport.Merged.dll" ) )
@@ -184,53 +218,6 @@ Task ("merge").IsDependentOn ("libs").Does (() =>
184
218
MONODROID_PATH
185
219
} ,
186
220
} ) ;
187
-
188
- Information ( "Completed: {0}" , "ILRepack" ) ;
189
-
190
- // Don't want to think about what the paths will do to this on windows right now
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
-
199
- // Next run the mono-api-info.exe to generate xml api info we can later diff with
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 ( ) ;
203
-
204
- IEnumerable < string > procStdOut ;
205
-
206
- var interopPath = "/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mono/2.1/" ;
207
- //eg: mono mono-api-info.exe --search-directory=/Library/Frameworks/Xamarin.Android.framework/Libraries/mandroid/platforms/android-23 ./Some.dll > api-info.xml
208
- StartProcess ( monoApiInfoExe , new ProcessSettings {
209
- Arguments = "--search-directory=" + MONODROID_PATH + " --search-directory=" + interopPath + " ./output/AndroidSupport.Merged.dll" ,
210
- RedirectStandardOutput = true ,
211
- } , out procStdOut ) ;
212
- FileWriteLines ( "./output/AndroidSupport.api-info.xml" , procStdOut . ToArray ( ) ) ;
213
-
214
- // Grab the latest published api info from S3
215
- var latestReleasedApiInfoUrl = "http://xamarin-components-apiinfo.s3.amazonaws.com/Support.Android-Latest.xml" ;
216
- DownloadFile ( latestReleasedApiInfoUrl , "./output/AndroidSupport.api-info.previous.xml" ) ;
217
-
218
- // Now diff against current release'd api info
219
- // eg: mono mono-api-diff.exe ./gps.r26.xml ./gps.r27.xml > gps.diff.xml
220
- StartProcess ( monoApiDiffExe , new ProcessSettings {
221
- Arguments = "./output/AndroidSupport.api-info.previous.xml ./output/AndroidSupport.api-info.xml" ,
222
- RedirectStandardOutput = true ,
223
- } , out procStdOut ) ;
224
- FileWriteLines ( "./output/AndroidSupport.api-diff.xml" , procStdOut . ToArray ( ) ) ;
225
-
226
- // Now let's make a purty html file
227
- // eg: mono mono-api-html.exe -c -x ./gps.previous.info.xml ./gps.current.info.xml > gps.diff.html
228
- StartProcess ( monoApiHtmlExe , new ProcessSettings {
229
- Arguments = "-c -x ./output/AndroidSupport.api-info.previous.xml ./output/AndroidSupport.api-info.xml" ,
230
- RedirectStandardOutput = true ,
231
- } , out procStdOut ) ;
232
- FileWriteLines ( "./output/AndroidSupport.api-diff.html" , procStdOut . ToArray ( ) ) ;
233
- }
234
221
} ) ;
235
222
236
223
0 commit comments