My file structure is the following:
root project
build.gradle
src
build/release/subdir
build.gradle
build.xml
src
subdir contains an Ant project and the root project uses Gradle, and subdir is not part of the multiproject setup. I have imported build.xml to build.gradle in subdir and am able to call the Ant target from root project. However the Ant target requires two parameters to be passed when called. And I am having trouble using StartParameter to correctly pass the arguments. Below is what I have:
in root project:
task buildQ(type: GradleBuild){
dependsOn setTargetEnv
buildFile = './build/release/Q/build.gradle’
tasks = [‘Qbuild’]
startParameter.setProjectProperties(‘target_env’, “prod”)
startParameter.setProjectProperties(‘tDir’, “…/…/…”)
}
in subdir:
Qbuild(){
ant.properties[‘target_env’] = project.properties.target_env
ant.properties[‘tDir’] = project.properties.tDir
}
And I received null value for both ant properties. What’s the correct way of doing this?