My project structure is:

enter image description here

I want user additionally to configure the build using some of the build scripts from specifications dir but the main build script to be used to configure the project as well. Using -b option give the ability to specify another build scrpt different from the default one, but I want this default one to be executed as well. I don't want to use apply from: and to add all scripts because user have to decide what he wants.

So is there a way to tell Gradle to add additional build script - command line with which to configure extra the Project?

有帮助吗?

解决方案

If you need this this, you could do something like this:

apply from: "config/specifications/${project.spec}.gradle"

which would then allow users to do e.g.

./gradlew -P spec=example

See https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_properties_and_system_properties for more details on setting project properties from the command line.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top