/
build.cake
745 lines (613 loc) · 48.8 KB
/
build.cake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
#tool nuget:?package=ILRepack&version=2.0.10
#tool nuget:?package=XamarinComponent
#tool nuget:?package=Cake.MonoApiTools
#tool nuget:?package=Microsoft.DotNet.BuildTools.GenAPI&version=1.0.0-beta-00081
#addin nuget:?package=Cake.Json
#addin nuget:?package=Cake.XCode
#addin nuget:?package=Cake.Xamarin
#addin nuget:?package=Cake.Xamarin.Build&version=1.1.13
#addin nuget:?package=Cake.FileHelpers
#addin nuget:?package=Cake.MonoApiTools
// To find new URL: https://dl-ssl.google.com/android/repository/addon.xml and search for google_play_services_*.zip\
// FROM: https://dl.google.com/android/repository/addon2-1.xml
var DOCS_URL = "https://dl-ssl.google.com/android/repository/google_play_services_v9_rc41.zip";
var M2_REPOSITORY = "https://dl-ssl.google.com/android/repository/google_m2repository_gms_v9_1_rc07_wear_2_0_1_rc3.zip";
// We grab the previous release's api-info.xml to use as a comparison for this build's generated info to make an api-diff
var BASE_API_INFO_URL = "https://github.com/xamarin/GooglePlayServicesComponents/releases/download/42.1001.0/api-info.xml";
// The common suffix for nuget version
// Sometimes might be "-beta1" for a prerelease, or ".1" if we have a point release for the same actual aar's
// will be blank for a stable release that has no point release fixes
var COMMON_NUGET_VERSION = "";
var PLAY_COMPONENT_VERSION = "42.1021.0.0";
var PLAY_NUGET_VERSION = "42.1021.1" + COMMON_NUGET_VERSION;
var PLAY_AAR_VERSION = "10.2.1";
var VERSION_DESC = "10.2.1";
var WEAR_COMPONENT_VERSION = "2.0.1.0";
var WEAR_NUGET_VERSION = "2.0.1.1" + COMMON_NUGET_VERSION;
var WEAR_AAR_VERSION = "2.0.1";
var WEARABLE_SUPPORT_VERSION = "2.0.1";
var FIREBASE_COMPONENT_VERSION = PLAY_COMPONENT_VERSION;
var FIREBASE_NUGET_VERSION = PLAY_NUGET_VERSION;
var FIREBASE_AAR_VERSION = PLAY_AAR_VERSION;
var TARGET = Argument ("t", Argument ("target", "Default"));
var BUILD_CONFIG = Argument ("config", "Release");
var CPU_COUNT = System.Environment.ProcessorCount;
// MSBuild in < Mono 5.0 has some issues with multi cpu count being specified causing errors
if (!IsRunningOnWindows())
CPU_COUNT = 1;
var ALWAYS_MSBUILD = true;
LogSystemInfo ();
var AAR_INFOS = new [] {
new AarInfo ("ads", "play-services-ads", "android/gms/play-services-ads", "Xamarin.GooglePlayServices.Ads", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("ads-lite", "play-services-ads-lite", "android/gms/play-services-ads-lite", "Xamarin.GooglePlayServices.Ads.Lite", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("analytics", "play-services-analytics", "android/gms/play-services-analytics", "Xamarin.GooglePlayServices.Analytics", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("analytics-impl", "play-services-analytics-impl", "android/gms/play-services-analytics-impl", "Xamarin.GooglePlayServices.Analytics.Impl", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("auth", "play-services-auth", "android/gms/play-services-auth", "Xamarin.GooglePlayServices.Auth", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("auth-base", "play-services-auth-base", "android/gms/play-services-auth-base", "Xamarin.GooglePlayServices.Auth.Base", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("awareness", "play-services-awareness", "android/gms/play-services-awareness", "Xamarin.GooglePlayServices.Awareness", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("base", "play-services-base", "android/gms/play-services-base", "Xamarin.GooglePlayServices.Base", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("basement", "play-services-basement", "android/gms/play-services-basement", "Xamarin.GooglePlayServices.Basement", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("appinvite", "play-services-appinvite", "android/gms/play-services-appinvite", "Xamarin.GooglePlayServices.AppInvite", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("cast", "play-services-cast", "android/gms/play-services-cast", "Xamarin.GooglePlayServices.Cast", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("cast-framework", "play-services-cast-framework", "android/gms/play-services-cast-framework", "Xamarin.GooglePlayServices.Cast.Framework", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("clearcut", "play-services-clearcut", "android/gms/play-services-clearcut", "Xamarin.GooglePlayServices.Clearcut", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("drive", "play-services-drive", "android/gms/play-services-drive", "Xamarin.GooglePlayServices.Drive", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("fitness", "play-services-fitness", "android/gms/play-services-fitness", "Xamarin.GooglePlayServices.Fitness", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("games", "play-services-games", "android/gms/play-services-games", "Xamarin.GooglePlayServices.Games", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("gass", "play-services-gass", "android/gms/play-services-gass", "Xamarin.GooglePlayServices.Gass", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("gcm", "play-services-gcm", "android/gms/play-services-gcm", "Xamarin.GooglePlayServices.Gcm", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("identity", "play-services-identity", "android/gms/play-services-identity", "Xamarin.GooglePlayServices.Identity", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("iid", "play-services-iid", "android/gms/play-services-iid", "Xamarin.GooglePlayServices.Iid", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("instantapps", "play-services-instantapps", "android/gms/play-services-instantapps", "Xamarin.GooglePlayServices.InstantApps", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("location", "play-services-location", "android/gms/play-services-location", "Xamarin.GooglePlayServices.Location", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("maps", "play-services-maps", "android/gms/play-services-maps", "Xamarin.GooglePlayServices.Maps", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("nearby", "play-services-nearby", "android/gms/play-services-nearby", "Xamarin.GooglePlayServices.Nearby", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("panorama", "play-services-panorama", "android/gms/play-services-panorama", "Xamarin.GooglePlayServices.Panorama", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("places", "play-services-places", "android/gms/play-services-places", "Xamarin.GooglePlayServices.Places", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("plus", "play-services-plus", "android/gms/play-services-plus", "Xamarin.GooglePlayServices.Plus", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("safetynet", "play-services-safetynet", "android/gms/play-services-safetynet", "Xamarin.GooglePlayServices.SafetyNet", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("tasks", "play-services-tasks", "android/gms/play-services-tasks", "Xamarin.GooglePlayServices.Tasks", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("tagmanager", "play-services-tagmanager", "android/gms/play-services-tagmanager", "Xamarin.GooglePlayServices.TagManager", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("tagmanager-api", "play-services-tagmanager-api", "android/gms/play-services-tagmanager-api", "Xamarin.GooglePlayServices.TagManager.Api", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("tagmanager-v4-impl", "play-services-tagmanager-v4-impl", "android/gms/play-services-tagmanager-v4-impl", "Xamarin.GooglePlayServices.TagManager.V4.Impl", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("vision", "play-services-vision", "android/gms/play-services-vision", "Xamarin.GooglePlayServices.Vision", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("wallet", "play-services-wallet", "android/gms/play-services-wallet", "Xamarin.GooglePlayServices.Wallet", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("wearable", "play-services-wearable", "android/gms/play-services-wearable", "Xamarin.GooglePlayServices.Wearable", PLAY_AAR_VERSION, PLAY_NUGET_VERSION, PLAY_COMPONENT_VERSION),
new AarInfo ("support-wearable", "wearable", "android/support/wearable", "Xamarin.Android.Wear", WEAR_AAR_VERSION, WEAR_NUGET_VERSION, WEAR_COMPONENT_VERSION),
new AarInfo ("firebase-ads", "firebase-ads", "firebase/firebase-ads", "Xamarin.Firebase.Ads", FIREBASE_AAR_VERSION, FIREBASE_NUGET_VERSION, FIREBASE_COMPONENT_VERSION),
new AarInfo ("firebase-analytics", "firebase-analytics", "firebase/firebase-analytics", "Xamarin.Firebase.Analytics", FIREBASE_AAR_VERSION, FIREBASE_NUGET_VERSION, FIREBASE_COMPONENT_VERSION),
new AarInfo ("firebase-analytics-impl", "firebase-analytics-impl", "firebase/firebase-analytics-impl", "Xamarin.Firebase.Analytics.Impl", FIREBASE_AAR_VERSION, FIREBASE_NUGET_VERSION, FIREBASE_COMPONENT_VERSION),
new AarInfo ("firebase-appindexing", "firebase-appindexing", "firebase/firebase-appindexing", "Xamarin.Firebase.AppIndexing", FIREBASE_AAR_VERSION, FIREBASE_NUGET_VERSION, FIREBASE_COMPONENT_VERSION),
new AarInfo ("firebase-auth", "firebase-auth", "firebase/firebase-auth", "Xamarin.Firebase.Auth", FIREBASE_AAR_VERSION, FIREBASE_NUGET_VERSION, FIREBASE_COMPONENT_VERSION),
new AarInfo ("firebase-common", "firebase-common", "firebase/firebase-common", "Xamarin.Firebase.Common", FIREBASE_AAR_VERSION, FIREBASE_NUGET_VERSION, FIREBASE_COMPONENT_VERSION),
new AarInfo ("firebase-config", "firebase-config", "firebase/firebase-config", "Xamarin.Firebase.Config", FIREBASE_AAR_VERSION, FIREBASE_NUGET_VERSION, FIREBASE_COMPONENT_VERSION),
new AarInfo ("firebase-core", "firebase-core", "firebase/firebase-core", "Xamarin.Firebase.Core", FIREBASE_AAR_VERSION, FIREBASE_NUGET_VERSION, FIREBASE_COMPONENT_VERSION),
new AarInfo ("firebase-crash", "firebase-crash", "firebase/firebase-crash", "Xamarin.Firebase.Crash", FIREBASE_AAR_VERSION, FIREBASE_NUGET_VERSION, FIREBASE_COMPONENT_VERSION),
new AarInfo ("firebase-database", "firebase-database", "firebase/firebase-database", "Xamarin.Firebase.Database", FIREBASE_AAR_VERSION, FIREBASE_NUGET_VERSION, FIREBASE_COMPONENT_VERSION),
new AarInfo ("firebase-database-connection", "firebase-database-connection", "firebase/firebase-database-connection", "Xamarin.Firebase.Database.Connection", FIREBASE_AAR_VERSION, FIREBASE_NUGET_VERSION, FIREBASE_COMPONENT_VERSION),
new AarInfo ("firebase-iid", "firebase-iid", "firebase/firebase-iid", "Xamarin.Firebase.Iid", FIREBASE_AAR_VERSION, FIREBASE_NUGET_VERSION, FIREBASE_COMPONENT_VERSION),
new AarInfo ("firebase-invites", "firebase-invites", "firebase/firebase-invites", "Xamarin.Firebase.Invites", FIREBASE_AAR_VERSION, FIREBASE_NUGET_VERSION, FIREBASE_COMPONENT_VERSION),
new AarInfo ("firebase-messaging", "firebase-messaging", "firebase/firebase-messaging", "Xamarin.Firebase.Messaging", FIREBASE_AAR_VERSION, FIREBASE_NUGET_VERSION, FIREBASE_COMPONENT_VERSION),
new AarInfo ("firebase-storage", "firebase-storage", "firebase/firebase-storage", "Xamarin.Firebase.Storage", FIREBASE_AAR_VERSION, FIREBASE_NUGET_VERSION, FIREBASE_COMPONENT_VERSION),
new AarInfo ("firebase-storage-common", "firebase-storage-common", "firebase/firebase-storage-common", "Xamarin.Firebase.Storage.Common", FIREBASE_AAR_VERSION, FIREBASE_NUGET_VERSION, FIREBASE_COMPONENT_VERSION),
};
class PartialZipInfo {
public string Url { get;set; }
public string LocalPath { get;set; }
public string Md5 { get;set; }
public long RangeStart { get;set; }
public long RangeEnd { get;set; }
}
class AarInfo
{
public AarInfo (string bindingDir, string dir, string path, string nugetId, string aarVersion, string nugetVersion, string componentVersion)
{
BindingDir = bindingDir;
Dir = dir;
Path = path;
NugetId = nugetId;
AarVersion = aarVersion;
NuGetVersion = nugetVersion;
ComponentVersion = componentVersion;
Extension = ".aar";
}
public string BindingDir { get;set; }
public string Dir { get; set; }
public string Path { get; set; }
public string NugetId { get;set; }
public string AarVersion { get; set; }
public string NuGetVersion { get; set; }
public string ComponentVersion { get; set; }
public string Extension { get;set; }
}
var MONODROID_PATH = "/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mandroid/platforms/android-23/";
if (IsRunningOnWindows ())
MONODROID_PATH = new DirectoryPath (Environment.GetFolderPath (Environment.SpecialFolder.ProgramFilesX86)).Combine ("Reference Assemblies/Microsoft/Framework/MonoAndroid/v6.0/").FullPath;
var MONO_PATH = "/Library/Frameworks/Mono.framework/Versions/Current";
var MSCORLIB_PATH = "/Library/Frameworks/Xamarin.Android.framework/Libraries/mono/2.1/";
if (IsRunningOnWindows ()) {
var DOTNETDIR = new DirectoryPath (Environment.GetFolderPath (Environment.SpecialFolder.Windows)).Combine ("Microsoft.NET/");
if (DirectoryExists (DOTNETDIR.Combine ("Framework64")))
MSCORLIB_PATH = MakeAbsolute (DOTNETDIR.Combine("Framework64/v4.0.30319/")).FullPath;
else
MSCORLIB_PATH = MakeAbsolute (DOTNETDIR.Combine("Framework/v4.0.30319/")).FullPath;
}
var buildsOnWinMac = BuildPlatforms.Windows | BuildPlatforms.Mac;
var buildSpec = new BuildSpec {
Libs = new [] {
new DefaultSolutionBuilder {
SolutionPath = "./GooglePlayServices.sln",
BuildsOn = BuildPlatforms.Windows | BuildPlatforms.Mac,
MaxCpuCount = CPU_COUNT,
AlwaysUseMSBuild = ALWAYS_MSBUILD,
OutputFiles = new [] {
new OutputFileCopy { FromFile = "./base/source/bin/Release/Xamarin.GooglePlayServices.Base.dll" },
new OutputFileCopy { FromFile = "./basement/source/bin/Release/Xamarin.GooglePlayServices.Basement.dll" },
new OutputFileCopy { FromFile = "./ads/source/bin/Release/Xamarin.GooglePlayServices.Ads.dll" },
new OutputFileCopy { FromFile = "./ads-lite/source/bin/Release/Xamarin.GooglePlayServices.Ads.Lite.dll" },
new OutputFileCopy { FromFile = "./analytics/source/bin/Release/Xamarin.GooglePlayServices.Analytics.dll" },
new OutputFileCopy { FromFile = "./analytics-impl/source/bin/Release/Xamarin.GooglePlayServices.Analytics.Impl.dll" },
new OutputFileCopy { FromFile = "./appinvite/source/bin/Release/Xamarin.GooglePlayServices.AppInvite.dll" },
new OutputFileCopy { FromFile = "./auth/source/bin/Release/Xamarin.GooglePlayServices.Auth.dll" },
new OutputFileCopy { FromFile = "./auth-base/source/bin/Release/Xamarin.GooglePlayServices.Auth.Base.dll" },
new OutputFileCopy { FromFile = "./awareness/source/bin/Release/Xamarin.GooglePlayServices.Awareness.dll" },
new OutputFileCopy { FromFile = "./cast/source/bin/Release/Xamarin.GooglePlayServices.Cast.dll" },
new OutputFileCopy { FromFile = "./cast-framework/source/bin/Release/Xamarin.GooglePlayServices.Cast.Framework.dll" },
new OutputFileCopy { FromFile = "./clearcut/source/bin/Release/Xamarin.GooglePlayServices.Clearcut.dll" },
new OutputFileCopy { FromFile = "./drive/source/bin/Release/Xamarin.GooglePlayServices.Drive.dll" },
new OutputFileCopy { FromFile = "./fitness/source/bin/Release/Xamarin.GooglePlayServices.Fitness.dll" },
new OutputFileCopy { FromFile = "./games/source/bin/Release/Xamarin.GooglePlayServices.Games.dll" },
new OutputFileCopy { FromFile = "./gass/source/bin/Release/Xamarin.GooglePlayServices.Gass.dll" },
new OutputFileCopy { FromFile = "./gcm/source/bin/Release/Xamarin.GooglePlayServices.Gcm.dll" },
new OutputFileCopy { FromFile = "./identity/source/bin/Release/Xamarin.GooglePlayServices.Identity.dll" },
new OutputFileCopy { FromFile = "./iid/source/bin/Release/Xamarin.GooglePlayServices.Iid.dll" },
new OutputFileCopy { FromFile = "./instantapps/source/bin/Release/Xamarin.GooglePlayServices.InstantApps.dll" },
new OutputFileCopy { FromFile = "./location/source/bin/Release/Xamarin.GooglePlayServices.Location.dll" },
new OutputFileCopy { FromFile = "./maps/source/bin/Release/Xamarin.GooglePlayServices.Maps.dll" },
new OutputFileCopy { FromFile = "./nearby/source/bin/Release/Xamarin.GooglePlayServices.Nearby.dll" },
new OutputFileCopy { FromFile = "./panorama/source/bin/Release/Xamarin.GooglePlayServices.Panorama.dll" },
new OutputFileCopy { FromFile = "./places/source/bin/Release/Xamarin.GooglePlayServices.Places.dll" },
new OutputFileCopy { FromFile = "./plus/source/bin/Release/Xamarin.GooglePlayServices.Plus.dll" },
new OutputFileCopy { FromFile = "./safetynet/source/bin/Release/Xamarin.GooglePlayServices.SafetyNet.dll" },
new OutputFileCopy { FromFile = "./vision/source/bin/Release/Xamarin.GooglePlayServices.Vision.dll" },
new OutputFileCopy { FromFile = "./wallet/source/bin/Release/Xamarin.GooglePlayServices.Wallet.dll" },
new OutputFileCopy { FromFile = "./wearable/source/bin/Release/Xamarin.GooglePlayServices.Wearable.dll" },
new OutputFileCopy { FromFile = "./support-wearable/source/bin/Release/Xamarin.Android.Wear.dll" },
new OutputFileCopy { FromFile = "./tagmanager/source/bin/Release/Xamarin.GooglePlayServices.TagManager.dll" },
new OutputFileCopy { FromFile = "./tagmanager-api/source/bin/Release/Xamarin.GooglePlayServices.TagManager.Api.dll" },
new OutputFileCopy { FromFile = "./tagmanager-v4-impl/source/bin/Release/Xamarin.GooglePlayServices.TagManager.V4.Impl.dll" },
new OutputFileCopy { FromFile = "./tasks/source/bin/Release/Xamarin.GooglePlayServices.Tasks.dll" },
new OutputFileCopy { FromFile = "./firebase-analytics/source/bin/Release/Xamarin.Firebase.Analytics.dll" },
new OutputFileCopy { FromFile = "./firebase-analytics-impl/source/bin/Release/Xamarin.Firebase.Analytics.Impl.dll" },
new OutputFileCopy { FromFile = "./firebase-appindexing/source/bin/Release/Xamarin.Firebase.AppIndexing.dll" },
new OutputFileCopy { FromFile = "./firebase-auth/source/bin/Release/Xamarin.Firebase.Auth.dll" },
new OutputFileCopy { FromFile = "./firebase-common/source/bin/Release/Xamarin.Firebase.Common.dll" },
new OutputFileCopy { FromFile = "./firebase-config/source/bin/Release/Xamarin.Firebase.Config.dll" },
new OutputFileCopy { FromFile = "./firebase-crash/source/bin/Release/Xamarin.Firebase.Crash.dll" },
new OutputFileCopy { FromFile = "./firebase-database/source/bin/Release/Xamarin.Firebase.Database.dll" },
new OutputFileCopy { FromFile = "./firebase-database-connection/source/bin/Release/Xamarin.Firebase.Database.Connection.dll" },
new OutputFileCopy { FromFile = "./firebase-iid/source/bin/Release/Xamarin.Firebase.Iid.dll" },
new OutputFileCopy { FromFile = "./firebase-messaging/source/bin/Release/Xamarin.Firebase.Messaging.dll" },
new OutputFileCopy { FromFile = "./firebase-storage/source/bin/Release/Xamarin.Firebase.Storage.dll" },
new OutputFileCopy { FromFile = "./firebase-storage-common/source/bin/Release/Xamarin.Firebase.Storage.Common.dll" },
}
},
},
Samples = new [] {
new DefaultSolutionBuilder { SolutionPath = "./ads/samples/AdMobSample.sln", BuildsOn = buildsOnWinMac, MaxCpuCount = CPU_COUNT, AlwaysUseMSBuild = ALWAYS_MSBUILD },
new DefaultSolutionBuilder { SolutionPath = "./analytics/samples/AnalyticsSample.sln", BuildsOn = buildsOnWinMac, MaxCpuCount = CPU_COUNT, AlwaysUseMSBuild = ALWAYS_MSBUILD },
new DefaultSolutionBuilder { SolutionPath = "./appinvite/samples/AppInviteSample.sln", BuildsOn = buildsOnWinMac, MaxCpuCount = CPU_COUNT, AlwaysUseMSBuild = ALWAYS_MSBUILD },
new DefaultSolutionBuilder { SolutionPath = "./cast/samples/CastingCall.sln", BuildsOn = buildsOnWinMac, MaxCpuCount = CPU_COUNT, AlwaysUseMSBuild = ALWAYS_MSBUILD },
new DefaultSolutionBuilder { SolutionPath = "./drive/samples/DriveSample.sln", BuildsOn = buildsOnWinMac, MaxCpuCount = CPU_COUNT, AlwaysUseMSBuild = ALWAYS_MSBUILD },
new DefaultSolutionBuilder { SolutionPath = "./fitness/samples/BasicSensorsApi.sln", BuildsOn = buildsOnWinMac, MaxCpuCount = CPU_COUNT, AlwaysUseMSBuild = ALWAYS_MSBUILD },
new DefaultSolutionBuilder { SolutionPath = "./games/samples/BeGenerous.sln", BuildsOn = buildsOnWinMac, MaxCpuCount = CPU_COUNT, AlwaysUseMSBuild = ALWAYS_MSBUILD },
new DefaultSolutionBuilder { SolutionPath = "./gcm/samples/GCMSample.sln", BuildsOn = buildsOnWinMac, MaxCpuCount = CPU_COUNT, AlwaysUseMSBuild = ALWAYS_MSBUILD },
new DefaultSolutionBuilder { SolutionPath = "./location/samples/LocationSample.sln", BuildsOn = buildsOnWinMac, MaxCpuCount = CPU_COUNT, AlwaysUseMSBuild = ALWAYS_MSBUILD },
new DefaultSolutionBuilder { SolutionPath = "./maps/samples/MapsSample.sln", BuildsOn = buildsOnWinMac, MaxCpuCount = CPU_COUNT, AlwaysUseMSBuild = ALWAYS_MSBUILD },
new DefaultSolutionBuilder { SolutionPath = "./nearby/samples/NearbySample.sln", BuildsOn = buildsOnWinMac, MaxCpuCount = CPU_COUNT, AlwaysUseMSBuild = ALWAYS_MSBUILD },
new DefaultSolutionBuilder { SolutionPath = "./panorama/samples/PanoramaSample.sln", BuildsOn = buildsOnWinMac, MaxCpuCount = CPU_COUNT, AlwaysUseMSBuild = ALWAYS_MSBUILD },
new DefaultSolutionBuilder { SolutionPath = "./places/samples/PlacesAsync.sln", BuildsOn = buildsOnWinMac, MaxCpuCount = CPU_COUNT, AlwaysUseMSBuild = ALWAYS_MSBUILD },
new DefaultSolutionBuilder { SolutionPath = "./plus/samples/PlusSample.sln", BuildsOn = buildsOnWinMac, MaxCpuCount = CPU_COUNT, AlwaysUseMSBuild = ALWAYS_MSBUILD },
new DefaultSolutionBuilder { SolutionPath = "./safetynet/samples/SafetyNetSample.sln", BuildsOn = buildsOnWinMac, MaxCpuCount = CPU_COUNT, AlwaysUseMSBuild = ALWAYS_MSBUILD },
new DefaultSolutionBuilder { SolutionPath = "./vision/samples/VisionSample.sln", BuildsOn = buildsOnWinMac, MaxCpuCount = CPU_COUNT, AlwaysUseMSBuild = ALWAYS_MSBUILD },
new DefaultSolutionBuilder { SolutionPath = "./wallet/samples/AndroidPayQuickstart.sln", BuildsOn = buildsOnWinMac, MaxCpuCount = CPU_COUNT, AlwaysUseMSBuild = ALWAYS_MSBUILD },
new DefaultSolutionBuilder { SolutionPath = "./support-wearable/samples/MultiPageSample.sln", BuildsOn = buildsOnWinMac, MaxCpuCount = CPU_COUNT, AlwaysUseMSBuild = ALWAYS_MSBUILD },
new DefaultSolutionBuilder { SolutionPath = "./support-wearable/samples/WatchFaceSample.sln", BuildsOn = buildsOnWinMac, MaxCpuCount = CPU_COUNT, AlwaysUseMSBuild = ALWAYS_MSBUILD },
new DefaultSolutionBuilder { SolutionPath = "./firebase-ads/samples/FirebaseAdmobQuickstart.sln", BuildsOn = buildsOnWinMac, MaxCpuCount = CPU_COUNT, AlwaysUseMSBuild = ALWAYS_MSBUILD },
new DefaultSolutionBuilder { SolutionPath = "./firebase-analytics/samples/FirebaseAnalyticsQuickstart.sln", BuildsOn = buildsOnWinMac, MaxCpuCount = CPU_COUNT, AlwaysUseMSBuild = ALWAYS_MSBUILD },
new DefaultSolutionBuilder { SolutionPath = "./firebase-appindexing/samples/AppIndexingSample.sln", BuildsOn = buildsOnWinMac, MaxCpuCount = CPU_COUNT, AlwaysUseMSBuild = ALWAYS_MSBUILD },
new DefaultSolutionBuilder { SolutionPath = "./firebase-auth/samples/FirebaseAuthQuickstart.sln", BuildsOn = buildsOnWinMac, MaxCpuCount = CPU_COUNT, AlwaysUseMSBuild = ALWAYS_MSBUILD },
new DefaultSolutionBuilder { SolutionPath = "./firebase-config/samples/FirebaseConfigQuickstart.sln", BuildsOn = buildsOnWinMac, MaxCpuCount = CPU_COUNT, AlwaysUseMSBuild = ALWAYS_MSBUILD },
new DefaultSolutionBuilder { SolutionPath = "./firebase-crash/samples/FirebaseCrashReportingQuickstart.sln", BuildsOn = buildsOnWinMac, MaxCpuCount = CPU_COUNT, AlwaysUseMSBuild = ALWAYS_MSBUILD },
new DefaultSolutionBuilder { SolutionPath = "./firebase-invites/samples/FirebaseInvitesQuickstart.sln", BuildsOn = buildsOnWinMac, MaxCpuCount = CPU_COUNT, AlwaysUseMSBuild = ALWAYS_MSBUILD },
new DefaultSolutionBuilder { SolutionPath = "./firebase-messaging/samples/FirebaseMessagingQuickstart.sln", BuildsOn = buildsOnWinMac, MaxCpuCount = CPU_COUNT, AlwaysUseMSBuild = ALWAYS_MSBUILD },
new DefaultSolutionBuilder { SolutionPath = "./firebase-storage/samples/FirebaseStorageQuickstart.sln", BuildsOn = buildsOnWinMac, MaxCpuCount = CPU_COUNT, AlwaysUseMSBuild = ALWAYS_MSBUILD },
},
NuGets = new [] {
new NuGetInfo { NuSpec = "./base/nuget/Xamarin.GooglePlayServices.Base.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./basement/nuget/Xamarin.GooglePlayServices.Basement.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./ads/nuget/Xamarin.GooglePlayServices.Ads.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./ads-lite/nuget/Xamarin.GooglePlayServices.Ads.Lite.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./analytics/nuget/Xamarin.GooglePlayServices.Analytics.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./analytics-impl/nuget/Xamarin.GooglePlayServices.Analytics.Impl.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./appinvite/nuget/Xamarin.GooglePlayServices.AppInvite.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./auth/nuget/Xamarin.GooglePlayServices.Auth.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./auth-base/nuget/Xamarin.GooglePlayServices.Auth.Base.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./awareness/nuget/Xamarin.GooglePlayServices.Awareness.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./cast/nuget/Xamarin.GooglePlayServices.Cast.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./cast-framework/nuget/Xamarin.GooglePlayServices.Cast.Framework.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./clearcut/nuget/Xamarin.GooglePlayServices.Clearcut.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./drive/nuget/Xamarin.GooglePlayServices.Drive.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./fitness/nuget/Xamarin.GooglePlayServices.Fitness.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./games/nuget/Xamarin.GooglePlayServices.Games.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./gass/nuget/Xamarin.GooglePlayServices.Gass.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./gcm/nuget/Xamarin.GooglePlayServices.Gcm.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./identity/nuget/Xamarin.GooglePlayServices.Identity.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./iid/nuget/Xamarin.GooglePlayServices.Iid.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./instantapps/nuget/Xamarin.GooglePlayServices.InstantApps.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./location/nuget/Xamarin.GooglePlayServices.Location.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./maps/nuget/Xamarin.GooglePlayServices.Maps.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./nearby/nuget/Xamarin.GooglePlayServices.Nearby.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./panorama/nuget/Xamarin.GooglePlayServices.Panorama.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./places/nuget/Xamarin.GooglePlayServices.Places.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./plus/nuget/Xamarin.GooglePlayServices.Plus.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./safetynet/nuget/Xamarin.GooglePlayServices.SafetyNet.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./vision/nuget/Xamarin.GooglePlayServices.Vision.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./wallet/nuget/Xamarin.GooglePlayServices.Wallet.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./wearable/nuget/Xamarin.GooglePlayServices.Wearable.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./support-wearable/nuget/Xamarin.Android.Wear.nuspec", Version = WEAR_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./tagmanager/nuget/Xamarin.GooglePlayServices.TagManager.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./tagmanager-api/nuget/Xamarin.GooglePlayServices.TagManager.Api.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./tagmanager-v4-impl/nuget/Xamarin.GooglePlayServices.TagManager.V4.Impl.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./tasks/nuget/Xamarin.GooglePlayServices.Tasks.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./firebase-ads/nuget/Xamarin.Firebase.Ads.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./firebase-analytics/nuget/Xamarin.Firebase.Analytics.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./firebase-analytics-impl/nuget/Xamarin.Firebase.Analytics.Impl.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./firebase-appindexing/nuget/Xamarin.Firebase.AppIndexing.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./firebase-auth/nuget/Xamarin.Firebase.Auth.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./firebase-common/nuget/Xamarin.Firebase.Common.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./firebase-config/nuget/Xamarin.Firebase.Config.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./firebase-crash/nuget/Xamarin.Firebase.Crash.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./firebase-database/nuget/Xamarin.Firebase.Database.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./firebase-database-connection/nuget/Xamarin.Firebase.Database.Connection.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./firebase-iid/nuget/Xamarin.Firebase.Iid.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./firebase-invites/nuget/Xamarin.Firebase.Invites.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./firebase-messaging/nuget/Xamarin.Firebase.Messaging.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./firebase-storage/nuget/Xamarin.Firebase.Storage.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./firebase-storage-common/nuget/Xamarin.Firebase.Storage.Common.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
// These are empty packages that depend on others
new NuGetInfo { NuSpec = "./firebase-core/nuget/Xamarin.Firebase.Core.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
new NuGetInfo { NuSpec = "./firebase-ads/nuget/Xamarin.Firebase.Ads.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
// Type forwarder packages for backwards compatibility
new NuGetInfo { NuSpec = "./appindexing/nuget/Xamarin.GooglePlayServices.AppIndexing.nuspec", Version = PLAY_NUGET_VERSION, RequireLicenseAcceptance = true },
},
Components = new [] {
new Component { ManifestDirectory = "./ads/component" },
new Component { ManifestDirectory = "./analytics/component" },
new Component { ManifestDirectory = "./appinvite/component" },
new Component { ManifestDirectory = "./cast/component" },
new Component { ManifestDirectory = "./drive/component" },
new Component { ManifestDirectory = "./fitness/component" },
new Component { ManifestDirectory = "./games/component" },
new Component { ManifestDirectory = "./gcm/component" },
new Component { ManifestDirectory = "./location/component" },
new Component { ManifestDirectory = "./maps/component" },
new Component { ManifestDirectory = "./nearby/component" },
new Component { ManifestDirectory = "./panorama/component" },
new Component { ManifestDirectory = "./plus/component" },
new Component { ManifestDirectory = "./safetynet/component" },
new Component { ManifestDirectory = "./vision/component" },
new Component { ManifestDirectory = "./wallet/component" },
new Component { ManifestDirectory = "./support-wearable/component" },
new Component { ManifestDirectory = "./firebase-ads/component" },
new Component { ManifestDirectory = "./firebase-analytics/component" },
new Component { ManifestDirectory = "./firebase-appindexing/component" },
new Component { ManifestDirectory = "./firebase-auth/component" },
new Component { ManifestDirectory = "./firebase-config/component" },
new Component { ManifestDirectory = "./firebase-crash/component" },
new Component { ManifestDirectory = "./firebase-invites/component" },
new Component { ManifestDirectory = "./firebase-messaging/component" },
new Component { ManifestDirectory = "./firebase-storage/component" },
}
};
var NUGET_SOURCES = EnvironmentVariable ("NUGET_SOURCES") ?? Argument ("nugetsources", string.Empty);;
if (!string.IsNullOrEmpty (NUGET_SOURCES)) {
buildSpec.NuGetSources = NUGET_SOURCES.Split (';',',').Select (ns => new NuGetSource { Url = ns }).ToArray ();
Information ("Using Nuget Sources:");
foreach (var nsrc in buildSpec.NuGetSources)
Information (" {0}", nsrc.Url);
}
Task ("externals")
.WithCriteria (() => !FileExists ("./externals/play-services-base.aar")).Does (() =>
{
var path = "./externals/";
if (!DirectoryExists (path))
CreateDirectory (path);
// Get the actual GPS .aar files and extract
if (!FileExists (path + "m2repository.zip"))
DownloadFile (M2_REPOSITORY, path + "m2repository.zip");
if (!FileExists (path + "m2repository/source.properties"))
Unzip (path + "m2repository.zip", path);
// Copy the .aar's to a better location
foreach (var aar in AAR_INFOS) {
CopyFile (
string.Format (path + "m2repository/com/google/{0}/{1}/{2}-{3}.aar", aar.Path, aar.AarVersion, aar.Dir, aar.AarVersion),
string.Format (path + "{0}.aar", aar.Dir));
Unzip (path + aar.Dir + ".aar", path + aar.Dir);
}
// Get Wearable stuff
Unzip (path + "m2repository/com/google/android/support/wearable/" + WEARABLE_SUPPORT_VERSION + "/wearable-" + WEARABLE_SUPPORT_VERSION + ".aar", path + "wearable-support");
CopyFile (path + "m2repository/com/google/android/wearable/wearable/" + WEAR_AAR_VERSION + "/wearable-" + WEAR_AAR_VERSION + ".jar", path + "wearable.jar");
// Get the GPS Docs
if (!FileExists (path + "docs.zip"))
DownloadFile (DOCS_URL, path + "docs.zip");
// Move the docs around
if (!DirectoryExists (path + "docs")) {
Unzip (path + "docs.zip", path);
CopyDirectory (path + "google-play-services/docs", path + "docs/");
DeleteDirectory (path + "google-play-services", true);
}
// Put the uitest.keystore in our artifacts for downstream jobs to use
EnsureDirectoryExists ("./output");
if (FileExists ("./uitest.keystore"))
CopyFile ("./uitest.keystore", "./output/uitest.keystore");
});
Task ("diff")
.IsDependentOn ("merge")
.WithCriteria (!IsRunningOnWindows ())
.Does (() =>
{
var SEARCH_DIRS = new FilePath [] {
MONODROID_PATH,
"/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/xbuild-frameworks/MonoAndroid/v1.0/",
"./cast/source/bin/Release/",
"./wearable/source/bin/Release/"
};
MonoApiInfo ("./output/GooglePlayServices.Merged.dll",
"./output/GooglePlayServices.api-info.xml",
new MonoApiInfoToolSettings { SearchPaths = SEARCH_DIRS });
// Grab the last public release's api-info.xml to use as a base to compare and make an API diff
DownloadFile (BASE_API_INFO_URL, "./output/GooglePlayServices.api-info.previous.xml");
// Now diff against current release'd api info
// eg: mono mono-api-diff.exe ./gps.r26.xml ./gps.r27.xml > gps.diff.xml
MonoApiDiff ("./output/GooglePlayServices.api-info.previous.xml",
"./output/GooglePlayServices.api-info.xml",
"./output/GooglePlayServices.api-diff.xml");
// Now let's make a purty html file
// eg: mono mono-api-html.exe -c -x ./gps.previous.info.xml ./gps.current.info.xml > gps.diff.html
MonoApiHtml ("./output/GooglePlayServices.api-info.previous.xml",
"./output/GooglePlayServices.api-info.xml",
"./output/GooglePlayServices.api-diff.html");
});
Task ("merge").IsDependentOn ("libs").Does (() =>
{
if (FileExists ("./output/GooglePlayServices.Merged.dll"))
DeleteFile ("./output/GooglePlayServices.Merged.dll");
// Clean up any existing old merge files
DeleteFiles ("./output/GooglePlayServices.Merged.dll");
var mergeDlls = GetFiles ("./output/*.dll");
ILRepack ("./output/GooglePlayServices.Merged.dll", mergeDlls.First(), mergeDlls.Skip(1), new ILRepackSettings {
CopyAttrs = true,
AllowMultiple = true,
//TargetKind = ILRepack.TargetKind.Dll,
Libs = new List<FilePath> {
MONODROID_PATH
},
});
});
Task ("clean").IsDependentOn ("clean-base").Does (() =>
{
if (FileExists ("./generated.targets"))
DeleteFile ("./generated.targets");
if (DirectoryExists ("./externals"))
DeleteDirectory ("./externals", true);
CleanDirectories ("./**/packages");
});
Task ("cleanwin").Does (() =>
{
if (FileExists ("./generated.targets"))
DeleteFile ("./generated.targets");
if (DirectoryExists ("./externals"))
DeleteDirectory ("./externals", true);
CleanDirectories ("./**/packages");
});
Task ("component-docs").Does (() =>
{
var gettingStartedTemplates = new Dictionary<string, string> ();
foreach (var f in GetFiles ("./component/GettingStarted.*.md")) {
var key = f.GetFilenameWithoutExtension ().FullPath.Replace ("GettingStarted.", "");
var val = TransformTextFile (f).ToString ();
gettingStartedTemplates.Add (key, val);
}
var componentDirs = GetDirectories ("./*");
foreach (var compDir in componentDirs)
Information ("Found: {0}", compDir);
foreach (var compDir in componentDirs) {
var f = compDir.CombineWithFilePath ("./component/GettingStarted.template.md");
if (!FileExists (f))
continue;
Information ("Transforming: {0}", compDir);
var apiLevel = compDir.FullPath.Contains (".Cast") ? "Android 4.2 (API Level 17)" : "Android 4.1 (API Level 16)";
var t = TransformTextFile (f, "{", "}");
foreach (var kvp in gettingStartedTemplates) {
var v = TransformText (kvp.Value, "{", "}").WithToken ("APILEVEL", apiLevel).ToString ();
t = t.WithToken (kvp.Key, v);
}
FileWriteText (compDir.CombineWithFilePath ("./component/GettingStarted.md"), t.ToString ());
}
var detailsTemplates = new Dictionary<string, string> ();
foreach (var f in GetFiles ("./component/Details.*.md")) {
var key = f.GetFilenameWithoutExtension ().FullPath.Replace ("Details.", "");
var val = TransformTextFile (f).ToString ();
detailsTemplates.Add (key, val);
}
foreach (var compDir in componentDirs) {
var f = compDir.CombineWithFilePath ("./component/Details.template.md");
if (!FileExists (f))
continue;
Information ("Transforming: {0}", compDir);
var t = TransformTextFile (f, "{", "}");
foreach (var kvp in detailsTemplates)
t = t.WithToken (kvp.Key, kvp.Value);
FileWriteText (compDir.CombineWithFilePath ("./component/Details.md"), t.ToString ());
}
});
Task ("component-setup").Does (() =>
{
var yamls = GetFiles ("./**/component/component.template.yaml");
foreach (var yaml in yamls) {
var NUGET_VERSION = PLAY_NUGET_VERSION;
var COMPONENT_VERSION = PLAY_COMPONENT_VERSION;
if (yaml.FullPath.Contains ("firebase-")) {
NUGET_VERSION = FIREBASE_NUGET_VERSION;
COMPONENT_VERSION = FIREBASE_COMPONENT_VERSION;
}
var manifestTxt = FileReadText (yaml)
.Replace ("$nuget-version$", NUGET_VERSION)
.Replace ("$version$", COMPONENT_VERSION)
.Replace ("$wear-version$", WEAR_COMPONENT_VERSION)
.Replace ("$wear-nuget-version$", WEAR_NUGET_VERSION);
var newYaml = yaml.GetDirectory ().CombineWithFilePath ("component.yaml");
FileWriteText (newYaml, manifestTxt);
}
if (DirectoryExists ("./output"))
DeleteFiles ("./output/*.xam");
});
Task ("component").IsDependentOn ("component-docs").IsDependentOn ("component-setup").IsDependentOn ("component-base");
Task ("nuget-setup").IsDependentOn ("buildtasks").Does (() => {
var templateText = FileReadText ("./template.targets");
if (FileExists ("./generated.targets"))
DeleteFile ("./generated.targets");
// Get the zip file offsets for the relevant aar's
var downloadParts = FindZipEntries ("./externals/m2repository.zip")
.Where (e => (e.EntryName.Contains (PLAY_AAR_VERSION) || e.EntryName.Contains (WEAR_AAR_VERSION))
&& (e.EntryName.Contains (".aar") || e.EntryName.Contains (".jar")))
.Select (e => new PartialZipInfo {
RangeStart = e.RangeStart,
RangeEnd = e.RangeEnd,
Url = M2_REPOSITORY,
LocalPath = e.EntryName,
Md5 = ReadZipEntryText ("./externals/m2repository.zip", e.EntryName + ".md5", readBinaryAsHex: !e.EntryName.Contains ("wearable-" + WEAR_AAR_VERSION + ".aar"))
}).ToList ();
foreach (var aar in AAR_INFOS) {
// Write out the nuspec from template
var nuspec = new FilePath ("./" + aar.BindingDir + "/nuget/" + aar.NugetId + ".template.nuspec");
var nuspecTxt = FileReadText (nuspec).Replace ("$aar-version$", VERSION_DESC);
var newNuspec = nuspec.FullPath.Replace (".template.nuspec", ".nuspec");
FileWriteText (newNuspec, nuspecTxt);
// Write out the .targets
var part = downloadParts.FirstOrDefault (p => p.LocalPath.EndsWith ("/" + aar.Dir + "-" + aar.AarVersion + ".aar"));
if (part == null)
throw new Exception ("No matching part found for '" + aar.Dir + "-" + aar.AarVersion + "' in partial-download-info.json ");
var msName = aar.Dir.Replace("-", "");
var xbdKey = "playservices-" + PLAY_AAR_VERSION + "/" + msName;
if (aar.Dir.StartsWith ("firebase-"))
xbdKey = "firebase-" + FIREBASE_AAR_VERSION + "/" + msName;
var items = new Dictionary<string, string> {
{ "_XbdUrl_", "_XbdUrl_" + msName },
{ "_XbdKey_", "_XbdKey_" + msName },
{ "_XbdAarFile_", "_XbdAarFile_" + msName },
{ "_XbdAarFileInSdk_", "_XbdAarFileInSdk_" + msName },
{ "_XbdAssemblyName_", "_XbdAssemblyName_" + msName },
{ "_XbdAarFileFullPath_", "_XbdAarFileFullPath_" + msName },
{ "_XbdRestoreItems_", "_XbdRestoreItems_" + msName },
{ "$XbdUrl$", M2_REPOSITORY },
{ "$XbdMd5$", part.Md5 },
{ "$XbdKey$", xbdKey },
{ "$XbdAssemblyName$", aar.NugetId },
{ "$XbdRangeStart$", part.RangeStart.ToString() },
{ "$XbdRangeEnd$", part.RangeEnd.ToString() },
{ "$AarKey$", aar.Dir },
{ "$AarVersion$", aar.AarVersion },
{ "$AarInnerPath$", aar.Path.Replace ("/", "\\") },
};
var targetsText = templateText;
foreach (var kvp in items)
targetsText = targetsText.Replace (kvp.Key, kvp.Value);
var targetsFile = new FilePath (string.Format ("{0}/nuget/{1}.targets", aar.BindingDir, aar.NugetId));
FileWriteText (targetsFile, targetsText);
// Merge each generated targets file into one main one
// this makes one file to import into our actual binding projects
// which is much easier/less maintenance
if (!FileExists ("./generated.targets"))
FileWriteText ("./generated.targets", "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n</Project>");
// Load the doc to append to, and the doc to append
var xFileRoot = System.Xml.Linq.XDocument.Load ("./generated.targets");
System.Xml.Linq.XNamespace nsRoot = xFileRoot.Root.Name.Namespace;
var xFileChild = System.Xml.Linq.XDocument.Load (MakeAbsolute (targetsFile).FullPath);
System.Xml.Linq.XNamespace nsChild = xFileRoot.Root.Name.Namespace;
// Add all the elements under <Project> into the existing file's <Project> node
foreach (var xItemToAdd in xFileChild.Element (nsChild + "Project").Elements ())
xFileRoot.Element (nsRoot + "Project").Add (xItemToAdd);
// Inject a property to prevent errors from missing assemblies in .targets
// this allows us to use one big .targets file in all the projects and not have to figure out which specific
// ones each project needs to reference for development purposes
if (!xFileRoot.Descendants (nsRoot + "XamarinBuildResourceMergeThrowOnMissingAssembly").Any ()) {
xFileRoot.Element (nsRoot + "Project")
.AddFirst (new System.Xml.Linq.XElement (nsRoot + "PropertyGroup",
new System.Xml.Linq.XElement (nsRoot + "XamarinBuildResourceMergeThrowOnMissingAssembly", false)));
}
xFileRoot.Save ("./generated.targets");
// Check for an existing .targets file in this nuget package
// we need to merge the generated one with it if it exists
// nuget only allows one automatic .targets file in the build/ folder
// of the nuget package, which must be named {nuget-package-id}.targets
// so we need to merge them all into one
var mergeFile = new FilePath (aar.BindingDir + "/nuget/merge.targets");
if (FileExists (mergeFile)) {
Information ("merge.targets found, merging into generated file...");
// Load the doc to append to, and the doc to append
var xOrig = System.Xml.Linq.XDocument.Load (MakeAbsolute(targetsFile).FullPath);
System.Xml.Linq.XNamespace nsOrig = xOrig.Root.Name.Namespace;
var xMerge = System.Xml.Linq.XDocument.Load (MakeAbsolute(mergeFile).FullPath);
System.Xml.Linq.XNamespace nsMerge = xMerge.Root.Name.Namespace;
// Add all the elements under <Project> into the existing file's <Project> node
foreach (var xItemToAdd in xMerge.Element (nsMerge + "Project").Elements ())
xOrig.Element (nsOrig + "Project").Add (xItemToAdd);
xOrig.Save (MakeAbsolute (targetsFile).FullPath);
}
}
var extraNuspecTemplates = new [] {
new FilePath ("./appindexing/nuget/Xamarin.GooglePlayServices.AppIndexing.template.nuspec"),
};
foreach (var nuspec in extraNuspecTemplates) {
var nuspecTxt = FileReadText (nuspec).Replace ("$aar-version$", VERSION_DESC);
var newNuspec = nuspec.FullPath.Replace (".template.nuspec", ".nuspec");
FileWriteText (newNuspec, nuspecTxt);
}
});
Task ("nuget").IsDependentOn ("nuget-setup").IsDependentOn ("nuget-base").IsDependentOn ("libs");
Task ("libs").IsDependentOn ("nuget-setup").IsDependentOn ("genapi").IsDependentOn ("libs-base");
Task ("genapi").IsDependentOn ("libs-base").IsDependentOn ("externals").Does (() => {
var GenApiToolPath = GetFiles ("./tools/**/GenAPI.exe").FirstOrDefault ();
// For some reason GenAPI.exe can't handle absolute paths on mac/unix properly, so always make them relative
// GenAPI.exe -libPath:$(MONOANDROID) -out:Some.generated.cs -w:TypeForwards ./relative/path/to/Assembly.dll
var libDirPrefix = IsRunningOnWindows () ? "output/" : "";
var libs = new FilePath [] {
"./" + libDirPrefix + "Xamarin.Firebase.AppIndexing.dll",
};
foreach (var lib in libs) {
var genName = lib.GetFilename () + ".generated.cs";
var libPath = IsRunningOnWindows () ? MakeAbsolute (lib).FullPath : lib.FullPath;
var monoDroidPath = IsRunningOnWindows () ? "\"" + MONODROID_PATH + "\"" : MONODROID_PATH;
Information ("GenAPI: {0}", lib.FullPath);
StartProcess (GenApiToolPath, new ProcessSettings {
Arguments = string.Format("-libPath:{0} -out:{1}{2} -w:TypeForwards {3}",
monoDroidPath + "," + MSCORLIB_PATH,
IsRunningOnWindows () ? "" : "./",
genName,
libPath),
WorkingDirectory = "./output/",
});
}
DotNetBuild ("./GooglePlayServices.TypeForwarders.sln", c => c.Configuration = BUILD_CONFIG);
CopyFile ("./appindexing/source/bin/" + BUILD_CONFIG + "/Xamarin.GooglePlayServices.AppIndexing.dll", "./output/Xamarin.GooglePlayServices.AppIndexing.dll");
});
Task ("buildtasks").Does (() =>
{
NuGetRestore ("./basement/buildtasks/Basement-BuildTasks.csproj");
DotNetBuild ("./basement/buildtasks/Basement-BuildTasks.csproj", c => c.Configuration = "Release");
CopyFile ("./basement/buildtasks/bin/Release/Xamarin.GooglePlayServices.Basement.targets", "./basement/nuget/merge.targets");
});
SetupXamarinBuildTasks (buildSpec, Tasks, Task);
RunTarget (TARGET);