Skip to content

Commit

Permalink
Get rid of intellij Gradle plugin
Browse files Browse the repository at this point in the history
by adding dependencies explicitly.
  • Loading branch information
ting-yuan committed Jun 27, 2023
1 parent 448af70 commit 7523124
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 65 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ subprojects {
mavenCentral()
google()
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap/")
maven("https://www.jetbrains.com/intellij-repository/snapshots")
maven("https://www.jetbrains.com/intellij-repository/releases")
}
pluginManager.withPlugin("maven-publish") {
val publishExtension = extensions.getByType<PublishingExtension>()
Expand Down
27 changes: 21 additions & 6 deletions common-util/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,40 @@ description = "Kotlin Symbol Processing Util"

val kotlinBaseVersion: String by project
val intellijVersion: String by project
val junitVersion: String by project

tasks.withType<KotlinCompile> {
compilerOptions.freeCompilerArgs.add("-Xjvm-default=all-compatibility")
}

plugins {
kotlin("jvm")
id("org.jetbrains.intellij") version "0.6.4"
id("org.jetbrains.dokka") version ("1.7.20")
}

intellij {
version = intellijVersion
}

dependencies {
listOf(
"com.jetbrains.intellij.platform:util-rt",
"com.jetbrains.intellij.platform:util-class-loader",
"com.jetbrains.intellij.platform:util-text-matching",
"com.jetbrains.intellij.platform:util",
"com.jetbrains.intellij.platform:util-base",
"com.jetbrains.intellij.platform:util-xml-dom",
"com.jetbrains.intellij.platform:core",
"com.jetbrains.intellij.platform:core-impl",
"com.jetbrains.intellij.platform:extensions",
"com.jetbrains.intellij.java:java-psi",
"com.jetbrains.intellij.java:java-psi-impl",
).forEach {
implementation("$it:$intellijVersion") { isTransitive = false }
}

implementation(kotlin("stdlib", kotlinBaseVersion))
implementation("org.jetbrains.kotlin:kotlin-compiler:$kotlinBaseVersion")

compileOnly("org.jetbrains.kotlin:kotlin-compiler:$kotlinBaseVersion")

implementation(project(":api"))
testImplementation("junit:junit:$junitVersion")
}

val dokkaJavadocJar by tasks.register<Jar>("dokkaJavadocJar") {
Expand Down
41 changes: 26 additions & 15 deletions compiler-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ description = "Kotlin Symbol Processing"

val intellijVersion: String by project
val kotlinBaseVersion: String by project
val junitVersion: String by project
val junit5Version: String by project
val junitPlatformVersion: String by project

val libsForTesting by configurations.creating
val libsForTestingCommon by configurations.creating
Expand All @@ -16,14 +19,9 @@ tasks.withType<KotlinCompile> {

plugins {
kotlin("jvm")
id("org.jetbrains.intellij") version "0.6.4"
id("org.jetbrains.dokka") version ("1.7.20")
}

intellij {
version = intellijVersion
}

tasks {
val sourcesJar by creating(Jar::class) {
archiveClassifier.set("sources")
Expand All @@ -44,8 +42,25 @@ fun ModuleDependency.includeJars(vararg names: String) {

// WARNING: remember to update the dependencies in symbol-processing as well.
dependencies {
listOf(
"com.jetbrains.intellij.platform:util-rt",
"com.jetbrains.intellij.platform:util-class-loader",
"com.jetbrains.intellij.platform:util-text-matching",
"com.jetbrains.intellij.platform:util",
"com.jetbrains.intellij.platform:util-base",
"com.jetbrains.intellij.platform:util-xml-dom",
"com.jetbrains.intellij.platform:core",
"com.jetbrains.intellij.platform:core-impl",
"com.jetbrains.intellij.platform:extensions",
"com.jetbrains.intellij.java:java-psi",
"com.jetbrains.intellij.java:java-psi-impl",
).forEach {
implementation("$it:$intellijVersion") { isTransitive = false }
}

implementation(kotlin("stdlib", kotlinBaseVersion))
implementation("org.jetbrains.kotlin:kotlin-compiler:$kotlinBaseVersion")

compileOnly("org.jetbrains.kotlin:kotlin-compiler:$kotlinBaseVersion")

implementation(project(":api"))
implementation(project(":common-util"))
Expand All @@ -55,10 +70,11 @@ dependencies {
testImplementation("org.jetbrains.kotlin:kotlin-compiler-internal-test-framework:$kotlinBaseVersion")
testImplementation("org.jetbrains.kotlin:kotlin-scripting-compiler:$kotlinBaseVersion")

testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-params:5.8.2")
testRuntimeOnly("org.junit.platform:junit-platform-suite:1.8.2")
testImplementation("junit:junit:$junitVersion")
testImplementation("org.junit.jupiter:junit-jupiter-api:$junit5Version")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junit5Version")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-params:$junit5Version")
testRuntimeOnly("org.junit.platform:junit-platform-suite:$junitPlatformVersion")

testImplementation(project(":api"))
testImplementation(project(":common-util"))
Expand Down Expand Up @@ -118,11 +134,6 @@ tasks.test {
}
}

repositories {
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap/")
maven("https://www.jetbrains.com/intellij-repository/snapshots")
}

val dokkaJavadocJar by tasks.register<Jar>("dokkaJavadocJar") {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
dependsOn(tasks.dokkaJavadoc)
Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ kotlinBaseVersion=1.9.20-dev-4459
agpBaseVersion=7.0.0
intellijVersion=213.7172.25
junitVersion=4.12
junit5Version=5.8.2
junitPlatformVersion=1.8.2
googleTruthVersion=1.1
compilerTestEnabled=false
guavaVersion=29.0-jre

kotlin.jvm.target.validation.mode=warning
76 changes: 40 additions & 36 deletions kotlin-analysis-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,61 @@ description = "Kotlin Symbol Processing implementation using Kotlin Analysis API

val intellijVersion: String by project
val junitVersion: String by project
val junit5Version: String by project
val junitPlatformVersion: String by project
val guavaVersion: String by project
val kotlinBaseVersion: String by project
val libsForTesting by configurations.creating
val libsForTestingCommon by configurations.creating

plugins {
kotlin("jvm")
id("org.jetbrains.intellij") version "0.6.4"
id("org.jetbrains.dokka") version ("1.7.20")
}

intellij {
version = intellijVersion
}

dependencies {
listOf(
"com.jetbrains.intellij.platform:util-rt",
"com.jetbrains.intellij.platform:util-class-loader",
"com.jetbrains.intellij.platform:util-text-matching",
"com.jetbrains.intellij.platform:util",
"com.jetbrains.intellij.platform:util-base",
"com.jetbrains.intellij.platform:util-xml-dom",
"com.jetbrains.intellij.platform:core",
"com.jetbrains.intellij.platform:core-impl",
"com.jetbrains.intellij.platform:extensions",
"com.jetbrains.intellij.java:java-psi",
"com.jetbrains.intellij.java:java-psi-impl",
).forEach {
implementation("$it:$intellijVersion") { isTransitive = false }
}

listOf(
"org.jetbrains.kotlin:high-level-api-fir-for-ide",
"org.jetbrains.kotlin:high-level-api-for-ide",
"org.jetbrains.kotlin:low-level-api-fir-for-ide",
"org.jetbrains.kotlin:analysis-api-providers-for-ide",
"org.jetbrains.kotlin:analysis-project-structure-for-ide",
"org.jetbrains.kotlin:symbol-light-classes-for-ide",
"org.jetbrains.kotlin:analysis-api-standalone-for-ide",
"org.jetbrains.kotlin:high-level-api-impl-base-for-ide",
).forEach {
implementation("$it:$kotlinBaseVersion") { isTransitive = false }
}

implementation("org.jetbrains.kotlinx:kotlinx-collections-immutable-jvm:0.3.4")
implementation(kotlin("stdlib", kotlinBaseVersion))
implementation("org.jetbrains.kotlin:kotlin-compiler:$kotlinBaseVersion")

implementation("org.jetbrains.kotlin:high-level-api-fir-for-ide:$kotlinBaseVersion") {
isTransitive = false
}
implementation("org.jetbrains.kotlin:high-level-api-for-ide:$kotlinBaseVersion") {
isTransitive = false
}
implementation("org.jetbrains.kotlin:low-level-api-fir-for-ide:$kotlinBaseVersion") {
isTransitive = false
}
implementation("org.jetbrains.kotlin:analysis-api-providers-for-ide:$kotlinBaseVersion") {
isTransitive = false
}
implementation("org.jetbrains.kotlin:analysis-project-structure-for-ide:$kotlinBaseVersion") {
isTransitive = false
}
implementation("org.jetbrains.kotlin:symbol-light-classes-for-ide:$kotlinBaseVersion") {
isTransitive = false
}
implementation("org.jetbrains.kotlin:analysis-api-standalone-for-ide:$kotlinBaseVersion") {
isTransitive = false
}
implementation("org.jetbrains.kotlin:high-level-api-impl-base-for-ide:$kotlinBaseVersion") {
isTransitive = false
}
compileOnly("org.jetbrains.kotlin:kotlin-compiler:$kotlinBaseVersion")

implementation(project(":api"))
implementation(project(":common-util"))

testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-params:5.8.2")
testRuntimeOnly("org.junit.platform:junit-platform-suite:1.8.2")
testImplementation("junit:junit:$junitVersion")
testImplementation("org.junit.jupiter:junit-jupiter-api:$junit5Version")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junit5Version")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-params:$junit5Version")
testRuntimeOnly("org.junit.platform:junit-platform-suite:$junitPlatformVersion")

testImplementation(project(":test-utils"))
testImplementation(project(":api"))
Expand All @@ -63,6 +67,8 @@ dependencies {
testImplementation("org.jetbrains.kotlin:kotlin-compiler-internal-test-framework:$kotlinBaseVersion")
testImplementation("org.jetbrains.kotlin:kotlin-scripting-compiler:$kotlinBaseVersion")

testImplementation("com.google.guava:guava:$guavaVersion")

libsForTesting(kotlin("stdlib", kotlinBaseVersion))
libsForTesting(kotlin("test", kotlinBaseVersion))
libsForTesting(kotlin("script-runtime", kotlinBaseVersion))
Expand Down Expand Up @@ -125,7 +131,5 @@ repositories {
flatDir {
dirs("${project.rootDir}/third_party/prebuilt/repo/")
}
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap/")
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-ide-plugin-dependencies")
maven("https://www.jetbrains.com/intellij-repository/releases")
}
1 change: 0 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pluginManagement {
repositories {
gradlePluginPortal()
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap/")
maven("https://www.jetbrains.com/intellij-repository/snapshots")
}
}

Expand Down
8 changes: 2 additions & 6 deletions test-utils/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

val kotlinBaseVersion: String by project
val intellijVersion: String by project
val junit5Version: String by project

tasks.withType<KotlinCompile> {
compilerOptions.freeCompilerArgs.add("-Xjvm-default=all-compatibility")
Expand All @@ -22,13 +23,8 @@ dependencies {
implementation("org.jetbrains.kotlin:kotlin-compiler:$kotlinBaseVersion")
implementation("org.jetbrains.kotlin:kotlin-compiler-internal-test-framework:$kotlinBaseVersion")

implementation("org.junit.jupiter:junit-jupiter-api:5.8.2")
implementation("org.junit.jupiter:junit-jupiter-api:$junit5Version")

implementation(project(":api"))
implementation(project(":compiler-plugin"))
}

repositories {
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap/")
maven("https://www.jetbrains.com/intellij-repository/releases")
}

0 comments on commit 7523124

Please sign in to comment.