Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extracting resources from source jars #607

Open
lavapatch opened this issue Mar 21, 2016 · 1 comment
Open

Extracting resources from source jars #607

lavapatch opened this issue Mar 21, 2016 · 1 comment

Comments

@lavapatch
Copy link

My gradle project publishes both sources.jar and test-sources.jar to a maven repo alongside my shared library. However, j2objc-gradle ignores data files required to run some of the unit tests.

I've verified that the resources are packaged in the test-sources.jar file but the testTranslationExtraction folder only contains .java files and the resources subfolders but not the data files themselves ( which happen to be .json files)

I've noticed that the visitTranslationSourceJar method only extracts *.java files. Is this the reason?

See below for the build.gradle file. If the j2objcTestTranslation 'com.sample.demo:processor:0.1.2:test-sources' line is commented out the translation runs successfully but I dont get the assurance of the tests.

Am I missing something?

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

sourceCompatibility = 1.7
targetCompatibility = 1.7

repositories {
    mavenLocal()
    jcenter()
}

dependencies {
    compile 'com.google.guava:guava:18.0'
    compile 'org.slf4j:slf4j-api:1.7.13'
    testCompile 'junit:junit:4.11'
    testCompile project(':third-party-gson')

    // j2objcTranslation causes the entire specified library
    // to be translated and built into a standalone Objective C library.
    // j2objcTranslation must always be passed a *source* jar,
    // therefore, note the ':sources' classifier.
    j2objcTranslation 'com.sample.demo:processor:0.1.2:sources'

    j2objcTestTranslation 'com.sample.demo:processor:0.1.2:test-sources'
}


j2objcConfig {
    // Sets up libraries you depend on
    autoConfigureDeps true

    testMinExpectedTests 0

    // Omit these two lines if you don't configure your Xcode project with CocoaPods
    xcodeProjectDir '../ios'  //  suggested directory name
    xcodeTargetsIos 'SampleProj', 'SampleProjTests'  // replace with your iOS targets

    finalConfigure()          // Must be last call to configuration
}
@manishval
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants