Skip to content
This repository was archived by the owner on Mar 26, 2024. It is now read-only.

Commit f997d8e

Browse files
committed
Simplify building with different Intellij Platform dependencies versions
1 parent 48beba2 commit f997d8e

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ subprojects {
3939
mavenCentral()
4040
maven("https://jitpack.io")
4141
maven("https://www.jetbrains.com/intellij-repository/releases")
42+
maven("https://www.jetbrains.com/intellij-repository/snapshots")
4243
maven("https://cache-redirector.jetbrains.com/intellij-dependencies")
4344
}
4445

buildSrc/build.gradle.kts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,28 @@
2121
* Please contact JetBrains, Na Hrebenech II 1718/10, Prague, 14000, Czech Republic
2222
* if you need additional information or have any questions.
2323
*/
24+
25+
import java.util.*
26+
2427
plugins {
2528
`kotlin-dsl`
2629
}
2730

2831
repositories {
2932
mavenCentral()
3033
maven("https://www.jetbrains.com/intellij-repository/releases")
34+
maven("https://www.jetbrains.com/intellij-repository/snapshots")
3135
maven("https://cache-redirector.jetbrains.com/intellij-dependencies")
3236
}
3337

34-
val intellijPlatformVersion: String by project
38+
val gradleProperties = Properties()
39+
val gradlePropertiesFile = project.file("../gradle.properties")
40+
if (gradlePropertiesFile.canRead()) {
41+
gradleProperties.load(gradlePropertiesFile.inputStream())
42+
}
43+
44+
val intellijPlatformVersion: String by gradleProperties
45+
3546
val serializationVersion: String by project
3647

3748
dependencies {

buildSrc/gradle.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,4 @@
2222
# if you need additional information or have any questions.
2323
#
2424

25-
intellijPlatformVersion=213.6461.23
2625
serializationVersion=1.3.1

projector-server/build.gradle.kts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
* if you need additional information or have any questions.
2323
*/
2424

25+
import com.intellij.openapi.util.BuildNumber
2526
import java.net.URL
2627
import java.util.*
2728
import java.util.zip.ZipFile
@@ -52,6 +53,9 @@ val kotlinVersion: String by project
5253
val intellijJcefVersion: String by project
5354
val intellijPlatformVersion: String by project
5455

56+
val intelliJVersionRemovedSuffix = intellijPlatformVersion.takeWhile { it.isDigit() || it == '.' } // in case of EAP
57+
val intellijPlatformBuildNumber = BuildNumber.fromString(intelliJVersionRemovedSuffix)!!
58+
5559
dependencies {
5660
implementation("$projectorClientGroup:projector-common:$projectorClientVersion")
5761
implementation("$projectorClientGroup:projector-ij-common:$projectorClientVersion")
@@ -60,7 +64,12 @@ dependencies {
6064
implementation("$projectorClientGroup:projector-util-logging:$projectorClientVersion")
6165
api(project(":projector-awt"))
6266

63-
compileOnly("com.jetbrains.intellij.platform:code-style:$intellijPlatformVersion")
67+
if (intellijPlatformBuildNumber >= BuildNumber.fromString("203.5981.165")!!) {
68+
compileOnly("com.jetbrains.intellij.platform:code-style:$intellijPlatformVersion")
69+
} else {
70+
compileOnly("com.jetbrains.intellij.platform:lang:$intellijPlatformVersion")
71+
}
72+
6473
compileOnly("com.jetbrains.intellij.platform:core-ui:$intellijPlatformVersion")
6574
compileOnly("com.jetbrains.intellij.platform:ide-impl:$intellijPlatformVersion")
6675
compileOnly("org.jetbrains.intellij.deps.jcef:jcef:$intellijJcefVersion")

0 commit comments

Comments
 (0)