aboutsummaryrefslogtreecommitdiff
path: root/integration-tests/gradle/src/main/kotlin
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-07-30 14:33:41 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-07-30 14:55:16 +0200
commitba4e7e2a258bbef281039ed3829b23a657225d27 (patch)
tree9b46561334203d694bec0cb24c9b3bad28273c86 /integration-tests/gradle/src/main/kotlin
parent0a2e62ac839f15939e61de990e57307658f69832 (diff)
downloaddokka-ba4e7e2a258bbef281039ed3829b23a657225d27.tar.gz
dokka-ba4e7e2a258bbef281039ed3829b23a657225d27.tar.bz2
dokka-ba4e7e2a258bbef281039ed3829b23a657225d27.zip
Use `cache-redirector` repositories for Gradle integration tests
Diffstat (limited to 'integration-tests/gradle/src/main/kotlin')
-rw-r--r--integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt14
1 files changed, 13 insertions, 1 deletions
diff --git a/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt b/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt
index f852dc8b..9998f3fd 100644
--- a/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt
+++ b/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt
@@ -4,6 +4,7 @@ import org.gradle.testkit.runner.BuildResult
import org.gradle.testkit.runner.GradleRunner
import org.gradle.testkit.runner.internal.DefaultGradleRunner
import org.gradle.tooling.GradleConnectionException
+import org.gradle.util.GradleVersion
import org.jetbrains.dokka.it.AbstractIntegrationTest
import org.junit.Assume
import org.junit.Assume.assumeFalse
@@ -11,6 +12,7 @@ import org.junit.AssumptionViolatedException
import org.junit.runner.RunWith
import org.junit.runners.Parameterized
import java.io.File
+import java.net.URI
import kotlin.test.BeforeTest
@RunWith(Parameterized::class)
@@ -31,8 +33,8 @@ abstract class AbstractGradleIntegrationTest : AbstractIntegrationTest() {
): GradleRunner {
return GradleRunner.create()
.withProjectDir(projectDir)
- .withGradleVersion(versions.gradleVersion.version)
.forwardOutput()
+ .withJetBrainsCachedGradleVersion(versions.gradleVersion)
.withTestKitDir(File("build", "gradle-test-kit").absoluteFile)
.withArguments(
listOfNotNull(
@@ -62,6 +64,16 @@ abstract class AbstractGradleIntegrationTest : AbstractIntegrationTest() {
}
}
+private fun GradleRunner.withJetBrainsCachedGradleVersion(version: GradleVersion): GradleRunner {
+ return withGradleDistribution(
+ URI.create(
+ "https://cache-redirector.jetbrains.com/" +
+ "services.gradle.org/distributions/" +
+ "gradle-${version.version}-bin.zip"
+ )
+ )
+}
+
private fun Throwable.withAllCauses(): Sequence<Throwable> {
val root = this
return sequence {