The JarJarFeature provides a method to disable inheriting classes from the main jar.
However, as enable() uses findByPath (rather than named), this means that it's very easily to accidentally cause the jarJar task to be prematurely configured, and in turn causing disableDefaultSources to silently no-op.
For instance, none of the following will work:
jarJar {
enable()
disableDefaultSources()
}
dependencies { jarJar(libs.fooBar) } // Causes jarJar to be enabled.
jarJar.disableDefautSources()
This can be worked around by moving jarJar.disableDefautSources() further up the build script. However, it would be nice if either:
- This worked by default OR
- This didn't silently fail.
The
JarJarFeatureprovides a method to disable inheriting classes from the main jar.However, as
enable()usesfindByPath(rather thannamed), this means that it's very easily to accidentally cause thejarJartask to be prematurely configured, and in turn causingdisableDefaultSourcesto silently no-op.For instance, none of the following will work:
jarJar { enable() disableDefaultSources() }dependencies { jarJar(libs.fooBar) } // Causes jarJar to be enabled. jarJar.disableDefautSources()This can be worked around by moving
jarJar.disableDefautSources()further up the build script. However, it would be nice if either: