Skip to content

Commit

Permalink
Apply default pluginManagement in settings for old test setup.
Browse files Browse the repository at this point in the history
Cleanup non-required configuration in test projects settings.

^KT-45745 In Progress
  • Loading branch information
Tapchicoma authored and Space committed Dec 7, 2021
1 parent 01332a2 commit e705a36
Show file tree
Hide file tree
Showing 135 changed files with 35 additions and 1,186 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import org.jetbrains.kotlin.gradle.model.ModelContainer
import org.jetbrains.kotlin.gradle.model.ModelFetcherBuildAction
import org.jetbrains.kotlin.gradle.plugin.KotlinJsCompilerType
import org.jetbrains.kotlin.gradle.testbase.enableCacheRedirector
import org.jetbrains.kotlin.gradle.testbase.addPluginManagementToSettings
import org.jetbrains.kotlin.gradle.util.*
import org.jetbrains.kotlin.test.RunnerWithMuteInDatabase
import org.jetbrains.kotlin.test.util.trimTrailingWhitespaces
Expand Down Expand Up @@ -292,7 +293,10 @@ abstract class BaseGradleIT {
addHeapDumpOptionsToPropertiesFile()
}

if (enableCacheRedirector) projectDir.toPath().enableCacheRedirector()
projectDir.toPath().apply {
addPluginManagementToSettings()
if (enableCacheRedirector) enableCacheRedirector()
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ open class Kapt3IT : Kapt3BaseIT() {

val kaptProject = Project("simple", directoryPrefix = "kapt2").apply { setupWorkingDir(false) }
kaptProject.projectDir.copyRecursively(projectDir.resolve("simple"))
projectDir.resolve("settings.gradle").appendText("include 'simple'")
projectDir.resolve("settings.gradle").appendText("\ninclude ':simple'")
gradleBuildScript().appendText("\ndependencies { implementation project(':simple') }")

testResolveAllConfigurations()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,13 @@ import org.jetbrains.kotlin.gradle.targets.js.npm.PackageJson
import org.jetbrains.kotlin.gradle.targets.js.npm.fromSrcPackageJson
import org.jetbrains.kotlin.gradle.tasks.USING_JS_INCREMENTAL_COMPILATION_MESSAGE
import org.jetbrains.kotlin.gradle.tasks.USING_JS_IR_BACKEND_MESSAGE
import org.jetbrains.kotlin.gradle.testbase.GradleTest
import org.jetbrains.kotlin.gradle.testbase.assertFileExists
import org.jetbrains.kotlin.gradle.testbase.build
import org.jetbrains.kotlin.gradle.testbase.project
import org.jetbrains.kotlin.gradle.util.*
import org.junit.Assert
import org.junit.Assume.assumeFalse
import org.junit.Test
import org.junit.jupiter.api.DisplayName
import java.io.File
import java.io.FileFilter
import java.util.zip.ZipFile
import kotlin.io.path.readText
import kotlin.test.assertEquals
import kotlin.test.assertFalse
import kotlin.test.assertTrue
Expand Down Expand Up @@ -535,7 +529,6 @@ abstract class AbstractKotlin2JsGradlePluginIT(val irBackend: Boolean) : BaseGra
assumeFalse(irBackend) // TODO: Support IR version of kotlinx.html
setupWorkingDir()
gradleBuildScript().modify(::transformBuildScriptWithPluginsDsl)
gradleSettingsScript().modify(::transformBuildScriptWithPluginsDsl)

build("publish", "runDceKotlin", "test", "runDceBenchmarkKotlin") {
assertSuccessful()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ internal val DEFAULT_GROOVY_SETTINGS_FILE =
id "org.jetbrains.kotlin.android" version "${'$'}kotlin_version"
id "org.jetbrains.kotlin.js" version "${'$'}kotlin_version"
id "org.jetbrains.kotlin.multiplatform" version "${'$'}kotlin_version"
id "org.jetbrains.kotlin.multiplatform.pm20" version "${'$'}kotlin_version"
id "org.jetbrains.kotlin.plugin.allopen" version "${'$'}kotlin_version"
id "org.jetbrains.kotlin.test.fixes.android" version "${'$'}kotlin_version"
}
Expand All @@ -44,6 +46,8 @@ internal val DEFAULT_GROOVY_SETTINGS_FILE =
case "kotlin-dce-js":
useModule("org.jetbrains.kotlin:kotlin-gradle-plugin:${'$'}kotlin_version")
break
case "kotlin2js":
useModule("org.jetbrains.kotlin:kotlin-gradle-plugin:${'$'}kotlin_version")
}
}
}
Expand All @@ -69,6 +73,8 @@ internal val DEFAULT_KOTLIN_SETTINGS_FILE =
id("org.jetbrains.kotlin.android") version kotlin_version
id("org.jetbrains.kotlin.js") version kotlin_version
id("org.jetbrains.kotlin.multiplatform") version kotlin_version
id("org.jetbrains.kotlin.multiplatform.pm20") version kotlin_version
id("org.jetbrains.kotlin.plugin.allopen") version kotlin_version
id("org.jetbrains.kotlin.test.fixes.android") version kotlin_version
}
Expand All @@ -84,7 +90,8 @@ internal val DEFAULT_KOTLIN_SETTINGS_FILE =
"com.android.lint",
"com.android.instantapp",
"com.android.feature" -> useModule("com.android.tools.build:gradle:${'$'}android_tools_version")
"kotlin-dce-js" -> useModule("org.jetbrains.kotlin:kotlin-gradle-plugin:${'$'}kotlin_version")
"kotlin-dce-js" -> useModule("org.jetbrains.kotlin:kotlin-gradle-plugin:${'$'}kotlin_version")
"kotlin2js" -> useModule("org.jetbrains.kotlin:kotlin-gradle-plugin:${'$'}kotlin_version")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1 @@
pluginManagement {
repositories {
mavenLocal()
mavenCentral()
google()
gradlePluginPortal()
}

plugins {
id "org.jetbrains.kotlin.jvm" version "$kotlin_version"
id "org.jetbrains.kotlin.kapt" version "$kotlin_version"
id "org.jetbrains.kotlin.android" version "$kotlin_version"
}

resolutionStrategy {
eachPlugin {
if (requested.id.id.startsWith("com.android.")) {
useModule("com.android.tools.build:gradle:$android_tools_version")
}
}
}
}

