Skip to content

Commit ada6101

Browse files
authored
Make the Kotlin nightly build use 2.2.0 (#6475)
1 parent 3483916 commit ada6101

File tree

4 files changed

+27
-9
lines changed

4 files changed

+27
-9
lines changed

gradle/repositories.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
listOf(pluginManagement.repositories, dependencyResolutionManagement.repositories).forEach {
22
it.apply {
33
// Uncomment this one to use the Kotlin "dev" repository
4-
// maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev/")
4+
// maven("https://redirector.kotlinlang.org/maven/dev/")
55
// Uncomment this one to use the Sonatype OSSRH snapshots repository
66
// maven("https://oss.sonatype.org/content/repositories/snapshots/")
77
// Uncomment this one to use the GradleUp repository

intellij-plugin/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
12
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
23
import org.gradle.api.tasks.testing.logging.TestLogEvent
34
import org.jetbrains.changelog.markdownToHTML
45
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
5-
import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask.FailureLevel.COMPATIBILITY_PROBLEMS
66
import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask.FailureLevel.INTERNAL_API_USAGES
77
import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask.FailureLevel.INVALID_PLUGIN
88
import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask.FailureLevel.PLUGIN_STRUCTURE_WARNINGS
@@ -28,9 +28,9 @@ commonSetup()
2828
// XXX: this should use the settings repositories instead
2929
repositories {
3030
// Uncomment this one to use the Kotlin "dev" repository
31-
// maven { url = uri("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev/") }
31+
// maven("https://redirector.kotlinlang.org/maven/dev/")
3232
// Uncomment this one to use the Sonatype OSSRH snapshots repository
33-
// maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots/") }
33+
// maven("https://oss.sonatype.org/content/repositories/snapshots/")
3434
mavenCentral()
3535

3636
intellijPlatform {

libraries/apollo-gradle-plugin/testProjects/gradle-min-version/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ repositories {
2323
}
2424
mavenCentral()
2525
// Uncomment this one to use the Kotlin "dev" repository
26-
// maven { url = uri("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev/") }
26+
// maven("https://redirector.kotlinlang.org/maven/dev/")
2727
}
2828

2929
configure<ApolloExtension> {

scripts/bump-kotlin-nightlies.main.kts

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/usr/bin/env kotlin
22

3+
@file:DependsOn("com.github.zafarkhaja:java-semver:0.10.2")
4+
5+
import com.github.zafarkhaja.semver.Version
36
import java.io.File
47
import java.net.URL
58
import javax.xml.parsers.DocumentBuilderFactory
@@ -8,9 +11,18 @@ val BRANCH_NAME = "kotlin-nightlies"
811

912
fun bumpVersions() {
1013
val kotlinVersion =
11-
getLatestVersion("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev/org/jetbrains/kotlin/kotlin-stdlib/maven-metadata.xml", prefix = "2.1")
12-
val kspVersion =
13-
getLatestVersion("https://oss.sonatype.org/content/repositories/snapshots/com/google/devtools/ksp/com.google.devtools.ksp.gradle.plugin/maven-metadata.xml")
14+
getLatestVersion("https://redirector.kotlinlang.org/maven/dev/org/jetbrains/kotlin/kotlin-stdlib/maven-metadata.xml", prefix = "2.2.0")
15+
16+
val useKspSnapshots = false
17+
val kspVersion = getLatestVersion(
18+
if (useKspSnapshots) {
19+
"https://oss.sonatype.org/content/repositories/snapshots/com/google/devtools/ksp/com.google.devtools.ksp.gradle.plugin/maven-metadata.xml"
20+
} else {
21+
"https://repo1.maven.org/maven2/com/google/devtools/ksp/com.google.devtools.ksp.gradle.plugin/maven-metadata.xml"
22+
},
23+
prefix = "2.2.0"
24+
)
25+
1426
File("gradle/libraries.toml").let { file ->
1527
file.writeText(
1628
file.readText()
@@ -40,7 +52,13 @@ fun getLatestVersion(url: String, prefix: String? = null): String {
4052
(0 until it.length)
4153
.map { i -> it.item(i).textContent }
4254
.filter { it.startsWith(prefix) }
43-
.first() // Assumes they are sorted by most recent first, which is true on Kotlin's repo, false on Sonatype
55+
.sortedBy {
56+
Version.parse(
57+
// Make it SemVer comparable
58+
it.replace("-dev-", "-dev.")
59+
)
60+
}
61+
.last()
4462
}
4563
} else {
4664
document

0 commit comments

Comments
 (0)