Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle build: does someone tried alternative build script with alternative setting.gradle?

I am using gradle 1.4, and renamed a build.gradle to buildExpr.gradle and settings.gradle to settingExpr.gradle, both files are in the project root, and I am using following command to run gradle build.

'gradle C:\myProject>gradle -i -b buildExpr.gradle -c settingsExpr.gradle project'

it seems command line option '-c' is not being honored and gradle is not picking settingsExpr.gradle file, hence it is not able to display all modules defined in settings.gradle file while executing project task.

I am getting following log -------------------------------------LOG---------------------------------------------------- C:\ASM\asm_workspace\asm71\AutoLab>gradle -i -c settingsExpr.gradle -b buildExpr.gradle project Starting Build Settings evaluated using empty settings script. Projects loaded. Root project using build file 'C:\ASM\asm_workspace\asm71\AutoLab\buildExpr.gradle'. Included projects: [root project 'AutoLab'] Evaluating root project 'AutoLab' using build file 'C:\ASM\asm_workspace\asm71\AutoLab\buildExpr.gradle'. All projects evaluated. Selected primary task 'projects' Tasks to be executed: [task ':projects'] :projects


Root project


Root project 'AutoLab' No sub-projects


it is very strange behavior by gradle command line shows. but if I change buildExpr.gradle to build.gradle and settingsExpr.gradle to settings.gradle, it executes normally and shows all sub-modules in log

like image 684
Ravendra Avatar asked Jan 27 '26 19:01

Ravendra


1 Answers

-b and -c can't be used together. When using a settings file, everything else (e.g. the locations of build files) is determined from the settings file.

like image 142
Peter Niederwieser Avatar answered Jan 30 '26 13:01

Peter Niederwieser



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!