Skip to content

Commit fcd0a86

Browse files
authored
Fix release script for IJ plugin (#6033)
* fix IJ plugin * simplify
1 parent b40b4d8 commit fcd0a86

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

intellij-plugin/src/test/kotlin/com/apollographql/ijplugin/ApolloTestCase.kt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.apollographql.ijplugin
22

3-
import com.apollographql.ijplugin.util.apollo4
3+
import com.apollographql.apollo.compiler.APOLLO_VERSION
44
import com.apollographql.ijplugin.util.logw
55
import com.intellij.application.options.CodeStyle
66
import com.intellij.codeInsight.daemon.impl.HighlightInfo
@@ -27,10 +27,6 @@ import java.io.File
2727

2828
@TestDataPath("\$CONTENT_ROOT/../../../tests/intellij-plugin-test-project")
2929
abstract class ApolloTestCase : LightJavaCodeInsightFixtureTestCase() {
30-
companion object {
31-
const val snapshotVersion = "4.0.0-beta.8-SNAPSHOT"
32-
}
33-
3430
open val mavenLibraries: List<String> = listOf("apollo-annotations", "apollo-api", "apollo-runtime", "org.jetbrains.kotlin:kotlin-stdlib:2.0.0")
3531

3632
private val projectDescriptor = object : DefaultLightProjectDescriptor() {
@@ -40,11 +36,11 @@ abstract class ApolloTestCase : LightJavaCodeInsightFixtureTestCase() {
4036
addFromMaven(model, library, true, DependencyScope.COMPILE)
4137
} else {
4238
// XXX: tunnel that in an environment variable if possible
43-
val jarPath = "../libraries/$library/build/libs/$library-jvm-$snapshotVersion.jar"
39+
val jarPath = "../libraries/$library/build/libs/$library-jvm-$APOLLO_VERSION.jar"
4440

4541
PsiTestUtil.addProjectLibrary(
4642
model,
47-
"com.apollographql.apollo3:$library:$snapshotVersion",
43+
"com.apollographql.apollo3:$library:$APOLLO_VERSION",
4844
listOf(File(".").resolve(jarPath).absolutePath)
4945
)
5046
}

scripts/release.main.kts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ val releaseBranchName = "release-$versionToRelease"
4747
runCommand("git", "checkout", "-b", releaseBranchName)
4848
setCurrentVersion(versionToRelease)
4949
setVersionInDocs(versionToRelease, nextSnapshot)
50-
setVersionInIntelliJPlugin(versionToRelease, nextSnapshot)
50+
setVersionInIntelliJPlugin(versionToRelease)
5151
runCommand("git", "commit", "-a", "-m", "release $versionToRelease")
5252
runCommand("git", "push", "origin", releaseBranchName)
5353
runCommand("gh", "pr", "create", "--base", startBranch, "--fill")
@@ -208,18 +208,18 @@ fun setVersionInDocs(version: String, nextSnapshot: String) {
208208
}
209209
}
210210

211-
fun setVersionInIntelliJPlugin(version: String, nextSnapshot: String) {
211+
fun setVersionInIntelliJPlugin(version: String) {
212212
File("intellij-plugin/src/main/kotlin/com/apollographql/ijplugin/refactoring/migration/v3tov4/ApolloV3ToV4MigrationProcessor.kt").let { file ->
213213
file.writeText(file.readText().replace(Regex("""apollo4LatestVersion = "(.+)"""")) {
214214
"""apollo4LatestVersion = "$version""""
215215
})
216216
}
217217
File("intellij-plugin/src/test/testData/migration/v3-to-v4/updateGradleDependenciesInLibsVersionsToml_after.versions.toml").let { file ->
218218
file.writeText(file.readText()
219-
.replace(Regex(""""com\.apollographql\.apollo3:apollo-runtime:4(.+)"""")) {
219+
.replace(Regex(""""com\.apollographql\.apollo:apollo-runtime:4(.+)"""")) {
220220
""""com.apollographql.apollo:apollo-runtime:$version""""
221221
}
222-
.replace(Regex(""""com\.apollographql\.apollo3:4(.+)"""")) {
222+
.replace(Regex(""""com\.apollographql\.apollo:4(.+)"""")) {
223223
""""com.apollographql.apollo:$version""""
224224
}
225225
.replace(Regex(""""4(.+)"""")) {
@@ -237,11 +237,6 @@ fun setVersionInIntelliJPlugin(version: String, nextSnapshot: String) {
237237
}
238238
)
239239
}
240-
File("intellij-plugin/src/test/kotlin/com/apollographql/ijplugin/ApolloTestCase.kt").let { file ->
241-
file.writeText(file.readText().replace(Regex("""snapshotVersion = "(.+)"""")) {
242-
"""snapshotVersion = "$nextSnapshot""""
243-
})
244-
}
245240
}
246241

247242
fun mergeAndWait(branchName: String) {

0 commit comments

Comments
 (0)