Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow creating a GradleRunner without specifying the working directory #37

Open
lacasseio opened this issue Feb 12, 2021 · 1 comment
Open
Labels
enhancement New feature or request in:runner-kit

Comments

@lacasseio
Copy link
Member

At the moment, we always have to specify a working directory or else the execution fails because of an assertion. We should make our best to provide a temporary directory by default which is deleted upon process exits (deleteOnExits()).

The issue right now is you can quickly create a runner but the API doesn't make it obvious the working directory is required leading to runtime errors. It's more of an annoyance than anything else.

@lacasseio lacasseio added enhancement New feature or request in:runner-kit labels Feb 12, 2021
@lacasseio
Copy link
Member Author

Before we can make this useful, we will need a model for build script which we can pass to the methods such as usingBuildScript/usingSettingsFile/usingInitScript. With that, we could run Gradle as follow:

GradleRunner.create(gradleTestKit()).usingBuildScript(this::myBuildDotGradleSupplier).withTasks('build').build()

The runner would create an empty settings.gradle, create a temporary working directory that would be deleted on exit and generate the build.gradle file inside the working directory when the runner executes. We can imagine usingBuildScript and co. taking a Consumer that configures a builder for the build script model itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request in:runner-kit
Projects
None yet
Development

No branches or pull requests

1 participant