我想根据项目的 settings.gradle 中定义的自定义设置有条件地构建我的 Java 库的一些功能。
例子:
构建.gradle
apply plugin: 'java'
sourceCompatibility = 1.7
repositories {
mavenCentral()
}
sourceSets {
extra_feature
}
dependencies {
compile 'net.java.dev.jna:jna:4.1.0'
}
// I need a way to link the "extra_feature" sourceSets to the default "build" action based on some settings in settings.gradle.
设置.gradle
extraFeatures = true