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

Commit

Permalink
Simplify building with different Intellij Platform dependencies versions
Browse files Browse the repository at this point in the history
  • Loading branch information
ARTI1208 committed Feb 15, 2022
1 parent 0beb53f commit 2a6ef9c
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ subprojects {
repositories {
mavenCentral()
maven("https://www.jetbrains.com/intellij-repository/releases")
maven("https://www.jetbrains.com/intellij-repository/snapshots")
maven("https://cache-redirector.jetbrains.com/intellij-dependencies")
}

Expand Down
21 changes: 21 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,33 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

import java.util.*

plugins {
`kotlin-dsl`
}

repositories {
mavenCentral()
maven("https://www.jetbrains.com/intellij-repository/releases")
maven("https://www.jetbrains.com/intellij-repository/snapshots")
maven("https://cache-redirector.jetbrains.com/intellij-dependencies")
}


val gradleProperties = Properties()
val gradlePropertiesFile = project.file("../gradle.properties")
if (gradlePropertiesFile.canRead()) {
gradleProperties.load(gradlePropertiesFile.inputStream())
}

val intellijPlatformVersion: String by gradleProperties

dependencies {
implementation("com.jetbrains.intellij.platform:core:$intellijPlatformVersion") {
exclude(group = "org.jetbrains.kotlin") // cannot find these dependencies
}
}

kotlin {
Expand Down
12 changes: 11 additions & 1 deletion projector-util-loading/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import com.intellij.openapi.util.BuildNumber

plugins {
kotlin("jvm")
`maven-publish`
Expand All @@ -38,13 +40,21 @@ publishToSpace("java")
val coroutinesVersion: String by project
val intellijPlatformVersion: String by project

val intelliJVersionRemovedSuffix = intellijPlatformVersion.takeWhile { it.isDigit() || it == '.' } // in case of EAP
val intellijPlatformBuildNumber = BuildNumber.fromString(intelliJVersionRemovedSuffix)!!

dependencies {
api(project(":projector-util-logging"))

implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")

compileOnly("com.jetbrains.intellij.platform:bootstrap:$intellijPlatformVersion")
compileOnly("com.jetbrains.intellij.platform:util-base:$intellijPlatformVersion")

if (intellijPlatformBuildNumber >= BuildNumber.fromString("213.6461.77")!!) {
compileOnly("com.jetbrains.intellij.platform:util-base:$intellijPlatformVersion")
} else {
compileOnly("com.jetbrains.intellij.platform:util-diagnostic:$intellijPlatformVersion")
}

testImplementation(kotlin("test"))
}

0 comments on commit 2a6ef9c

Please sign in to comment.