You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Why is my clean build failing?](#why-is-my-clean-build-failing)
33
33
-[How do I include Java files from additional source directories?](#how-do-i-include-java-files-from-additional-source-directories)
34
34
-[How do I develop with Swift?](#how-do-i-develop-with-swift)
35
+
-[How do I manually configure the Cocoapods Podfile?](#how-do-i-manually-configure-the-cocoapods-podfile)
35
36
-[How do I manually configure my Xcode project to use the translated libraries?](#how-do-i-manually-configure-my-xcode-project-to-use-the-translated-libraries)
36
37
-[How do I update my J2ObjC translated code from Xcode?](#how-do-i-update-my-j2objc-translated-code-from-xcode)
37
38
-[How do I work with Package Prefixes?](#how-do-i-work-with-package-prefixes)
@@ -254,6 +255,7 @@ with `translateArgs`.
254
255
Make sure your arguments are separate strings, not a single space-concatenated string.
255
256
256
257
```gradle
258
+
// File: shared/build.gradle
257
259
j2objcConfig {
258
260
// CORRECT
259
261
translateArgs '-use-arc'
@@ -302,6 +304,7 @@ For example, if you want to include files from `src-gen/base` both into your JAR
302
304
your Objective C libraries, then add to your `shared/build.gradle`:
303
305
304
306
```gradle
307
+
// File: shared/build.gradle
305
308
sourceSets {
306
309
main {
307
310
java {
@@ -333,6 +336,57 @@ you'd like to access from Swift code.
333
336
```
334
337
335
338
339
+
### How do I manually configure the Cocoapods Podfile?
340
+
341
+
The plugin will try to automatically update the Cocoapods Podfile but that may fail if
342
+
the Podfile is too complex. In that situation, you can manually configure the pod method.
343
+
344
+
```gradle
345
+
// File: shared/build.gradle
346
+
j2objcConfig {
347
+
xcodeTargetsManualConfig true
348
+
...
349
+
}
350
+
```
351
+
352
+
The "pod method" definition will still be added automatically (e.g.
353
+
`def j2objc_shared...`). However, the "pod method" will not be added to any
354
+
targets, so that needs to be done manually. See example of the Podfile below:
355
+
356
+
```
357
+
// File: ios/Podfile
358
+
...
359
+
360
+
# J2ObjC Gradle Plugin - PodMethods - DO NOT MODIFY START - can be moved as a block
361
+
def j2objc_shared
362
+
pod 'j2objc-shared-debug', :configuration => ['Debug'], :path => '../shared/build/j2objcOutputs'
363
+
pod 'j2objc-shared-release', :configuration => ['Release'], :path => '../shared/build/j2objcOutputs'
364
+
end
365
+
# J2ObjC Gradle Plugin - PodMethods - DO NOT MODIFY END
366
+
367
+
<SOME COMPLEX RUBY>
368
+
...
369
+
# NOTE: this line must be added manually for the relevant targets:
370
+
j2objc_shared
371
+
...
372
+
end
373
+
```
374
+
375
+
To disable all modifications of the Podfile, disable the `j2objcXcode` task.
376
+
This will also skip the `pod install` step. The podspec files will still
377
+
be written (done by the `j2objcPodspec` task).
378
+
379
+
```gradle
380
+
// File: shared/build.gradle
381
+
j2objcConfig {
382
+
...
383
+
}
384
+
j2objcXcode {
385
+
enabled = false
386
+
}
387
+
```
388
+
389
+
336
390
### How do I manually configure my Xcode project to use the translated libraries?
337
391
338
392
Using CocoaPods is the quickest way to use the plugin. To configure Xcode manually,
0 commit comments