Slackbot
04/29/2022, 7:34 PMdaniel
04/30/2022, 11:41 AMwithEnvironmen() API is in use, internally Gradle has to fork a Gradle daemon to ensure the environment variable are properly configured. There are two things to be mindful here: 1) make sure you configure the project directory (https://docs.gradle.org/current/javadoc/org/gradle/testkit/runner/GradleRunner.html#withProjectDir-java.io.File-) and 2) you should always specify the working directory in your ExecSpec when it is important. In this case, you wish to run chmod in the projectDir so the ExecSpec should be configured as such:
tasks.register('exec', Exec) {
commandLine 'chmod'
workingDir projectDir
}Andrew Lethbridge
04/30/2022, 11:44 AMAndrew Lethbridge
05/02/2022, 1:04 AMdaniel
05/02/2022, 1:55 PM