KT-34795 Use maven(...) instead of maven { setUrl(...) } for gradle scripts generation
- Use new syntax in tests, but not in actual gradle files - Reuse public `toKotlinRepositorySnippet` instead of private one - ^KT-34795 Fixed
This commit is contained in:
committed by
Roman Golyshev
parent
3dbc058db9
commit
a2b2c47b51
-2
@@ -110,8 +110,6 @@ abstract class KotlinDslGradleKotlinFrameworkSupportProvider(
|
|||||||
KotlinFUSLogger.log(FUSEventGroups.NPWizards, this.javaClass.simpleName)
|
KotlinFUSLogger.log(FUSEventGroups.NPWizards, this.javaClass.simpleName)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun RepositoryDescription.toKotlinRepositorySnippet() = "maven { setUrl(\"$url\") }"
|
|
||||||
|
|
||||||
protected abstract fun getOldSyntaxPluginDefinition(): String
|
protected abstract fun getOldSyntaxPluginDefinition(): String
|
||||||
protected abstract fun getPluginDefinition(): String
|
protected abstract fun getPluginDefinition(): String
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -85,7 +85,7 @@ abstract class MultiplePluginVersionGradleImportingTestCase : GradleImportingTes
|
|||||||
"konan/utils/build/libs"
|
"konan/utils/build/libs"
|
||||||
)
|
)
|
||||||
val customRepositories = arrayOf("https://dl.bintray.com/kotlin/kotlin-dev", "http://dl.bintray.com/kotlin/kotlin-eap")
|
val customRepositories = arrayOf("https://dl.bintray.com/kotlin/kotlin-dev", "http://dl.bintray.com/kotlin/kotlin-eap")
|
||||||
val customMavenRepositories = customRepositories.map { if (useKts) "maven { setUrl(\"$it\") }" else "maven { url '$it' } " }.joinToString("\n")
|
val customMavenRepositories = customRepositories.map { if (useKts) "maven(\"$it\")" else "maven { url '$it' } " }.joinToString("\n")
|
||||||
val baseFolder = File(".").absolutePath.replace("\\", "/")
|
val baseFolder = File(".").absolutePath.replace("\\", "/")
|
||||||
val quote = if (useKts) '"' else '\''
|
val quote = if (useKts) '"' else '\''
|
||||||
val flatDirRepositories = if (useMaster)
|
val flatDirRepositories = if (useMaster)
|
||||||
|
|||||||
+7
-1
@@ -97,7 +97,13 @@ fun DependencyScope.toGradleCompileScope(isAndroidModule: Boolean) = when (this)
|
|||||||
|
|
||||||
fun RepositoryDescription.toGroovyRepositorySnippet() = "maven { url '$url' }"
|
fun RepositoryDescription.toGroovyRepositorySnippet() = "maven { url '$url' }"
|
||||||
|
|
||||||
fun RepositoryDescription.toKotlinRepositorySnippet() = "maven { setUrl(\"$url\") }"
|
/**
|
||||||
|
* This syntax has been released in kotlin-dsl-0.11.1 release and in Gradle 4.2-RC1 release.
|
||||||
|
*
|
||||||
|
* We already require Gradle distribution of higher version (see `checkGradleCompatibility` function),
|
||||||
|
* so it is safe to use this syntax everywhere.
|
||||||
|
*/
|
||||||
|
fun RepositoryDescription.toKotlinRepositorySnippet() = "maven(\"$url\")"
|
||||||
|
|
||||||
fun getRepositoryForVersion(version: String): RepositoryDescription? = when {
|
fun getRepositoryForVersion(version: String): RepositoryDescription? = when {
|
||||||
isSnapshot(version) -> SNAPSHOT_REPOSITORY
|
isSnapshot(version) -> SNAPSHOT_REPOSITORY
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ application {
|
|||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
jcenter()
|
||||||
maven { setUrl("https://dl.bintray.com/kotlin/kotlin-eap") }
|
maven("https://dl.bintray.com/kotlin/kotlin-eap")
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ application {
|
|||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
jcenter()
|
||||||
maven { setUrl("https://dl.bintray.com/kotlin/kotlin-eap") }
|
maven("https://dl.bintray.com/kotlin/kotlin-eap")
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|||||||
Vendored
+1
-1
@@ -9,7 +9,7 @@ dependencies {
|
|||||||
implementation(kotlin("stdlib-jdk8"))
|
implementation(kotlin("stdlib-jdk8"))
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
maven { setUrl("https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_KotlinPublic_Compiler),number:1.2.60-dev-286,branch:(default:any)/artifacts/content/maven") }
|
maven("https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_KotlinPublic_Compiler),number:1.2.60-dev-286,branch:(default:any)/artifacts/content/maven")
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
val compileKotlin: KotlinCompile by tasks
|
val compileKotlin: KotlinCompile by tasks
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ version = "1.0-SNAPSHOT"
|
|||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven { setUrl("https://dl.bintray.com/kotlin/kotlin-eap") }
|
maven("https://dl.bintray.com/kotlin/kotlin-eap")
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(kotlin("stdlib-js"))
|
implementation(kotlin("stdlib-js"))
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ version = "1.0-SNAPSHOT"
|
|||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven { setUrl("https://dl.bintray.com/kotlin/kotlin-eap") }
|
maven("https://dl.bintray.com/kotlin/kotlin-eap")
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|||||||
+1
-1
@@ -139,7 +139,7 @@ class NewMultiplatformIT : BaseGradleIT() {
|
|||||||
|
|
||||||
with(appProject) {
|
with(appProject) {
|
||||||
setupWorkingDir()
|
setupWorkingDir()
|
||||||
gradleBuildScript().appendText("\nrepositories { maven { setUrl(\"$libLocalRepoUri\") } }")
|
gradleBuildScript().appendText("\nrepositories { maven(\"$libLocalRepoUri\") }")
|
||||||
|
|
||||||
fun CompiledProject.checkProgramCompilationCommandLine(check: (String) -> Unit) {
|
fun CompiledProject.checkProgramCompilationCommandLine(check: (String) -> Unit) {
|
||||||
output.lineSequence().filter {
|
output.lineSequence().filter {
|
||||||
|
|||||||
Reference in New Issue
Block a user