Skip to content

Commit 0268dc1

Browse files
committed
Miscs
- Move lint-baseline file - Check docs dir existing - Optimize download dest dir check - Reformat
1 parent 2f79532 commit 0268dc1

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

build.gradle.kts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ kotlin {
4545
}
4646

4747
lint {
48-
baseline = file("lint-baseline.xml")
48+
baseline = file("gradle/lint-baseline.xml")
4949
ignoreTestSources = true
5050
warningsAsErrors = true
5151
}
@@ -120,7 +120,9 @@ testing.suites {
120120
register<JvmTestSuite>("documentTest") {
121121
targets.configureEach {
122122
testTask {
123-
val docsDir = file("docs")
123+
val docsDir = file("docs").also {
124+
if (!it.exists() || !it.isDirectory) error("Docs dir $it does not exist or is not a directory.")
125+
}
124126
// Add docs as an input directory to trigger ManualCodeSnippetTests re-run on changes.
125127
inputs.dir(docsDir)
126128
systemProperty("DOCS_DIR", docsDir.absolutePath)
@@ -216,16 +218,16 @@ tasks.check {
216218
tasks.register<Copy>("downloadStartScripts") {
217219
description = "Download start scripts from Gradle sources, this should be run intervally to track updates."
218220

219-
val urlPrefix = "https://raw.githubusercontent.com/gradle/gradle/refs/heads/master/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins"
221+
val urlPrefix = "https://raw.githubusercontent.com/gradle/gradle/refs/heads/master/platforms/jvm/" +
222+
"plugins-application/src/main/resources/org/gradle/api/internal/plugins"
220223
from(resources.text.fromUri("$urlPrefix/unixStartScript.txt")) {
221224
rename { "unixStartScript.txt" }
222225
}
223226
from(resources.text.fromUri("$urlPrefix/windowsStartScript.txt")) {
224227
rename { "windowsStartScript.txt" }
225228
}
226-
val destDir = file("src/main/resources/com/github/jengelman/gradle/plugins/shadow/internal")
227-
if (!destDir.exists() || !destDir.isDirectory || destDir.listFiles().isNullOrEmpty()) {
228-
error("Download destination dir $destDir does not exist or is empty.")
229+
val destDir = file("src/main/resources/com/github/jengelman/gradle/plugins/shadow/internal").also {
230+
if (!it.exists() || !it.isDirectory) error("Download destination dir $it does not exist or is not a directory.")
229231
}
230232
into(destDir)
231233
}
File renamed without changes.

0 commit comments

Comments
 (0)