Wizard: move common repositories to the allprojects section

This commit is contained in:
Ilya Kirillov
2020-10-10 15:43:19 +03:00
parent e824199169
commit fa8951c19e
79 changed files with 178 additions and 255 deletions
@@ -7,16 +7,6 @@ plugins {
group = 'testGroupId' group = 'testGroupId'
version = '1.0-SNAPSHOT' version = '1.0-SNAPSHOT'
repositories {
gradlePluginPortal()
google()
jcenter()
mavenCentral()
maven {
url 'KOTLIN_REPO'
}
}
dependencies { dependencies {
implementation 'com.google.android.material:material:1.2.0' implementation 'com.google.android.material:material:1.2.0'
implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'androidx.appcompat:appcompat:1.2.0'
@@ -7,16 +7,6 @@ plugins {
group = "testGroupId" group = "testGroupId"
version = "1.0-SNAPSHOT" version = "1.0-SNAPSHOT"
repositories {
gradlePluginPortal()
google()
jcenter()
mavenCentral()
maven {
url = uri("KOTLIN_REPO")
}
}
dependencies { dependencies {
implementation("com.google.android.material:material:1.2.0") implementation("com.google.android.material:material:1.2.0")
implementation("androidx.appcompat:appcompat:1.2.0") implementation("androidx.appcompat:appcompat:1.2.0")
@@ -16,9 +16,14 @@ buildscript {
group = 'testGroupId' group = 'testGroupId'
version = '1.0-SNAPSHOT' version = '1.0-SNAPSHOT'
repositories {
mavenCentral()
maven { allprojects {
url 'KOTLIN_REPO' repositories {
google()
mavenCentral()
maven {
url 'KOTLIN_REPO'
}
} }
} }
@@ -16,9 +16,14 @@ buildscript {
group = "testGroupId" group = "testGroupId"
version = "1.0-SNAPSHOT" version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
maven { allprojects {
url = uri("KOTLIN_REPO") repositories {
google()
mavenCentral()
maven {
url = uri("KOTLIN_REPO")
}
} }
} }
@@ -1,9 +1,9 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal()
google() google()
jcenter() jcenter()
gradlePluginPortal()
mavenCentral()
maven { maven {
url 'KOTLIN_REPO' url 'KOTLIN_REPO'
} }
@@ -1,9 +1,9 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal()
google() google()
jcenter() jcenter()
gradlePluginPortal()
mavenCentral()
maven { maven {
url = uri("KOTLIN_REPO") url = uri("KOTLIN_REPO")
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url 'KOTLIN_REPO' url 'KOTLIN_REPO'
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url = uri("KOTLIN_REPO") url = uri("KOTLIN_REPO")
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url 'KOTLIN_REPO' url 'KOTLIN_REPO'
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url = uri("KOTLIN_REPO") url = uri("KOTLIN_REPO")
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url 'KOTLIN_REPO' url 'KOTLIN_REPO'
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url = uri("KOTLIN_REPO") url = uri("KOTLIN_REPO")
} }
@@ -5,13 +5,6 @@ plugins {
group = 'testGroupId' group = 'testGroupId'
version = '1.0-SNAPSHOT' version = '1.0-SNAPSHOT'
repositories {
mavenCentral()
maven {
url 'KOTLIN_REPO'
}
}
dependencies { dependencies {
implementation project(':b') implementation project(':b')
implementation project(':c') implementation project(':c')
@@ -7,13 +7,6 @@ plugins {
group = "testGroupId" group = "testGroupId"
version = "1.0-SNAPSHOT" version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
maven {
url = uri("KOTLIN_REPO")
}
}
dependencies { dependencies {
implementation(project(":b")) implementation(project(":b"))
implementation(project(":c")) implementation(project(":c"))
@@ -5,13 +5,6 @@ plugins {
group = 'testGroupId' group = 'testGroupId'
version = '1.0-SNAPSHOT' version = '1.0-SNAPSHOT'
repositories {
mavenCentral()
maven {
url 'KOTLIN_REPO'
}
}
dependencies { dependencies {
implementation project(':c') implementation project(':c')
implementation project(':d') implementation project(':d')
@@ -7,13 +7,6 @@ plugins {
group = "testGroupId" group = "testGroupId"
version = "1.0-SNAPSHOT" version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
maven {
url = uri("KOTLIN_REPO")
}
}
dependencies { dependencies {
implementation(project(":c")) implementation(project(":c"))
implementation(project(":d")) implementation(project(":d"))
@@ -1,9 +1,13 @@
group = 'testGroupId' group = 'testGroupId'
version = '1.0-SNAPSHOT' version = '1.0-SNAPSHOT'
repositories {
mavenCentral()
maven { allprojects {
url 'KOTLIN_REPO' repositories {
mavenCentral()
maven {
url 'KOTLIN_REPO'
}
} }
} }
@@ -1,9 +1,13 @@
group = "testGroupId" group = "testGroupId"
version = "1.0-SNAPSHOT" version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
maven { allprojects {
url = uri("KOTLIN_REPO") repositories {
mavenCentral()
maven {
url = uri("KOTLIN_REPO")
}
} }
} }
@@ -5,13 +5,6 @@ plugins {
group = 'testGroupId' group = 'testGroupId'
version = '1.0-SNAPSHOT' version = '1.0-SNAPSHOT'
repositories {
mavenCentral()
maven {
url 'KOTLIN_REPO'
}
}
dependencies { dependencies {
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit' testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
} }
@@ -7,13 +7,6 @@ plugins {
group = "testGroupId" group = "testGroupId"
version = "1.0-SNAPSHOT" version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
maven {
url = uri("KOTLIN_REPO")
}
}
dependencies { dependencies {
testImplementation(kotlin("test-junit")) testImplementation(kotlin("test-junit"))
} }
@@ -5,13 +5,6 @@ plugins {
group = 'testGroupId' group = 'testGroupId'
version = '1.0-SNAPSHOT' version = '1.0-SNAPSHOT'
repositories {
mavenCentral()
maven {
url 'KOTLIN_REPO'
}
}
dependencies { dependencies {
implementation project(':a') implementation project(':a')
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit' testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
@@ -7,13 +7,6 @@ plugins {
group = "testGroupId" group = "testGroupId"
version = "1.0-SNAPSHOT" version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
maven {
url = uri("KOTLIN_REPO")
}
}
dependencies { dependencies {
implementation(project(":a")) implementation(project(":a"))
testImplementation(kotlin("test-junit")) testImplementation(kotlin("test-junit"))
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url 'KOTLIN_REPO' url 'KOTLIN_REPO'
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url = uri("KOTLIN_REPO") url = uri("KOTLIN_REPO")
} }
@@ -5,13 +5,6 @@ plugins {
group = 'testGroupId' group = 'testGroupId'
version = '1.0-SNAPSHOT' version = '1.0-SNAPSHOT'
repositories {
mavenCentral()
maven {
url 'KOTLIN_REPO'
}
}
dependencies { dependencies {
rootProject rootProject
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit' testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
@@ -7,13 +7,6 @@ plugins {
group = "testGroupId" group = "testGroupId"
version = "1.0-SNAPSHOT" version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
maven {
url = uri("KOTLIN_REPO")
}
}
dependencies { dependencies {
rootProject rootProject
testImplementation(kotlin("test-junit")) testImplementation(kotlin("test-junit"))
@@ -5,13 +5,6 @@ plugins {
group = 'testGroupId' group = 'testGroupId'
version = '1.0-SNAPSHOT' version = '1.0-SNAPSHOT'
repositories {
mavenCentral()
maven {
url 'KOTLIN_REPO'
}
}
dependencies { dependencies {
implementation project(':b') implementation project(':b')
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit' testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
@@ -7,13 +7,6 @@ plugins {
group = "testGroupId" group = "testGroupId"
version = "1.0-SNAPSHOT" version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
maven {
url = uri("KOTLIN_REPO")
}
}
dependencies { dependencies {
implementation(project(":b")) implementation(project(":b"))
testImplementation(kotlin("test-junit")) testImplementation(kotlin("test-junit"))
@@ -5,13 +5,6 @@ plugins {
group = 'testGroupId' group = 'testGroupId'
version = '1.0-SNAPSHOT' version = '1.0-SNAPSHOT'
repositories {
mavenCentral()
maven {
url 'KOTLIN_REPO'
}
}
dependencies { dependencies {
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit' testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
} }
@@ -7,13 +7,6 @@ plugins {
group = "testGroupId" group = "testGroupId"
version = "1.0-SNAPSHOT" version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
maven {
url = uri("KOTLIN_REPO")
}
}
dependencies { dependencies {
testImplementation(kotlin("test-junit")) testImplementation(kotlin("test-junit"))
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url 'KOTLIN_REPO' url 'KOTLIN_REPO'
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url = uri("KOTLIN_REPO") url = uri("KOTLIN_REPO")
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url 'KOTLIN_REPO' url 'KOTLIN_REPO'
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url = uri("KOTLIN_REPO") url = uri("KOTLIN_REPO")
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url 'KOTLIN_REPO' url 'KOTLIN_REPO'
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url = uri("KOTLIN_REPO") url = uri("KOTLIN_REPO")
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url 'KOTLIN_REPO' url 'KOTLIN_REPO'
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url = uri("KOTLIN_REPO") url = uri("KOTLIN_REPO")
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url 'KOTLIN_REPO' url 'KOTLIN_REPO'
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url = uri("KOTLIN_REPO") url = uri("KOTLIN_REPO")
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url 'KOTLIN_REPO' url 'KOTLIN_REPO'
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url = uri("KOTLIN_REPO") url = uri("KOTLIN_REPO")
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url 'KOTLIN_REPO' url 'KOTLIN_REPO'
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url = uri("KOTLIN_REPO") url = uri("KOTLIN_REPO")
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url 'KOTLIN_REPO' url 'KOTLIN_REPO'
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url = uri("KOTLIN_REPO") url = uri("KOTLIN_REPO")
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url 'KOTLIN_REPO' url 'KOTLIN_REPO'
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url = uri("KOTLIN_REPO") url = uri("KOTLIN_REPO")
} }
@@ -6,8 +6,8 @@ group = 'me.user'
version = '1.0-SNAPSHOT' version = '1.0-SNAPSHOT'
repositories { repositories {
mavenCentral()
jcenter() jcenter()
mavenCentral()
maven { maven {
url 'KOTLIN_REPO' url 'KOTLIN_REPO'
} }
@@ -6,8 +6,8 @@ group = "me.user"
version = "1.0-SNAPSHOT" version = "1.0-SNAPSHOT"
repositories { repositories {
mavenCentral()
jcenter() jcenter()
mavenCentral()
maven { maven {
url = uri("KOTLIN_REPO") url = uri("KOTLIN_REPO")
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url 'KOTLIN_REPO' url 'KOTLIN_REPO'
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url = uri("KOTLIN_REPO") url = uri("KOTLIN_REPO")
} }
@@ -9,19 +9,19 @@ group = 'me.user'
version = '1.0-SNAPSHOT' version = '1.0-SNAPSHOT'
repositories { repositories {
mavenCentral()
jcenter() jcenter()
maven { mavenCentral()
url 'https://dl.bintray.com/kotlin/ktor'
}
maven { maven {
url 'KOTLIN_REPO' url 'KOTLIN_REPO'
} }
maven {
url 'https://dl.bintray.com/kotlin/kotlin-js-wrappers'
}
maven { maven {
url 'https://dl.bintray.com/kotlin/kotlinx' url 'https://dl.bintray.com/kotlin/kotlinx'
} }
maven { maven {
url 'https://dl.bintray.com/kotlin/kotlin-js-wrappers' url 'https://dl.bintray.com/kotlin/ktor'
} }
} }
@@ -9,19 +9,19 @@ group = "me.user"
version = "1.0-SNAPSHOT" version = "1.0-SNAPSHOT"
repositories { repositories {
mavenCentral()
jcenter() jcenter()
maven { mavenCentral()
url = uri("https://dl.bintray.com/kotlin/ktor")
}
maven { maven {
url = uri("KOTLIN_REPO") url = uri("KOTLIN_REPO")
} }
maven {
url = uri("https://dl.bintray.com/kotlin/kotlin-js-wrappers")
}
maven { maven {
url = uri("https://dl.bintray.com/kotlin/kotlinx") url = uri("https://dl.bintray.com/kotlin/kotlinx")
} }
maven { maven {
url = uri("https://dl.bintray.com/kotlin/kotlin-js-wrappers") url = uri("https://dl.bintray.com/kotlin/ktor")
} }
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url 'KOTLIN_REPO' url 'KOTLIN_REPO'
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url = uri("KOTLIN_REPO") url = uri("KOTLIN_REPO")
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url 'KOTLIN_REPO' url 'KOTLIN_REPO'
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url = uri("KOTLIN_REPO") url = uri("KOTLIN_REPO")
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url 'KOTLIN_REPO' url 'KOTLIN_REPO'
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url = uri("KOTLIN_REPO") url = uri("KOTLIN_REPO")
} }
@@ -7,16 +7,6 @@ plugins {
group = 'me.user' group = 'me.user'
version = '1.0-SNAPSHOT' version = '1.0-SNAPSHOT'
repositories {
gradlePluginPortal()
google()
jcenter()
mavenCentral()
maven {
url 'KOTLIN_REPO'
}
}
dependencies { dependencies {
implementation project(':shared') implementation project(':shared')
implementation 'com.google.android.material:material:1.2.0' implementation 'com.google.android.material:material:1.2.0'
@@ -7,16 +7,6 @@ plugins {
group = "me.user" group = "me.user"
version = "1.0-SNAPSHOT" version = "1.0-SNAPSHOT"
repositories {
gradlePluginPortal()
google()
jcenter()
mavenCentral()
maven {
url = uri("KOTLIN_REPO")
}
}
dependencies { dependencies {
implementation(project(":shared")) implementation(project(":shared"))
implementation("com.google.android.material:material:1.2.0") implementation("com.google.android.material:material:1.2.0")
@@ -16,9 +16,14 @@ buildscript {
group = 'me.user' group = 'me.user'
version = '1.0-SNAPSHOT' version = '1.0-SNAPSHOT'
repositories {
mavenCentral()
maven { allprojects {
url 'KOTLIN_REPO' repositories {
google()
mavenCentral()
maven {
url 'KOTLIN_REPO'
}
} }
} }
@@ -16,9 +16,14 @@ buildscript {
group = "me.user" group = "me.user"
version = "1.0-SNAPSHOT" version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
maven { allprojects {
url = uri("KOTLIN_REPO") repositories {
google()
mavenCentral()
maven {
url = uri("KOTLIN_REPO")
}
} }
} }
@@ -1,9 +1,9 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal()
google() google()
jcenter() jcenter()
gradlePluginPortal()
mavenCentral()
maven { maven {
url 'KOTLIN_REPO' url 'KOTLIN_REPO'
} }
@@ -1,9 +1,9 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal()
google() google()
jcenter() jcenter()
gradlePluginPortal()
mavenCentral()
maven { maven {
url = uri("KOTLIN_REPO") url = uri("KOTLIN_REPO")
} }
@@ -9,16 +9,6 @@ plugins {
group = 'me.user' group = 'me.user'
version = '1.0-SNAPSHOT' version = '1.0-SNAPSHOT'
repositories {
gradlePluginPortal()
google()
jcenter()
mavenCentral()
maven {
url 'KOTLIN_REPO'
}
}
kotlin { kotlin {
android() android()
ios { ios {
@@ -9,16 +9,6 @@ plugins {
group = "me.user" group = "me.user"
version = "1.0-SNAPSHOT" version = "1.0-SNAPSHOT"
repositories {
gradlePluginPortal()
google()
jcenter()
mavenCentral()
maven {
url = uri("KOTLIN_REPO")
}
}
kotlin { kotlin {
android() android()
ios { ios {
@@ -8,9 +8,7 @@ group = 'me.user'
version = '1.0-SNAPSHOT' version = '1.0-SNAPSHOT'
repositories { repositories {
gradlePluginPortal()
google() google()
jcenter()
mavenCentral() mavenCentral()
maven { maven {
url 'KOTLIN_REPO' url 'KOTLIN_REPO'
@@ -8,9 +8,7 @@ group = "me.user"
version = "1.0-SNAPSHOT" version = "1.0-SNAPSHOT"
repositories { repositories {
gradlePluginPortal()
google() google()
jcenter()
mavenCentral() mavenCentral()
maven { maven {
url = uri("KOTLIN_REPO") url = uri("KOTLIN_REPO")
@@ -1,9 +1,9 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal()
google() google()
jcenter() jcenter()
gradlePluginPortal()
mavenCentral()
maven { maven {
url 'KOTLIN_REPO' url 'KOTLIN_REPO'
} }
@@ -1,9 +1,9 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal()
google() google()
jcenter() jcenter()
gradlePluginPortal()
mavenCentral()
maven { maven {
url = uri("KOTLIN_REPO") url = uri("KOTLIN_REPO")
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url 'KOTLIN_REPO' url 'KOTLIN_REPO'
} }
@@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
mavenCentral()
maven { maven {
url = uri("KOTLIN_REPO") url = uri("KOTLIN_REPO")
} }
@@ -23,7 +23,8 @@ data class BuildFileIR(
val modules: ModulesStructureIR, val modules: ModulesStructureIR,
val fromModules: List<Module>, val fromModules: List<Module>,
val pom: PomIR, val pom: PomIR,
override val irs: PersistentList<BuildSystemIR> val isRoot: Boolean,
override val irs: PersistentList<BuildSystemIR>,
) : FileIR { ) : FileIR {
override fun withReplacedIrs(irs: PersistentList<BuildSystemIR>): BuildFileIR = copy(irs = irs) override fun withReplacedIrs(irs: PersistentList<BuildSystemIR>): BuildFileIR = copy(irs = irs)
@@ -57,9 +58,10 @@ data class BuildFileIR(
} }
sectionCall("plugins", irsOfType<BuildSystemPluginIR>()); nl(lineBreaks = 2) sectionCall("plugins", irsOfType<BuildSystemPluginIR>()); nl(lineBreaks = 2)
pom.render(this); nl() pom.render(this); nl()
distinctRepositories().takeIf { it.isNotEmpty() }?.let { repositories ->
sectionCall("repositories", distinctRepositories()) sectionCall("repositories", repositories)
nl(lineBreaks = 2) nl(lineBreaks = 2)
}
modules.render(this) modules.render(this)
irsOfTypeOrNull<FreeIR>()?.let { freeIrs -> irsOfTypeOrNull<FreeIR>()?.let { freeIrs ->
nl(2) nl(2)
@@ -1,5 +1,6 @@
package org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem package org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.gradle.GradleIR
import org.jetbrains.kotlin.tools.projectWizard.plugins.printer.BuildFilePrinter import org.jetbrains.kotlin.tools.projectWizard.plugins.printer.BuildFilePrinter
import org.jetbrains.kotlin.tools.projectWizard.plugins.printer.GradlePrinter import org.jetbrains.kotlin.tools.projectWizard.plugins.printer.GradlePrinter
import org.jetbrains.kotlin.tools.projectWizard.plugins.printer.MavenPrinter import org.jetbrains.kotlin.tools.projectWizard.plugins.printer.MavenPrinter
@@ -13,6 +14,7 @@ interface RepositoryWrapper {
fun <W : RepositoryWrapper> List<W>.distinctAndSorted() = fun <W : RepositoryWrapper> List<W>.distinctAndSorted() =
distinctBy(RepositoryWrapper::repository) distinctBy(RepositoryWrapper::repository)
.sortedBy { it.repository.url }
.sortedBy { wrapper -> .sortedBy { wrapper ->
if (wrapper.repository is DefaultRepository) 0 else 1 if (wrapper.repository is DefaultRepository) 0 else 1
} }
@@ -46,3 +48,14 @@ data class RepositoryIR(override val repository: Repository) : BuildSystemIR, Re
else -> Unit else -> Unit
} }
} }
data class AllProjectsRepositoriesIR(val repositoriesIR: List<RepositoryIR>) : BuildSystemIR, GradleIR, FreeIR {
override fun GradlePrinter.renderGradle() {
sectionCall("allprojects", needIndent = true) {
sectionCall("repositories") {
repositoriesIR.listNl()
}
}
}
}
@@ -70,7 +70,6 @@ interface AndroidModuleConfigurator : ModuleConfigurator,
+GradleOnlyPluginByNameIR(reader.createAndroidPlugin(module).pluginName, priority = 1) +GradleOnlyPluginByNameIR(reader.createAndroidPlugin(module).pluginName, priority = 1)
+GradleOnlyPluginByNameIR("kotlin-android-extensions", priority = 3) +GradleOnlyPluginByNameIR("kotlin-android-extensions", priority = 3)
+createRepositories(configurationData.kotlinVersion).map(::RepositoryIR)
} }
fun Reader.createAndroidPlugin(module: Module): AndroidGradlePlugin fun Reader.createAndroidPlugin(module: Module): AndroidGradlePlugin
@@ -1,17 +1,15 @@
package org.jetbrains.kotlin.tools.projectWizard.plugins.buildSystem.gradle package org.jetbrains.kotlin.tools.projectWizard.plugins.buildSystem.gradle
import kotlinx.collections.immutable.toPersistentList
import org.jetbrains.kotlin.tools.projectWizard.Versions import org.jetbrains.kotlin.tools.projectWizard.Versions
import org.jetbrains.kotlin.tools.projectWizard.core.* import org.jetbrains.kotlin.tools.projectWizard.core.*
import org.jetbrains.kotlin.tools.projectWizard.core.entity.PipelineTask import org.jetbrains.kotlin.tools.projectWizard.core.entity.PipelineTask
import org.jetbrains.kotlin.tools.projectWizard.core.entity.properties.Property import org.jetbrains.kotlin.tools.projectWizard.core.entity.properties.Property
import org.jetbrains.kotlin.tools.projectWizard.core.entity.settings.PluginSetting import org.jetbrains.kotlin.tools.projectWizard.core.entity.settings.PluginSetting
import org.jetbrains.kotlin.tools.projectWizard.core.service.FileSystemWizardService import org.jetbrains.kotlin.tools.projectWizard.core.service.FileSystemWizardService
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.BuildSystemIR import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.*
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.PluginManagementRepositoryIR
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.RepositoryIR
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.gradle.SettingsGradleFileIR import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.gradle.SettingsGradleFileIR
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.render
import org.jetbrains.kotlin.tools.projectWizard.phases.GenerationPhase import org.jetbrains.kotlin.tools.projectWizard.phases.GenerationPhase
import org.jetbrains.kotlin.tools.projectWizard.plugins.StructurePlugin import org.jetbrains.kotlin.tools.projectWizard.plugins.StructurePlugin
import org.jetbrains.kotlin.tools.projectWizard.plugins.buildSystem.* import org.jetbrains.kotlin.tools.projectWizard.plugins.buildSystem.*
@@ -21,6 +19,9 @@ import org.jetbrains.kotlin.tools.projectWizard.plugins.printer.printBuildFile
import org.jetbrains.kotlin.tools.projectWizard.plugins.projectPath import org.jetbrains.kotlin.tools.projectWizard.plugins.projectPath
import org.jetbrains.kotlin.tools.projectWizard.plugins.templates.TemplatesPlugin import org.jetbrains.kotlin.tools.projectWizard.plugins.templates.TemplatesPlugin
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.DefaultRepository import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.DefaultRepository
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.Repository
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.updateBuildFiles
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.updateModules
import org.jetbrains.kotlin.tools.projectWizard.templates.FileTemplate import org.jetbrains.kotlin.tools.projectWizard.templates.FileTemplate
import org.jetbrains.kotlin.tools.projectWizard.templates.FileTemplateDescriptor import org.jetbrains.kotlin.tools.projectWizard.templates.FileTemplateDescriptor
@@ -103,6 +104,44 @@ abstract class GradlePlugin(context: Context) : BuildSystemPlugin(context) {
} }
} }
val mergeCommonRepositories by pipelineTask(GenerationPhase.PROJECT_GENERATION) {
runBefore(createModules)
runAfter(takeRepositoriesFromDependencies)
runAfter(KotlinPlugin.createPluginRepositories)
isAvailable = isGradle
withAction {
val buildFiles = buildFiles.propertyValue
if (buildFiles.size == 1) return@withAction UNIT_SUCCESS
val moduleRepositories = buildFiles.mapNotNull { buildFileIR ->
if (buildFileIR.isRoot) null
else buildFileIR.irs.mapNotNull { it.safeAs<RepositoryIR>()?.repository }
}
val allRepositories = moduleRepositories.flatMapTo(hashSetOf()) { it }
val commonRepositories = allRepositories.filterTo(
hashSetOf(KotlinPlugin.version.propertyValue.repository)
) { repo ->
moduleRepositories.all { repo in it }
}
updateBuildFiles { buildFile ->
buildFile.withReplacedIrs(
buildFile.irs
.filterNot { it.safeAs<RepositoryIR>()?.repository in commonRepositories }
.toPersistentList()
).let {
if (it.isRoot && commonRepositories.isNotEmpty()) {
val repositories = commonRepositories.map(::RepositoryIR).distinctAndSorted()
it.withIrs(AllProjectsRepositoriesIR(repositories))
} else it
}.asSuccess()
}
}
}
val createSettingsFileTask by pipelineTask(GenerationPhase.PROJECT_GENERATION) { val createSettingsFileTask by pipelineTask(GenerationPhase.PROJECT_GENERATION) {
runAfter(KotlinPlugin.createModules) runAfter(KotlinPlugin.createModules)
@@ -143,6 +182,7 @@ abstract class GradlePlugin(context: Context) : BuildSystemPlugin(context) {
createLocalPropertiesFile, createLocalPropertiesFile,
initGradleWrapperTask, initGradleWrapperTask,
createSettingsFileTask, createSettingsFileTask,
mergeCommonRepositories,
) )
override val properties: List<Property<*>> = super.properties + override val properties: List<Property<*>> = super.properties +
listOf( listOf(
@@ -109,6 +109,7 @@ class ModulesToIRsConverter(
RootFileModuleStructureIR(persistentListOf()), RootFileModuleStructureIR(persistentListOf()),
emptyList(), emptyList(),
pomIr, pomIr,
isRoot = true,
rootBuildFileIrs.toPersistentList() rootBuildFileIrs.toPersistentList()
) )
} }
@@ -189,6 +190,7 @@ class ModulesToIRsConverter(
), ),
listOf(module), listOf(module),
data.pomIr.copy(artifactId = module.name), data.pomIr.copy(artifactId = module.name),
isRoot = false, /* TODO */
createBuildFileIRs(module, state) createBuildFileIRs(module, state)
).also { ).also {
moduleToBuildFile[module] = it moduleToBuildFile[module] = it
@@ -230,6 +232,7 @@ class ModulesToIRsConverter(
), ),
module.subModules + module, module.subModules + module,
pomIr, pomIr,
isRoot = false,
buildPersistenceList { buildPersistenceList {
+createBuildFileIRs(module, state) +createBuildFileIRs(module, state)
module.subModules.forEach { +createBuildFileIRs(it, state) } module.subModules.forEach { +createBuildFileIRs(it, state) }