Skip to content

Podfile generation doesn't reproduce dependency tree #599

Open
@adil-hussain-84

Description

@adil-hussain-84

I have two Java modules in my project that I'm running through the Gradle J2ObjC translation task. One is my SharedCode module that I want to be translated and made available to both the RetailSDK and RetailSDKTests targets in my iOS workspace. The other is a TestContracts module that I want to be translated and made available to the RetailSDKTests target in my iOS workspace only. Additionally, the TestContracts module has a dependency on the SharedCode module.

In order to achieve the above, the build.gradle file of my SharedCode module is as follows:

plugins {
    id 'java'
    id 'com.github.j2objccontrib.j2objcgradle' version '0.6.0-alpha'
}

dependencies {
    compile 'com.google.guava:guava:18.0'
    testCompile 'junit:junit:4.12'
    testCompile 'org.hamcrest:hamcrest-core:1.3'
}

j2objcConfig {
    autoConfigureDeps true
    minVersionIos '8.4'
    supportedArchs += ['ios_i386']
    translateArgs '--no-package-directories'
    translateArgs '--prefixes', 'prefixes.properties'
    xcodeProjectDir '../iOS'
    xcodeTargetsIos 'RetailSDK', 'RetailSDKTests'
    finalConfigure()
}

And the build.gradle file of my TestContracts module is as follows:

plugins {
    id 'java'
    id 'com.github.j2objccontrib.j2objcgradle' version '0.6.0-alpha'
}

dependencies {
    compile project(':SharedCode')
    compile 'junit:junit:4.12' // this is compile scope deliberately
    compile 'org.hamcrest:hamcrest-core:1.3' // this is compile scope deliberately
}

j2objcConfig {
    autoConfigureDeps true
    minVersionIos '8.4'
    supportedArchs += ['ios_i386']
    translateArgs '--no-package-directories'
    translateArgs '--prefixes', 'prefixes.properties'
    xcodeProjectDir '../iOS'
    xcodeTargetsIos 'RetailSDKTests'
    finalConfigure()
}

Based on the above, on building my project I would expect the contents of my Podfile to be the following:

target 'RetailSDK' do
    platform :ios, '8.4'
    j2objc_SharedCode
    import_other_pods
end

target 'RetailSDKTests' do
    platform :ios, '8.4'
    j2objc_TestContracts
    j2objc_SharedCode
    import_other_pods
end

However, what I see is this:

target 'RetailSDK' do
    import_other_pods
end

target 'RetailSDKTests' do
    platform :ios, '8.4'
    j2objc_TestContracts
    j2objc_SharedCode
    import_other_pods    
end

Can anyone see what I'm doing wrong in my build.gradle files which makes the output of the J2ObjC translation not be added to the RetailSDK target?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions