File tree Expand file tree Collapse file tree 2 files changed +25
-6
lines changed Expand file tree Collapse file tree 2 files changed +25
-6
lines changed Original file line number Diff line number Diff line change @@ -348,6 +348,25 @@ The `CocoaPods` are either:
348
348
The resolution strategy can be changed via the
349
349
` Assets > Play Services Resolver > iOS Resolver > Settings ` menu.
350
350
351
+ ### Appending text to generated Podfile
352
+ In order to modify the generated Podfile you can create a script like this:
353
+ ```
354
+ using System.IO;
355
+ public class PostProcessIOS : MonoBehaviour {
356
+ [PostProcessBuildAttribute(45)]//must be between 40 and 50 to ensure that it's not overriden by Podfile generation (40) and that it's added before "pod install" (50)
357
+ private static void PostProcessBuild_iOS(BuildTarget target, string buildPath)
358
+ {
359
+ if (target == BuildTarget.iOS)
360
+ {
361
+
362
+ using (StreamWriter sw = File.AppendText(buildPath + "/Podfile"))
363
+ {
364
+ //in this example I'm adding an app extension
365
+ sw.WriteLine("\ntarget 'NSExtension' do\n pod 'Firebase/Messaging', '6.6.0'\nend");
366
+ }
367
+ }
368
+ }
369
+ ```
351
370
# Version Handler Usage
352
371
353
372
The Version Handler component of this plugin manages:
Original file line number Diff line number Diff line change @@ -388,12 +388,12 @@ protected override bool Read(string filename, Logger logger) {
388
388
new SortedDictionary < string , Pod > ( ) ;
389
389
390
390
// Order of post processing operations.
391
- private const int BUILD_ORDER_REFRESH_DEPENDENCIES = 1 ;
392
- private const int BUILD_ORDER_CHECK_COCOAPODS_INSTALL = 2 ;
393
- private const int BUILD_ORDER_PATCH_PROJECT = 3 ;
394
- private const int BUILD_ORDER_GEN_PODFILE = 4 ;
395
- private const int BUILD_ORDER_INSTALL_PODS = 5 ;
396
- private const int BUILD_ORDER_UPDATE_DEPS = 6 ;
391
+ private const int BUILD_ORDER_REFRESH_DEPENDENCIES = 10 ;
392
+ private const int BUILD_ORDER_CHECK_COCOAPODS_INSTALL = 20 ;
393
+ private const int BUILD_ORDER_PATCH_PROJECT = 30 ;
394
+ private const int BUILD_ORDER_GEN_PODFILE = 40 ;
395
+ private const int BUILD_ORDER_INSTALL_PODS = 50 ;
396
+ private const int BUILD_ORDER_UPDATE_DEPS = 60 ;
397
397
398
398
// This is appended to the Podfile filename to store a backup of the original Podfile.
399
399
// ie. "Podfile_Unity".
You can’t perform that action at this time.
0 commit comments