[Build] Fix a bunch of buildscript compilation warnings

#KTI-1221 Fixed
This commit is contained in:
Alexander.Likhachev
2023-05-17 15:57:56 +02:00
committed by Space Team
parent 46e83ef7da
commit a93c49baf1
17 changed files with 32 additions and 32 deletions
+3 -3
View File
@@ -430,7 +430,7 @@ allprojects {
val isReflect = requested.name == "kotlin-reflect" || requested.name == "kotlin-reflect-api"
// More strict check for "compilerModules". We can't apply this check for all modules because it would force to
// exclude kotlin-reflect from transitive dependencies of kotlin-poet, ktor, com.android.tools.build:gradle, etc
if (project.path in (rootProject.extra["compilerModules"] as Array<String>)) {
if (project.path in @Suppress("UNCHECKED_CAST") (rootProject.extra["compilerModules"] as Array<String>)) {
val expectedReflectVersion = commonDependencyVersion("org.jetbrains.kotlin", "kotlin-reflect")
if (isReflect) {
check(requested.version == expectedReflectVersion) {
@@ -934,9 +934,9 @@ gradle.taskGraph.whenReady(checkYarnAndNPMSuppressed)
plugins.withType(org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin::class) {
extensions.configure(org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension::class.java) {
npmInstallTaskProvider?.configure {
npmInstallTaskProvider.configure {
args += listOf("--network-concurrency", "1", "--mutex", "network")
} ?: error("kotlinNpmInstall task should exist inside NodeJsRootExtension")
}
}
}
+1 -1
View File
@@ -59,7 +59,7 @@ sourceSets {
}
tasks {
val compileKotlin by existing(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class) {
named<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>("compileKotlin") {
kotlinOptions {
freeCompilerArgs += "-opt-in=org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI"
}
+1 -1
View File
@@ -17,7 +17,7 @@ sourceSets {
}
tasks {
val compileKotlin by existing(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class) {
named<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>("compileKotlin") {
kotlinOptions {
freeCompilerArgs += "-opt-in=org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI"
}
@@ -22,7 +22,7 @@ sourceSets {
}
tasks {
val compileKotlin by existing(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class) {
named<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>("compileKotlin") {
kotlinOptions {
freeCompilerArgs += "-opt-in=org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI"
}
-2
View File
@@ -23,8 +23,6 @@ org.gradle.java.installations.fromEnv=\
systemProp.org.gradle.internal.http.connectionTimeout=90000
systemProp.org.gradle.internal.http.socketTimeout=90000
# Enable caching for precompiled script accessors: https://github.com/gradle/gradle/issues/20416
systemProp.org.gradle.kotlin.dsl.precompiled.accessors.strict=true
cacheRedirectorEnabled=true
defaultSnapshotVersion=1.9.255-SNAPSHOT
+2 -2
View File
@@ -535,7 +535,7 @@ fun RecursiveArtifact.sourceJarsFromConfiguration(configuration: Configuration,
.map { it.id.componentIdentifier }
.filterIsInstance<ProjectComponentIdentifier>()
.forEach {
val jarBaseName = project(it.projectPath).the<BasePluginConvention>().archivesBaseName
val jarBaseName = project(it.projectPath).the<BasePluginExtension>().archivesName.get()
val renamed = renamer("$jarBaseName-sources") + ".jar"
archive(renamed) {
project(it.projectPath)
@@ -560,7 +560,7 @@ fun RecursiveArtifact.jarsFromConfiguration(configuration: Configuration, rename
.map { it.id.componentIdentifier }
.filterIsInstance<ProjectComponentIdentifier>()
.forEach {
val jarBaseName = project(it.projectPath).the<BasePluginConvention>().archivesBaseName
val jarBaseName = project(it.projectPath).the<BasePluginExtension>().archivesName.get()
val artifactName = renamer(jarBaseName) + ".jar"
if (it.projectName in jarArtifactProjects) {
artifact(artifactName)
+1 -1
View File
@@ -54,7 +54,7 @@ private class BuildTimeReporter(
UNCATEGORIZED;
private fun String.toTitleCase() =
if (length <= 1) capitalize() else { get(0).toUpperCase() + substring(1).toLowerCase() }
if (length <= 1) capitalize() else { get(0).uppercase() + substring(1).lowercase() }
fun description(): String =
name.replace("_", " ").toTitleCase()
+3 -3
View File
@@ -28,16 +28,16 @@ kotlin {
}
sourceSets {
val commonMain by getting {
named("commonMain") {
dependencies {
api(project(":kotlin-stdlib-js-ir"))
}
kotlin.srcDir(commonMainSources.get().destinationDir)
}
val commonTest by getting {
named("commonTest") {
kotlin.srcDir(commonTestSources.get().destinationDir)
}
val jsMain by getting {
named("jsMain") {
dependencies {
api(project(":kotlin-stdlib-js-ir"))
}
@@ -38,7 +38,7 @@ kotlin {
}
sourceSets {
val test by getting {
named("test") {
kotlin.srcDir(jsMainSources.get().destinationDir)
}
}
@@ -78,7 +78,7 @@ fun createFrameworkTest(name: String): TaskProvider<NpmTask> {
return tasks.register("test$name", NpmTask::class.java) {
dependsOn(compileTestDevelopmentExecutableKotlinJs, populateNodeModules, "npmInstall")
val testName = name
val lowerName = name.toLowerCase()
val lowerName = name.lowercase()
val tcOutput = project.file("$buildDir/tc-${lowerName}.log")
val stdOutput = "$buildDir/test-${lowerName}.log"
val errOutput = "$buildDir/test-${lowerName}.err.log"
+3 -3
View File
@@ -13,20 +13,20 @@ val commonMainSources by task<Sync> {
}
kotlin {
@OptIn(org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl::class)
wasm {
nodejs()
}
@Suppress("UNUSED_VARIABLE")
sourceSets {
val commonMain by getting {
named("commonMain") {
dependencies {
api(project(":kotlin-stdlib-wasm"))
}
kotlin.srcDir(commonMainSources.get().destinationDir)
}
val wasmMain by getting {
named("wasmMain") {
dependencies {
api(project(":kotlin-stdlib-wasm"))
}
@@ -125,11 +125,11 @@ val jsMainSources by task<Sync> {
kotlin {
sourceSets {
val commonMain by getting {
named("commonMain") {
kotlin.srcDir(files(commonMainSources.map { it.destinationDir }))
kotlin.srcDir(files(commonMainCollectionSources.map { it.destinationDir }))
}
val jsMain by getting {
named("jsMain") {
kotlin.srcDir(files(jsMainSources.map { it.destinationDir }))
}
}
+4 -4
View File
@@ -113,22 +113,22 @@ val jsTestSources by task<Sync> {
kotlin {
sourceSets {
val commonMain by getting {
named("commonMain") {
kotlin.srcDir(files(commonMainSources.map { it.destinationDir }))
}
val jsMain by getting {
named("jsMain") {
kotlin.srcDir(files(jsMainSources.map { it.destinationDir }))
kotlin.srcDir("builtins")
kotlin.srcDir("runtime")
kotlin.srcDir("src")
}
val commonTest by getting {
named("commonTest") {
dependencies {
api(project(":kotlin-test:kotlin-test-js-ir"))
}
kotlin.srcDir(files(commonTestSources.map { it.destinationDir }))
}
val jsTest by getting {
named("jsTest") {
dependencies {
api(project(":kotlin-test:kotlin-test-js-ir"))
}
+5 -4
View File
@@ -78,29 +78,30 @@ val commonTestSources by task<Sync> {
D8RootPlugin.apply(rootProject).version = v8Version
kotlin {
@OptIn(org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl::class)
wasm {
d8()
}
sourceSets {
val wasmMain by getting {
named("wasmMain") {
kotlin.srcDirs("builtins", "internal", "runtime", "src", "stubs")
kotlin.srcDirs("$rootDir/libraries/stdlib/native-wasm/src")
kotlin.srcDirs(files(builtInsSources.map { it.destinationDir }))
}
val commonMain by getting {
named("commonMain") {
kotlin.srcDirs(files(commonMainSources.map { it.destinationDir }))
}
val commonTest by getting {
named("commonTest") {
dependencies {
api(project(":kotlin-test:kotlin-test-wasm"))
}
kotlin.srcDir(files(commonTestSources.map { it.destinationDir }))
}
val wasmTest by getting {
named("wasmTest") {
dependencies {
api(project(":kotlin-test:kotlin-test-wasm"))
}
@@ -336,7 +336,7 @@ if (!kotlinBuildProperties.isInJpsBuildIdeaSync) {
implementation(project(":kotlin-tooling-metadata"))
implementation(project.dependencies.testFixtures(project(":kotlin-gradle-plugin-idea")))
implementation("com.github.gundy:semver4j:0.16.4:nodeps") {
(this as ExternalModuleDependency).exclude(group = "*")
exclude(group = "*")
}
implementation("org.reflections:reflections:0.10.2")
}
@@ -1,4 +1,4 @@
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompile
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
plugins {
kotlin("jvm")
@@ -4,6 +4,7 @@ idePluginDependency {
val embeddedDependencies = rootProject.extra["kotlinJpsPluginEmbeddedDependencies"] as List<String>
@Suppress("UNCHECKED_CAST")
val mavenDependencies = rootProject.extra["kotlinJpsPluginMavenDependencies"] as List<String>
@Suppress("UNCHECKED_CAST")
val mavenDependenciesLibs = rootProject.extra["kotlinJpsPluginMavenDependenciesNonTransitiveLibs"] as List<String>
val otherProjects = listOf(":jps:jps-plugin", ":jps:jps-common")
+1 -1
View File
@@ -33,7 +33,7 @@ val currentOsType = run {
val osArch = when (providers.systemProperty("sun.arch.data.model").get()) {
"32" -> OsArch.X86_32
"64" -> when (providers.systemProperty("os.arch").get().toLowerCase()) {
"64" -> when (providers.systemProperty("os.arch").get().lowercase()) {
"aarch64" -> OsArch.ARM64
else -> OsArch.X86_64
}