Gradle 1.12 to 4.0: GradleLauncher is no more

Hi all!

I’m new to Gradle and I need to upgrade from 1.12 to 4.0. The main problem I have is that we used GradleLauncher to get some input from the user during the instalation of our application, and we used these inputs as parameters to call another scripts; but it seens GradleLauncher is not present in 4.0, instead we have a Tooling API… But that’s a lot to change, I know…

My first question is: how to use the Tooling API to read some input from the users (ex.: jndi name, database user, log directory, etc.), save these inputs, pass them as parameters to call another scripts and use them?

Thanks in advance!

For example I have the following lines of code in my installer.gradle:

def gradleInstanceInstall = org.gradle.GradleLauncher.newInstance(installInternalWrapper.startParameter)
gradleInstanceInstall.startParameter.logLevel = LogLevel.LIFECYCLE
gradleInstanceInstall.startParameter.offline = true

def gradleInstanceWeb = org.gradle.GradleLauncher.newInstance(buildToExecute.startParameter)

def instance = org.gradle.GradleLauncher.newInstance(prepararScriptsParaSeremAplicadosInstaller.startParameter)

How can I convert those to the new 4.0 Tooling API?

There are some samples here:

And we also have the GradleBuild task that allows you to run a Gradle build and depend on it:

The samples are really, really poor, sorry, they do not demonstrate a lot of the features. For example how to use start parameters.

Right now that’s the entire problem I have: I cannot pass a org.gradle.StartParameter to a org.gradle.tooling.BuildLauncher