From 042873fa2c66bbaad892de51745151e9a185ea9f Mon Sep 17 00:00:00 2001 From: Vyacheslav Gerasimov Date: Fri, 16 Mar 2018 17:42:19 +0300 Subject: [PATCH] Build: add maven.repository.mirror property May be used to add additional repository to all projects (cherry picked from commit d8407b9) --- build.gradle.kts | 12 +++++++++--- gradle.properties | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index fe3d36a386e..20ab918258d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,7 +14,10 @@ buildscript { kotlinBootstrapFrom(BootstrapOption.TeamCity("1.2.40-dev-967", onlySuccessBootstrap = false)) + val mirrorRepo: String? = findProperty("maven.repository.mirror")?.toString() + val repos = listOfNotNull( + mirrorRepo, bootstrapKotlinRepo, "https://jcenter.bintray.com/", "https://plugins.gradle.org/m2", @@ -278,15 +281,18 @@ allprojects { // - some tests (in particular js and binary-compatibility-validator depend on the fixed (default) location // - idea seems unable to exclude common builddir from indexing // therefore it is disabled by default -// buildDir = File(commonBuildDir, project.name) + // buildDir = File(commonBuildDir, project.name) + val repos: List by rootProject.extra repositories { - for (repo in (rootProject.extra["repos"] as List)) { - maven { setUrl(repo) } + for (repo in repos) { + maven(repo) } + intellijSdkRepo(project) androidDxJarRepo(project) } + configureJvmProject(javaHome!!, jvmTarget!!) val commonCompilerArgs = listOf("-Xallow-kotlin-package", "-Xread-deserialized-contracts") diff --git a/gradle.properties b/gradle.properties index 6e1d75b7267..6b254e14ef3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,6 +4,7 @@ org.gradle.configureondemand=false org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m kotlin.compiler.effectSystemEnabled=true +#maven.repository.mirror=http://repository.jetbrains.com/remote-repos/ #bootstrap.kotlin.repo=https://dl.bintray.com/kotlin/kotlin-dev #bootstrap.kotlin.version=1.1.50-dev-1451 #signingRequired=true