Skip to content

Commit 7a51904

Browse files
committed
fix testMavenRepoPathString, increase test logging
1 parent c8600fd commit 7a51904

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

modules/bcv-gradle-plugin-functional-tests/src/testFixtures/kotlin/GradleTestKitUtils.kt

+12-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
package dev.adamko.kotlin.binary_compatibility_validator.test.utils
44

5-
import dev.adamko.kotlin.binary_compatibility_validator.test.utils.GradleProjectTest.Companion.testMavenRepoDir
5+
import dev.adamko.kotlin.binary_compatibility_validator.test.utils.GradleProjectTest.Companion.testMavenRepoPathString
66
import java.io.File
77
import java.nio.file.Path
88
import java.nio.file.Paths
@@ -31,7 +31,13 @@ class GradleProjectTest(
3131
companion object {
3232

3333
/** file-based Maven Repo that contains the published plugin */
34-
val testMavenRepoDir: Path by systemProperty(Paths::get)
34+
private val testMavenRepoDir: Path by systemProperty(Paths::get)
35+
val testMavenRepoPathString
36+
get() = testMavenRepoDir
37+
.toFile()
38+
.canonicalFile
39+
.absoluteFile
40+
.invariantSeparatorsPath
3541

3642
private val projectTestTempDir: Path by systemProperty(Paths::get)
3743

@@ -76,15 +82,15 @@ fun gradleKtsProjectTest(
7682
|dependencyResolutionManagement {
7783
| repositories {
7884
| mavenCentral()
79-
| maven(file("$testMavenRepoDir"))
85+
| maven(file("$testMavenRepoPathString"))
8086
| }
8187
|}
8288
|
8389
|pluginManagement {
8490
| repositories {
8591
| gradlePluginPortal()
8692
| mavenCentral()
87-
| maven(file("$testMavenRepoDir"))
93+
| maven(file("$testMavenRepoPathString"))
8894
| }
8995
|}
9096
|
@@ -120,15 +126,15 @@ fun gradleGroovyProjectTest(
120126
|dependencyResolutionManagement {
121127
| repositories {
122128
| mavenCentral()
123-
| maven { url = file("$testMavenRepoDir") }
129+
| maven { url = file("$testMavenRepoPathString") }
124130
| }
125131
|}
126132
|
127133
|pluginManagement {
128134
| repositories {
129135
| gradlePluginPortal()
130136
| mavenCentral()
131-
| maven { url = file("$testMavenRepoDir") }
137+
| maven { url = file("$testMavenRepoPathString") }
132138
| }
133139
|}
134140
|

modules/bcv-gradle-plugin-functional-tests/src/testFixtures/kotlin/api/TestDsl.kt

+6-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package dev.adamko.kotlin.binary_compatibility_validator.test.utils.api
22

3-
import dev.adamko.kotlin.binary_compatibility_validator.test.utils.GradleProjectTest
43
import dev.adamko.kotlin.binary_compatibility_validator.test.utils.GradleProjectTest.Companion.minimumGradleTestVersion
4+
import dev.adamko.kotlin.binary_compatibility_validator.test.utils.GradleProjectTest.Companion.testMavenRepoPathString
55
import dev.adamko.kotlin.binary_compatibility_validator.test.utils.invariantNewlines
66
import java.io.File
77
import org.gradle.testkit.runner.GradleRunner
@@ -12,29 +12,21 @@ const val API_DIR = "api"
1212
fun BaseKotlinGradleTest.test(fn: BaseKotlinScope.() -> Unit): GradleRunner {
1313
val baseKotlinScope = BaseKotlinScope()
1414

15-
val testMavenRepoRelativePath =
16-
GradleProjectTest
17-
.testMavenRepoDir
18-
.toFile()
19-
.canonicalFile
20-
.absoluteFile
21-
.invariantSeparatorsPath
22-
2315
baseKotlinScope.settingsGradleKts {
2416
addText(/*language=kts*/ """
2517
|@Suppress("UnstableApiUsage")
2618
|dependencyResolutionManagement {
2719
| repositories {
2820
| mavenCentral()
29-
| maven(file("$testMavenRepoRelativePath"))
21+
| maven(file("$testMavenRepoPathString"))
3022
| }
3123
|}
3224
|
3325
|pluginManagement {
3426
| repositories {
3527
| gradlePluginPortal()
3628
| mavenCentral()
37-
| maven(file("$testMavenRepoRelativePath"))
29+
| maven(file("$testMavenRepoPathString"))
3830
| }
3931
|}
4032
|
@@ -47,7 +39,7 @@ fun BaseKotlinGradleTest.test(fn: BaseKotlinScope.() -> Unit): GradleRunner {
4739
baseKotlinScope.files.forEach { scope ->
4840
val fileWriteTo = rootProjectDir.resolve(scope.filePath)
4941
.apply {
50-
parentFile.mkdirs()
42+
parentFile?.mkdirs()
5143
createNewFile()
5244
}
5345

@@ -195,6 +187,8 @@ class AppendableScope(val filePath: String) {
195187
class Runner {
196188
val arguments: MutableList<String> = mutableListOf(
197189
"--configuration-cache",
190+
"--info",
191+
"--stacktrace",
198192
)
199193
}
200194

0 commit comments

Comments
 (0)