Skip to content

Commit

Permalink
Fix Gradle file usage
Browse files Browse the repository at this point in the history
Gradle recommends to use the file DSL method instead of
directly opening files by Groovy/Java constructors
in build scripts.
  • Loading branch information
ascheman committed Feb 2, 2024
1 parent 14694d1 commit 318bc16
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ configure(subprojects) {
maven {
name = 'myLocalRepositoryForFullIntegrationTests'
//noinspection GrDeprecatedAPIUsage
url = new File(project.parent.buildDir, "maven-repo")
File baseDir = file(project.parent.buildDir)
url = new File (baseDir, "maven-repo")
}
mavenLocal()
}
Expand Down Expand Up @@ -102,7 +103,8 @@ tasks.register("integrationTest") {
commandLine "./gradlew", "clean", "htmlSanityCheck", "-PhtmlSanityCheckVersion=${project.version}"
}
logger.debug "Script output: $result"
final File testIndex = new File(INTEGRATION_TEST_DIRECTORY, "build/reports/index.html")
File integrationTestDirectory = file(INTEGRATION_TEST_DIRECTORY)
final File testIndex = new File (integrationTestDirectory, "build/reports/index.html")
assert testIndex.exists()
}
}
Expand Down
8 changes: 4 additions & 4 deletions integration-test/gradle-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ plugins {
}

htmlSanityCheck {
sourceDir = new File("src/test/resources")
sourceDir = file("src/test/resources")

// where to put results of sanityChecks...
checkingResultsDir = new File("build/reports")
checkingResultsDir = file("build/reports")

logger.quiet "docToolchain> HSC sourceDir: ${sourceDir}"
logger.quiet "docToolchain> HSC checkingResultsDir: ${checkingResultsDir}"
logger.quiet "docToolchain> HSC sourceDir: ${sourceDir.absolutePath}"
logger.quiet "docToolchain> HSC checkingResultsDir: ${checkingResultsDir.absolutePath}"
}

tasks.register("clean", Delete) {
Expand Down

0 comments on commit 318bc16

Please sign in to comment.