Why declared immuables library style in package-info.java doesn't apply for subpackages in java 9 project?

252 Views Asked by At

Please see https://github.com/originalrusyn/java9_immutables for more details

So, the following config works correctly with sourceCompatibility = 1.8

p.package-info.java

@Value.Style(
    defaults = @Value.Immutable(copy = false),
    strictBuilder = true,
    overshadowImplementation = true,
    implementationNestedInBuilder = true
)
package p;

import org.immutables.value.Value;

build.gradle

buildscript {
    ext {
        immutablesVersion = '2.5.6'
    }
    repositories {
        mavenCentral()
        maven { url "https://plugins.gradle.org/m2/" }
    }
    dependencies {
        classpath "net.ltgt.gradle:gradle-apt-plugin:0.13"
    }
}

group 'java9'
version '1.0-SNAPSHOT'

apply plugin: 'java'
apply plugin: 'net.ltgt.apt'

sourceCompatibility = 1.9

repositories {
    mavenCentral()
}

sourceSets {
    main
    generated
    test
}

compileJava {
    generatedSourcesDestinationDir = "$projectDir/src/generated/java"
}

task wrapper(type: Wrapper) {
    gradleVersion = '4.4'
}

dependencies {
    apt "org.immutables:value:${immutablesVersion}"

    compileOnly "org.immutables:value:${immutablesVersion}:annotations"

    testCompile group: 'junit', name: 'junit', version: '4.12'
}

p.b.B.java

package p.b;

import org.immutables.value.Value;

@Value.Immutable
public interface B {

    String getText();
}

Why does it produce p.b.ImmutableB.java rather than p.b.BBuilder.java for sourceCompatibility=1.9?

0

There are 0 best solutions below