bootClasspath question -- multiple source/target_compatibility?


(Corey Brenner) #1

Hello,

I am trying to configure a project which generates sources in multiple configurations (j2se and android, and in a couple variants thereupon).

My script takes parameters and automatically sets up sourceSets {} and so on.

All this works, except that I need source_compatibility and target_compatibility = 1.6 for the Android runtime we target.

The only documentation I’ve been able to find on this subject seems to indicate that you’ll set bootClasspath for ALL invocations of the Java compiler.

How can I say: Only this sourceSet { sources_for_variant { /this one/ } } should carry a different bootClasspath?

I’d like to see:

sourceSets {
    android_variant_0 {
        ...
        sourceCompatibility = 1.6 // these work okay
        targetCompatibility = 1.6
        ...
        // I want to see the below work.
        bootClasspath += "$ANDROID_SDK/platforms/android-21/android.jar"
        // ... because I can do this, which seems analogous:
        compileClasspath += "$something_else"
    }