Skip to content

Commit

Permalink
Small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
modmuss50 committed Mar 22, 2024
1 parent ab06c35 commit 7175184
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ class ConfigurationCacheTest extends Specification implements GradleProjectTestT
}
""".stripIndent()
when:
def result = gradle.run(task: task, args: ["--configuration-cache"])
def result2 = gradle.run(task: task, args: ["--configuration-cache"])
def result = gradle.run(task: task, configurationCache: true, isloatedProjects: false)
def result2 = gradle.run(task: task, configurationCache: true, isloatedProjects: false)
then:
result.task(":${task}").outcome != FAILED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ import net.fabricmc.loom.util.Constants
import net.fabricmc.loom.util.ZipUtils

trait GradleProjectTestTrait {
// Set to enable configuration cache for all tests
public static boolean ENABLE_CONFIGURATION_CACHE = System.getenv("LOOM_TEST_CONFIGURATION_CACHE") != null

@Lazy
@Shared
private static File sharedProjectDir = File.createTempDir()
Expand Down Expand Up @@ -166,6 +169,14 @@ trait GradleProjectTestTrait {
args << options.task
}

if (options.configurationCache || ENABLE_CONFIGURATION_CACHE) {
args << "--configuration-cache"
}

if (options.isloatedProjects) {
args << "-Dorg.gradle.unsafe.isolated-projects=true"
}

args.addAll(options.tasks ?: [])

args << "--stacktrace"
Expand Down

0 comments on commit 7175184

Please sign in to comment.