j2objc-contrib / j2objc-gradle

This plugin is no longer actively maintained. J2ObjC Gradle Plugin: enables Java source to be part of an iOS application's build so you can write an app's non-UI code (such as application logic and data models) in Java, which is then shared by Android apps (natively Java) and iOS apps (using J2ObjC), all as part of your usual Android Gradle build.
https://github.com/j2objc-contrib/j2objc-gradle
Apache License 2.0
139 stars 43 forks source link

Podfile configurations customization #588

Closed danieldickison closed 8 years ago

danieldickison commented 8 years ago

Instead of the current hardcoded :configuration => ['Debug'] and :configuration => ['Release'], it would be nice if these configuration names were customizable. We have a separate configuration for beta releases on HockeyApp and my current workaround is to edit the Podfile so the j2objc method includes :configuration => ['Release', 'Preview']

I think this would go somewhere around here (but I'm not very familiar with groovy): https://github.com/j2objc-contrib/j2objc-gradle/blob/459d2c70a8fbabc26a440cc3ad284d7d0bf7758e/src/main/groovy/com/github/j2objccontrib/j2objcgradle/tasks/XcodeTask.groovy#L487

brunobowden commented 8 years ago

@danieldickison - this sounds reasonable. You're pointing to an old version of the code from October so best to use something more current. For example:

https://github.com/j2objc-contrib/j2objc-gradle/blob/master/src/main/groovy/com/github/j2objccontrib/j2objcgradle/tasks/XcodeTask.groovy#L669

To do this, you'll need to add something to J2objcConfig.groovy to allow someone to specify the configurations:

List<String> podfileDebugConfigurations = ['Debug']
List<String> podfileReleaseConfigurations = ['Release']

Please add the following example to both the J2objcConfig.groovy comments AND the FAQ:

j2objcConfig {
    podfileReleaseConfigurations += ['Preview']
    ...
}

Within XcodeTask.groovy, you need to add reading of the config around line 91 (see prior lines). Then at line 669, print the array with "[${podfileReleaseConfigurations.join(',')}]" and update the unit tests.

Send me the PR and I'll take a look. This should be pretty straight forward.

Bruno

brunobowden commented 8 years ago

Add the configuration to line 728 in J2objcConfig.groovy.

danieldickison commented 8 years ago

Thanks for the pointers. Just created pull request #590 with your suggested changes.

danieldickison commented 8 years ago

Fixed in #590