ATNASGDWNGTH
ATNASGDWNGTH

Reputation: 876

How to load a specific build.gradle/gradle.properties for default build process

I have three build.gradle with different name under the same directory

I have 4 issues

  1. "gradle build" will just use build.gradle only to start the java plugin build task, but "gradle -b dev.build.gradle" will not start the java plugin build task
  2. gradle --help seems not having an option to load a specific gradle.properties. There is another way that creating three directories(dev, uat, prd) under the project root and putting a responding build.gradle version in it. finally, start the java plugin build process. I dont like this because I just want build.gradle or gradle.properties files in the same directory
  3. how to copy files in gradle without explicitly specify task name in the command line(gradle build copy).

Upvotes: 0

Views: 1368

Answers (1)

Peter Niederwieser
Peter Niederwieser

Reputation: 123960

ad 1. The correct command is gradle -b dev.build.gradle build. ad 2. If you want to use properties files other than build.gradle, you'll have to do it on your own (e.g. using the java.util.Properties class). There is also a third-party properties plugin. ad 3. This doesn't seem to be a question. ad 4. You should turn this into a separate question.

Upvotes: 0

Related Questions