[K/N] Add build-tools as a module for IDEA

Adds a module to project making it able to use analysis
and syntax highlight

(cherry picked from commit c545fd5ef8)
This commit is contained in:
Pavel Punegov
2022-05-12 18:46:21 +03:00
committed by Space
parent be2c92a0bd
commit 987930a0e5
2 changed files with 29 additions and 35 deletions
+28 -35
View File
@@ -16,16 +16,19 @@ plugins {
}
buildscript {
val rootBuildDirectory by extra(project.file("../.."))
apply(from = rootBuildDirectory.resolve("kotlin-native/gradle/loadRootProperties.gradle"))
dependencies {
classpath("com.google.code.gson:gson:2.8.6")
classpath(commonDependency("com.google.code.gson:gson"))
}
}
val rootProperties = Properties().apply {
rootDir.resolve("../gradle.properties").reader().use(::load)
project(":kotlin-native").projectDir.resolve("gradle.properties").reader().use(::load)
}
val kotlinVersion: String by rootProperties
val kotlinVersion = project.bootstrapKotlinVersion
val konanVersion: String by rootProperties
val slackApiVersion: String by rootProperties
val ktorVersion: String by rootProperties
@@ -46,50 +49,40 @@ dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
implementation("com.ullink.slack:simpleslackapi:$slackApiVersion")
implementation("com.ullink.slack:simpleslackapi:$slackApiVersion") {
exclude(group = "com.google.code.gson", module = "gson") // Workaround for Gradle dependency resolution error
}
val versionPropertiesFile = project.rootProject.projectDir.resolve("gradle/versions.properties")
val versionProperties = Properties()
versionPropertiesFile.inputStream().use { propInput ->
versionProperties.load(propInput)
}
configurations.all {
resolutionStrategy.eachDependency {
if (requested.group == "com.google.code.gson" && requested.name == "gson") {
useVersion(versionProperties["versions.gson"] as String)
because("Force using same gson version because of https://github.com/google/gson/pull/1991")
}
}
}
implementation("io.ktor:ktor-client-auth:$ktorVersion")
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("io.ktor:ktor-client-cio:$ktorVersion")
api("org.jetbrains.kotlin:kotlin-native-utils:$kotlinVersion")
api(project(":native:kotlin-native-utils"))
// Located in <repo root>/shared and always provided by the composite build.
api("org.jetbrains.kotlin:kotlin-native-shared:$konanVersion")
implementation("gradle.plugin.com.github.johnrengelman:shadow:$shadowVersion")
implementation("org.jetbrains.kotlinx:kotlinx-metadata-klib:$metadataVersion")
// api("org.jetbrains.kotlin:kotlin-native-shared:$kotlinVersion")
// implementation("gradle.plugin.com.github.johnrengelman:shadow:$shadowVersion")
//
// implementation("org.jetbrains.kotlinx:kotlinx-metadata-klib:$metadataVersion")
}
sourceSets["main"].withConvention(KotlinSourceSet::class) {
kotlin.srcDir("$projectDir/../tools/benchmarks/shared/src/main/kotlin/report")
}
gradlePlugin {
plugins {
create("benchmarkPlugin") {
id = "benchmarking"
implementationClass = "org.jetbrains.kotlin.benchmark.KotlinNativeBenchmarkingPlugin"
}
create("compileBenchmarking") {
id = "compile-benchmarking"
implementationClass = "org.jetbrains.kotlin.benchmark.CompileBenchmarkingPlugin"
}
create("swiftBenchmarking") {
id = "swift-benchmarking"
implementationClass = "org.jetbrains.kotlin.benchmark.SwiftBenchmarkingPlugin"
}
create("compileToBitcode") {
id = "compile-to-bitcode"
implementationClass = "org.jetbrains.kotlin.bitcode.CompileToBitcodePlugin"
}
create("runtimeTesting") {
id = "runtime-testing"
implementationClass = "org.jetbrains.kotlin.testing.native.RuntimeTestingPlugin"
}
}
}
val compileKotlin: KotlinCompile by tasks
val compileGroovy: GroovyCompile by tasks
@@ -100,6 +93,6 @@ compileKotlin.apply {
// Add Kotlin classes to a classpath for the Groovy compiler
compileGroovy.apply {
classpath += project.files(compileKotlin.destinationDir)
classpath += project.files(compileKotlin.destinationDirectory)
dependsOn(compileKotlin)
}
+1
View File
@@ -783,4 +783,5 @@ if (buildProperties.isKotlinNativeEnabled) {
include ':kotlin-native:backend.native:tests'
include ":kotlin-native-compiler-embeddable"
project(":kotlin-native-compiler-embeddable").projectDir = "$rootDir/kotlin-native/prepare/kotlin-native-embeddable-compiler" as File
include ':kotlin-native:build-tools'
}