How to pass arguments from Gradle build to ant target in subdir (not child project)

My file structure is the following:
root project

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(){[‘target_env’] =[‘tDir’] =

And I received null value for both ant properties. What’s the correct way of doing this?