include ':Android', ':Lib', ':Test'

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1 @@
pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
mavenLocal()
}
val kotlin_version: String by settings
plugins {
kotlin("multiplatform").version(kotlin_version)
}
}

include(":shared")
include(":shared")

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1 @@
rootProject.name = "sample-app"

enableFeaturePreview("GRADLE_METADATA")

pluginManagement {
repositories {
mavenLocal()
mavenCentral()
gradlePluginPortal()
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1 @@
rootProject.name = "sample-lib"

enableFeaturePreview("GRADLE_METADATA")

pluginManagement {
repositories {
mavenLocal()
mavenCentral()
gradlePluginPortal()
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
pluginManagement {
repositories {
maven { url '<mavenLocalUrl>' }
gradlePluginPortal()
mavenCentral()
}
}

rootProject.name = 'cleanTask'
rootProject.name = 'cleanTask'

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1 @@
pluginManagement {
repositories {
mavenLocal()
gradlePluginPortal()
}
val kotlin_version: String by settings
plugins {
kotlin("multiplatform").version(kotlin_version)
}
}

include(":p1")
include(":p1")
Original file line number Diff line number Diff line change
@@ -1,12 +1 @@
pluginManagement {
repositories {
mavenLocal()
gradlePluginPortal()
}
val kotlin_version: String by settings
plugins {
kotlin("multiplatform").version(kotlin_version)
}
}

include(":p1")
include(":p1")
Original file line number Diff line number Diff line change
@@ -1,12 +1 @@
pluginManagement {
repositories {
mavenLocal()
gradlePluginPortal()
}
val kotlin_version: String by settings
plugins {
kotlin("multiplatform").version(kotlin_version)
}
}

include(":p1")
include(":p1")

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
pluginManagement {
repositories {
mavenLocal()
gradlePluginPortal()
}
val kotlin_version: String by settings
plugins {
kotlin("multiplatform").version(kotlin_version)
}
}

include(":p0")
include(":p1")
include(":p2")

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1 @@
pluginManagement {
repositories {
mavenLocal()
gradlePluginPortal()
}
val kotlin_version: String by settings
plugins {
kotlin("multiplatform").version(kotlin_version)
}
}

include(":p1")
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
pluginManagement {
repositories {
mavenLocal()
gradlePluginPortal()
}
val kotlin_version: String by settings
plugins {
kotlin("multiplatform").version(kotlin_version)
}
}

include(":p1")
include(":p2")
include(":p3")

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit e705a36

Please sign in to comment.