Fix some warnings in Gradle plugin and related modules
This commit is contained in:
@@ -250,6 +250,7 @@ private fun Printer.generateDeclaration(
|
|||||||
println("package ${type.parent()}")
|
println("package ${type.parent()}")
|
||||||
println()
|
println()
|
||||||
}
|
}
|
||||||
|
println("@Suppress(\"DEPRECATION\")")
|
||||||
print("$modifiers ${type.shortName()} ")
|
print("$modifiers ${type.shortName()} ")
|
||||||
afterType?.let { print("$afterType ") }
|
afterType?.let { print("$afterType ") }
|
||||||
println("{")
|
println("{")
|
||||||
|
|||||||
+5
-5
@@ -16,16 +16,16 @@
|
|||||||
|
|
||||||
package example
|
package example
|
||||||
|
|
||||||
|
import com.intellij.mock.MockProject
|
||||||
import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys
|
import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys
|
||||||
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
|
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
|
||||||
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
|
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
|
||||||
import org.jetbrains.kotlin.config.CompilerConfigurationKey
|
|
||||||
import org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor
|
|
||||||
import org.jetbrains.kotlin.compiler.plugin.CliOption
|
import org.jetbrains.kotlin.compiler.plugin.CliOption
|
||||||
import org.jetbrains.kotlin.config.CompilerConfiguration
|
|
||||||
import org.jetbrains.kotlin.compiler.plugin.CliOptionProcessingException
|
import org.jetbrains.kotlin.compiler.plugin.CliOptionProcessingException
|
||||||
|
import org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor
|
||||||
import org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
|
import org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
|
||||||
import com.intellij.mock.MockProject
|
import org.jetbrains.kotlin.config.CompilerConfiguration
|
||||||
|
import org.jetbrains.kotlin.config.CompilerConfigurationKey
|
||||||
|
|
||||||
public object ExampleConfigurationKeys {
|
public object ExampleConfigurationKeys {
|
||||||
public val EXAMPLE_KEY: CompilerConfigurationKey<String> = CompilerConfigurationKey.create<String>("example argument")
|
public val EXAMPLE_KEY: CompilerConfigurationKey<String> = CompilerConfigurationKey.create<String>("example argument")
|
||||||
@@ -46,7 +46,7 @@ public class ExampleCommandLineProcessor : CommandLineProcessor {
|
|||||||
when (option) {
|
when (option) {
|
||||||
EXAMPLE_OPTION -> configuration.put(ExampleConfigurationKeys.EXAMPLE_KEY, value)
|
EXAMPLE_OPTION -> configuration.put(ExampleConfigurationKeys.EXAMPLE_KEY, value)
|
||||||
EXAMPLE_LEGACY_OPTION -> configuration.put(ExampleConfigurationKeys.EXAMPLE_LEGACY_KEY, value)
|
EXAMPLE_LEGACY_OPTION -> configuration.put(ExampleConfigurationKeys.EXAMPLE_LEGACY_KEY, value)
|
||||||
else -> throw CliOptionProcessingException("Unknown option: ${option.name}")
|
else -> throw CliOptionProcessingException("Unknown option: ${option.optionName}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ import org.gradle.api.Project
|
|||||||
import org.gradle.api.tasks.compile.AbstractCompile
|
import org.gradle.api.tasks.compile.AbstractCompile
|
||||||
import org.jetbrains.kotlin.gradle.plugin.*
|
import org.jetbrains.kotlin.gradle.plugin.*
|
||||||
|
|
||||||
class ExampleLegacySubplugin : KotlinGradleSubplugin<AbstractCompile> {
|
class ExampleLegacySubplugin : @Suppress("DEPRECATION") KotlinGradleSubplugin<AbstractCompile> {
|
||||||
|
|
||||||
override fun isApplicable(project: Project, task: AbstractCompile): Boolean {
|
override fun isApplicable(project: Project, task: AbstractCompile): Boolean {
|
||||||
return true
|
return true
|
||||||
|
|||||||
+1
@@ -2,6 +2,7 @@
|
|||||||
// Generated by org/jetbrains/kotlin/generators/arguments/GenerateGradleOptions.kt
|
// Generated by org/jetbrains/kotlin/generators/arguments/GenerateGradleOptions.kt
|
||||||
package org.jetbrains.kotlin.gradle.dsl
|
package org.jetbrains.kotlin.gradle.dsl
|
||||||
|
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
interface KotlinCommonOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonToolOptions {
|
interface KotlinCommonOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonToolOptions {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+1
@@ -2,6 +2,7 @@
|
|||||||
// Generated by org/jetbrains/kotlin/generators/arguments/GenerateGradleOptions.kt
|
// Generated by org/jetbrains/kotlin/generators/arguments/GenerateGradleOptions.kt
|
||||||
package org.jetbrains.kotlin.gradle.dsl
|
package org.jetbrains.kotlin.gradle.dsl
|
||||||
|
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
interface KotlinCommonToolOptions {
|
interface KotlinCommonToolOptions {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+13
-8
@@ -1,3 +1,8 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
package org.jetbrains.kotlin.gradle
|
package org.jetbrains.kotlin.gradle
|
||||||
|
|
||||||
import com.intellij.testFramework.TestDataFile
|
import com.intellij.testFramework.TestDataFile
|
||||||
@@ -464,11 +469,11 @@ abstract class BaseGradleIT {
|
|||||||
|
|
||||||
val errors = "(?m)^.*\\[ERROR] \\[\\S+] (.*)$".toRegex().findAll(output)
|
val errors = "(?m)^.*\\[ERROR] \\[\\S+] (.*)$".toRegex().findAll(output)
|
||||||
val errorMessage = buildString {
|
val errorMessage = buildString {
|
||||||
appendln("Gradle build failed")
|
appendLine("Gradle build failed")
|
||||||
appendln()
|
appendLine()
|
||||||
if (errors.any()) {
|
if (errors.any()) {
|
||||||
appendln("Possible errors:")
|
appendLine("Possible errors:")
|
||||||
errors.forEach { match -> appendln(match.groupValues[1]) }
|
errors.forEach { match -> appendLine(match.groupValues[1]) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fail(errorMessage)
|
fail(errorMessage)
|
||||||
@@ -863,10 +868,10 @@ Finished executing task ':$taskName'|
|
|||||||
}
|
}
|
||||||
|
|
||||||
val xmlString = buildString {
|
val xmlString = buildString {
|
||||||
appendln("<?xml version=\"1.0\" encoding=\"UTF-8\"?>")
|
appendLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>")
|
||||||
appendln("<results>")
|
appendLine("<results>")
|
||||||
files.forEach { file ->
|
files.forEach { file ->
|
||||||
appendln(
|
appendLine(
|
||||||
file.readText()
|
file.readText()
|
||||||
.trimTrailingWhitespaces()
|
.trimTrailingWhitespaces()
|
||||||
.replace(projectDir.absolutePath, "/\$PROJECT_DIR$")
|
.replace(projectDir.absolutePath, "/\$PROJECT_DIR$")
|
||||||
@@ -874,7 +879,7 @@ Finished executing task ':$taskName'|
|
|||||||
.replace("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n", "")
|
.replace("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n", "")
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
appendln("</results>")
|
appendLine("</results>")
|
||||||
}
|
}
|
||||||
|
|
||||||
val doc = SAXBuilder().build(xmlString.reader())
|
val doc = SAXBuilder().build(xmlString.reader())
|
||||||
|
|||||||
+1
-1
@@ -75,7 +75,7 @@ class KotlinGradleIT : BaseGradleIT() {
|
|||||||
wd1.deleteRecursively()
|
wd1.deleteRecursively()
|
||||||
if (wd1.exists()) {
|
if (wd1.exists()) {
|
||||||
val files = buildString {
|
val files = buildString {
|
||||||
wd1.walk().forEach { appendln(" " + it.relativeTo(wd1).path) }
|
wd1.walk().forEach { appendLine(" " + it.relativeTo(wd1).path) }
|
||||||
}
|
}
|
||||||
error("Some files in $wd1 were not removed:\n$files")
|
error("Some files in $wd1 were not removed:\n$files")
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-6
@@ -55,11 +55,11 @@ class MppHighlightingTestDataWithGradleIT : BaseGradleIT() {
|
|||||||
|
|
||||||
// create Gradle Kotlin source sets for project roots:
|
// create Gradle Kotlin source sets for project roots:
|
||||||
val scriptCustomization = buildString {
|
val scriptCustomization = buildString {
|
||||||
appendln()
|
appendLine()
|
||||||
appendln("kotlin {\n sourceSets {")
|
appendLine("kotlin {\n sourceSets {")
|
||||||
sourceRoots.forEach { sourceRoot ->
|
sourceRoots.forEach { sourceRoot ->
|
||||||
if (sourceRoot.kotlinSourceSetName != "commonMain") {
|
if (sourceRoot.kotlinSourceSetName != "commonMain") {
|
||||||
appendln(
|
appendLine(
|
||||||
""" create("${sourceRoot.kotlinSourceSetName}") {
|
""" create("${sourceRoot.kotlinSourceSetName}") {
|
||||||
| dependsOn(getByName("commonMain"))
|
| dependsOn(getByName("commonMain"))
|
||||||
| listOf(${cliCompiler.targets.joinToString { "$it()" }}).forEach {
|
| listOf(${cliCompiler.targets.joinToString { "$it()" }}).forEach {
|
||||||
@@ -70,7 +70,7 @@ class MppHighlightingTestDataWithGradleIT : BaseGradleIT() {
|
|||||||
""".trimMargin()
|
""".trimMargin()
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
appendln(" // commonMain source set used for common module")
|
appendLine(" // commonMain source set used for common module")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,11 +79,11 @@ class MppHighlightingTestDataWithGradleIT : BaseGradleIT() {
|
|||||||
sourceRoot.dependencies.forEach { dependency ->
|
sourceRoot.dependencies.forEach { dependency ->
|
||||||
sourceRoots.find { it.qualifiedName == dependency }?.let { depSourceRoot ->
|
sourceRoots.find { it.qualifiedName == dependency }?.let { depSourceRoot ->
|
||||||
val depSourceSet = depSourceRoot.kotlinSourceSetName
|
val depSourceSet = depSourceRoot.kotlinSourceSetName
|
||||||
appendln(""" getByName("${sourceRoot.kotlinSourceSetName}").dependsOn(getByName("$depSourceSet"))""")
|
appendLine(""" getByName("${sourceRoot.kotlinSourceSetName}").dependsOn(getByName("$depSourceSet"))""")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
appendln(" }\n}")
|
appendLine(" }\n}")
|
||||||
}
|
}
|
||||||
|
|
||||||
gradleBuildScript().appendText("\n" + scriptCustomization)
|
gradleBuildScript().appendText("\n" + scriptCustomization)
|
||||||
|
|||||||
+7
@@ -1,3 +1,8 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
package org.jetbrains.kotlin.gradle.util
|
package org.jetbrains.kotlin.gradle.util
|
||||||
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
@@ -70,7 +75,9 @@ fun normalizePath(path: String): String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun normalizeTail(prefixEnd: Int, path: String, separator: Boolean): String {
|
private fun normalizeTail(prefixEnd: Int, path: String, separator: Boolean): String {
|
||||||
|
@Suppress("NAME_SHADOWING")
|
||||||
var separator = separator
|
var separator = separator
|
||||||
|
|
||||||
val result = StringBuilder(path.length)
|
val result = StringBuilder(path.length)
|
||||||
result.append(path, 0, prefixEnd)
|
result.append(path, 0, prefixEnd)
|
||||||
var start = prefixEnd
|
var start = prefixEnd
|
||||||
|
|||||||
+7
-1
@@ -1,6 +1,12 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
package org.jetbrains.kotlin.gradle.util
|
package org.jetbrains.kotlin.gradle.util
|
||||||
|
|
||||||
import org.jetbrains.kotlin.gradle.BaseGradleIT
|
import org.jetbrains.kotlin.gradle.BaseGradleIT
|
||||||
|
import org.jetbrains.kotlin.gradle.SYSTEM_LINE_SEPARATOR
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
class ProcessRunResult(
|
class ProcessRunResult(
|
||||||
@@ -39,7 +45,7 @@ fun runProcess(
|
|||||||
if (options?.forceOutputToStdout ?: false) {
|
if (options?.forceOutputToStdout ?: false) {
|
||||||
println(it)
|
println(it)
|
||||||
}
|
}
|
||||||
sb.appendln(it)
|
sb.append(it).append(SYSTEM_LINE_SEPARATOR)
|
||||||
}
|
}
|
||||||
val exitCode = process.waitFor()
|
val exitCode = process.waitFor()
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -406,8 +406,8 @@ class CInteropCommonizerTaskTest : MultiplatformExtensionTest() {
|
|||||||
iosX64.testCinteropIdentifier("iosX64TestHelper")
|
iosX64.testCinteropIdentifier("iosX64TestHelper")
|
||||||
)
|
)
|
||||||
|
|
||||||
val mainGroup = groups.maxBy { it.targets.size }!!
|
val mainGroup = groups.maxByOrNull { it.targets.size }!!
|
||||||
val testGroup = groups.minBy { it.targets.size }!!
|
val testGroup = groups.minByOrNull { it.targets.size }!!
|
||||||
|
|
||||||
assertEquals(
|
assertEquals(
|
||||||
expectedMainGroup, mainGroup,
|
expectedMainGroup, mainGroup,
|
||||||
|
|||||||
+1
@@ -2,6 +2,7 @@
|
|||||||
// Generated by org/jetbrains/kotlin/generators/arguments/GenerateGradleOptions.kt
|
// Generated by org/jetbrains/kotlin/generators/arguments/GenerateGradleOptions.kt
|
||||||
package org.jetbrains.kotlin.gradle.dsl
|
package org.jetbrains.kotlin.gradle.dsl
|
||||||
|
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
interface KotlinJsDceOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonToolOptions {
|
interface KotlinJsDceOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonToolOptions {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+1
@@ -2,6 +2,7 @@
|
|||||||
// Generated by org/jetbrains/kotlin/generators/arguments/GenerateGradleOptions.kt
|
// Generated by org/jetbrains/kotlin/generators/arguments/GenerateGradleOptions.kt
|
||||||
package org.jetbrains.kotlin.gradle.dsl
|
package org.jetbrains.kotlin.gradle.dsl
|
||||||
|
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
internal abstract class KotlinJsDceOptionsBase : org.jetbrains.kotlin.gradle.dsl.KotlinJsDceOptions {
|
internal abstract class KotlinJsDceOptionsBase : org.jetbrains.kotlin.gradle.dsl.KotlinJsDceOptions {
|
||||||
|
|
||||||
private var allWarningsAsErrorsField: kotlin.Boolean? = null
|
private var allWarningsAsErrorsField: kotlin.Boolean? = null
|
||||||
|
|||||||
+1
@@ -2,6 +2,7 @@
|
|||||||
// Generated by org/jetbrains/kotlin/generators/arguments/GenerateGradleOptions.kt
|
// Generated by org/jetbrains/kotlin/generators/arguments/GenerateGradleOptions.kt
|
||||||
package org.jetbrains.kotlin.gradle.dsl
|
package org.jetbrains.kotlin.gradle.dsl
|
||||||
|
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
interface KotlinJsOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonOptions {
|
interface KotlinJsOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonOptions {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+1
@@ -2,6 +2,7 @@
|
|||||||
// Generated by org/jetbrains/kotlin/generators/arguments/GenerateGradleOptions.kt
|
// Generated by org/jetbrains/kotlin/generators/arguments/GenerateGradleOptions.kt
|
||||||
package org.jetbrains.kotlin.gradle.dsl
|
package org.jetbrains.kotlin.gradle.dsl
|
||||||
|
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
internal abstract class KotlinJsOptionsBase : org.jetbrains.kotlin.gradle.dsl.KotlinJsOptions {
|
internal abstract class KotlinJsOptionsBase : org.jetbrains.kotlin.gradle.dsl.KotlinJsOptions {
|
||||||
|
|
||||||
private var allWarningsAsErrorsField: kotlin.Boolean? = null
|
private var allWarningsAsErrorsField: kotlin.Boolean? = null
|
||||||
|
|||||||
+1
@@ -2,6 +2,7 @@
|
|||||||
// Generated by org/jetbrains/kotlin/generators/arguments/GenerateGradleOptions.kt
|
// Generated by org/jetbrains/kotlin/generators/arguments/GenerateGradleOptions.kt
|
||||||
package org.jetbrains.kotlin.gradle.dsl
|
package org.jetbrains.kotlin.gradle.dsl
|
||||||
|
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
interface KotlinJvmOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonOptions {
|
interface KotlinJvmOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonOptions {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+1
@@ -2,6 +2,7 @@
|
|||||||
// Generated by org/jetbrains/kotlin/generators/arguments/GenerateGradleOptions.kt
|
// Generated by org/jetbrains/kotlin/generators/arguments/GenerateGradleOptions.kt
|
||||||
package org.jetbrains.kotlin.gradle.dsl
|
package org.jetbrains.kotlin.gradle.dsl
|
||||||
|
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
internal abstract class KotlinJvmOptionsBase : org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions {
|
internal abstract class KotlinJvmOptionsBase : org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions {
|
||||||
|
|
||||||
private var allWarningsAsErrorsField: kotlin.Boolean? = null
|
private var allWarningsAsErrorsField: kotlin.Boolean? = null
|
||||||
|
|||||||
+1
@@ -2,5 +2,6 @@
|
|||||||
// Generated by org/jetbrains/kotlin/generators/arguments/GenerateGradleOptions.kt
|
// Generated by org/jetbrains/kotlin/generators/arguments/GenerateGradleOptions.kt
|
||||||
package org.jetbrains.kotlin.gradle.dsl
|
package org.jetbrains.kotlin.gradle.dsl
|
||||||
|
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
interface KotlinMultiplatformCommonOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonOptions {
|
interface KotlinMultiplatformCommonOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonOptions {
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -2,6 +2,7 @@
|
|||||||
// Generated by org/jetbrains/kotlin/generators/arguments/GenerateGradleOptions.kt
|
// Generated by org/jetbrains/kotlin/generators/arguments/GenerateGradleOptions.kt
|
||||||
package org.jetbrains.kotlin.gradle.dsl
|
package org.jetbrains.kotlin.gradle.dsl
|
||||||
|
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
internal abstract class KotlinMultiplatformCommonOptionsBase : org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformCommonOptions {
|
internal abstract class KotlinMultiplatformCommonOptionsBase : org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformCommonOptions {
|
||||||
|
|
||||||
private var allWarningsAsErrorsField: kotlin.Boolean? = null
|
private var allWarningsAsErrorsField: kotlin.Boolean? = null
|
||||||
|
|||||||
+1
@@ -73,6 +73,7 @@ object ClasspathChangesComputer {
|
|||||||
return Success
|
return Success
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("UNUSED_PARAMETER")
|
||||||
private fun collectClassChanges(
|
private fun collectClassChanges(
|
||||||
current: ClassSnapshot,
|
current: ClassSnapshot,
|
||||||
previous: ClassSnapshot,
|
previous: ClassSnapshot,
|
||||||
|
|||||||
+1
@@ -30,6 +30,7 @@ object ClasspathEntrySnapshotter {
|
|||||||
@Suppress("SpellCheckingInspection")
|
@Suppress("SpellCheckingInspection")
|
||||||
object ClassSnapshotter {
|
object ClassSnapshotter {
|
||||||
|
|
||||||
|
@Suppress("UNUSED_PARAMETER")
|
||||||
fun snapshot(invariantSeparatorsRelativePath: String, classContents: ByteArray): ClassSnapshot {
|
fun snapshot(invariantSeparatorsRelativePath: String, classContents: ByteArray): ClassSnapshot {
|
||||||
// TODO WORK-IN-PROGRESS
|
// TODO WORK-IN-PROGRESS
|
||||||
return ClassSnapshot()
|
return ClassSnapshot()
|
||||||
|
|||||||
+4
-1
@@ -110,7 +110,10 @@ internal open class KotlinJvmCompilerArgumentsContributor(
|
|||||||
|
|
||||||
private fun warnJdkHomeNotUsed(kotlinOptions: List<KotlinJvmOptionsImpl>) {
|
private fun warnJdkHomeNotUsed(kotlinOptions: List<KotlinJvmOptionsImpl>) {
|
||||||
kotlinOptions
|
kotlinOptions
|
||||||
.firstOrNull { it.jdkHome != null }
|
.firstOrNull {
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
|
it.jdkHome != null
|
||||||
|
}
|
||||||
?.run {
|
?.run {
|
||||||
logger.warn(
|
logger.warn(
|
||||||
"""
|
"""
|
||||||
|
|||||||
+1
-1
@@ -44,7 +44,7 @@ internal class KotlinCompilationsModuleGroups {
|
|||||||
val newLeader = singleOrNull { it.isMain() }
|
val newLeader = singleOrNull { it.isMain() }
|
||||||
?: singleOrNull { it.name.contains("main", true) }
|
?: singleOrNull { it.name.contains("main", true) }
|
||||||
?: singleOrNull { !it.name.contains("test", true) }
|
?: singleOrNull { !it.name.contains("test", true) }
|
||||||
?: minBy { it.name }!!
|
?: minByOrNull { it.name }!!
|
||||||
|
|
||||||
forEach { moduleLeaderCompilationMap[it] = newLeader }
|
forEach { moduleLeaderCompilationMap[it] = newLeader }
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -167,11 +167,11 @@ private abstract class NpmDependencyExtensionDelegate(
|
|||||||
return when (val arg = args[0]) {
|
return when (val arg = args[0]) {
|
||||||
is String -> withName(
|
is String -> withName(
|
||||||
name = arg,
|
name = arg,
|
||||||
args = *args
|
args = args
|
||||||
)
|
)
|
||||||
is GString -> withName(
|
is GString -> withName(
|
||||||
name = arg.toString(),
|
name = arg.toString(),
|
||||||
args = *args
|
args = args
|
||||||
)
|
)
|
||||||
else -> processNonStringFirstArgument(arg, *args)
|
else -> processNonStringFirstArgument(arg, *args)
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-1
@@ -1,3 +1,8 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
package org.jetbrains.kotlin.gradle.internal.testing
|
package org.jetbrains.kotlin.gradle.internal.testing
|
||||||
|
|
||||||
import org.gradle.api.internal.tasks.testing.*
|
import org.gradle.api.internal.tasks.testing.*
|
||||||
@@ -9,7 +14,7 @@ class RecordingTestResultProcessor : TestResultProcessor {
|
|||||||
|
|
||||||
fun line(line: String) {
|
fun line(line: String) {
|
||||||
repeat(indent) { output.append(" ") }
|
repeat(indent) { output.append(" ") }
|
||||||
output.appendln(line)
|
output.append(line).append("\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun started(test: TestDescriptorInternal, event: TestStartEvent) {
|
override fun started(test: TestDescriptorInternal, event: TestStartEvent) {
|
||||||
|
|||||||
+1
-1
@@ -311,7 +311,7 @@ class MockKotlinCompilation(
|
|||||||
override val compileDependencyConfigurationName: String get() = throw UnsupportedOperationException()
|
override val compileDependencyConfigurationName: String get() = throw UnsupportedOperationException()
|
||||||
override var compileDependencyFiles: FileCollection
|
override var compileDependencyFiles: FileCollection
|
||||||
get() = throw UnsupportedOperationException()
|
get() = throw UnsupportedOperationException()
|
||||||
set(value) = throw UnsupportedOperationException()
|
set(_) = throw UnsupportedOperationException()
|
||||||
override val output: KotlinCompilationOutput get() = throw UnsupportedOperationException()
|
override val output: KotlinCompilationOutput get() = throw UnsupportedOperationException()
|
||||||
override val compileKotlinTaskName: String get() = throw UnsupportedOperationException()
|
override val compileKotlinTaskName: String get() = throw UnsupportedOperationException()
|
||||||
override val compileKotlinTask: KotlinCompile<KotlinCommonOptions> get() = throw UnsupportedOperationException()
|
override val compileKotlinTask: KotlinCompile<KotlinCommonOptions> get() = throw UnsupportedOperationException()
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ class GradleNodeModuleBuilderTest {
|
|||||||
)
|
)
|
||||||
assertNotNull(packageJson, "package.json should be deserialized")
|
assertNotNull(packageJson, "package.json should be deserialized")
|
||||||
|
|
||||||
with(packageJson!!) {
|
with(packageJson) {
|
||||||
listOf(
|
listOf(
|
||||||
dependencies,
|
dependencies,
|
||||||
devDependencies,
|
devDependencies,
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ pill {
|
|||||||
kotlin.target.compilations.all {
|
kotlin.target.compilations.all {
|
||||||
kotlinOptions.languageVersion = "1.4"
|
kotlinOptions.languageVersion = "1.4"
|
||||||
kotlinOptions.apiVersion = "1.4"
|
kotlinOptions.apiVersion = "1.4"
|
||||||
kotlinOptions.freeCompilerArgs += listOf("-Xskip-prerelease-check")
|
kotlinOptions.freeCompilerArgs += listOf("-Xskip-prerelease-check", "-Xsuppress-version-warnings")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.named<Jar>("jar") {
|
tasks.named<Jar>("jar") {
|
||||||
|
|||||||
+1
-12
@@ -5,21 +5,11 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.tooling
|
package org.jetbrains.kotlin.tooling
|
||||||
|
|
||||||
import junit.framework.Assert.assertFalse
|
|
||||||
import junit.framework.Assert.assertTrue
|
|
||||||
import org.intellij.lang.annotations.Language
|
import org.intellij.lang.annotations.Language
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import kotlin.test.assertEquals
|
import kotlin.test.*
|
||||||
import kotlin.test.assertNotNull
|
|
||||||
import kotlin.test.assertNull
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
|
||||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
|
||||||
*/
|
|
||||||
|
|
||||||
class DeserializeStringTest {
|
class DeserializeStringTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `schemaVersion 1 0 0`() {
|
fun `schemaVersion 1 0 0`() {
|
||||||
@Language("JSON") val json = """
|
@Language("JSON") val json = """
|
||||||
@@ -135,4 +125,3 @@ class DeserializeStringTest {
|
|||||||
assertNull(commonTarget.extras.native)
|
assertNull(commonTarget.extras.native)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user