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
gradleInstanceInstall.run().rethrowFailure()

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

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

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

There are some samples here: https://github.com/gradle/gradle/tree/master/subprojects/docs/src/samples/toolingApi

And we also have the GradleBuild task that allows you to run a Gradle build and depend on it:
https://docs.gradle.org/current/dsl/org.gradle.api.tasks.GradleBuild.html

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