Move CompilerArgumentAware to the <...>.internal package.
This commit is contained in:
-18
@@ -23,24 +23,6 @@ import org.gradle.api.tasks.Internal
|
||||
import org.jetbrains.kotlin.cli.common.arguments.CommonToolArguments
|
||||
import org.jetbrains.kotlin.compilerRunner.ArgumentUtils
|
||||
|
||||
interface CompilerArgumentAware<T : CommonToolArguments> {
|
||||
@get:Input
|
||||
val serializedCompilerArguments: List<String>
|
||||
get() = ArgumentUtils.convertArgumentsToStringList(prepareCompilerArguments())
|
||||
|
||||
@get:Internal
|
||||
val defaultSerializedCompilerArguments: List<String>
|
||||
get() = createCompilerArgs()
|
||||
.also { setupCompilerArgs(it, defaultsOnly = true) }
|
||||
.let(ArgumentUtils::convertArgumentsToStringList)
|
||||
|
||||
fun createCompilerArgs(): T
|
||||
fun setupCompilerArgs(args: T, defaultsOnly: Boolean = false)
|
||||
}
|
||||
|
||||
internal fun <T : CommonToolArguments> CompilerArgumentAware<T>.prepareCompilerArguments() =
|
||||
createCompilerArgs().also { setupCompilerArgs(it) }
|
||||
|
||||
interface KotlinCompile<T : KotlinCommonOptions> : Task {
|
||||
@get:Internal
|
||||
val kotlinOptions: T
|
||||
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.gradle.internal
|
||||
|
||||
import org.gradle.api.tasks.Input
|
||||
import org.gradle.api.tasks.Internal
|
||||
import org.jetbrains.kotlin.cli.common.arguments.CommonToolArguments
|
||||
import org.jetbrains.kotlin.compilerRunner.ArgumentUtils
|
||||
|
||||
interface CompilerArgumentAware<T : CommonToolArguments> {
|
||||
@get:Input
|
||||
val serializedCompilerArguments: List<String>
|
||||
get() = ArgumentUtils.convertArgumentsToStringList(prepareCompilerArguments())
|
||||
|
||||
@get:Internal
|
||||
val defaultSerializedCompilerArguments: List<String>
|
||||
get() = createCompilerArgs()
|
||||
.also { setupCompilerArgs(it, defaultsOnly = true) }
|
||||
.let(ArgumentUtils::convertArgumentsToStringList)
|
||||
|
||||
fun createCompilerArgs(): T
|
||||
fun setupCompilerArgs(args: T, defaultsOnly: Boolean = false)
|
||||
}
|
||||
|
||||
internal fun <T : CommonToolArguments> CompilerArgumentAware<T>.prepareCompilerArguments() =
|
||||
createCompilerArgs().also { setupCompilerArgs(it) }
|
||||
-1
@@ -20,7 +20,6 @@ import com.intellij.openapi.util.io.FileUtil
|
||||
import org.gradle.api.tasks.*
|
||||
import org.gradle.api.tasks.incremental.IncrementalTaskInputs
|
||||
import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments
|
||||
import org.jetbrains.kotlin.gradle.dsl.prepareCompilerArguments
|
||||
import org.jetbrains.kotlin.gradle.plugin.kotlinDebug
|
||||
import org.jetbrains.kotlin.gradle.tasks.FilteringSourceRootsContainer
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
-2
@@ -10,8 +10,6 @@ import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments
|
||||
import org.jetbrains.kotlin.compilerRunner.GradleCompilerEnvironment
|
||||
import org.jetbrains.kotlin.compilerRunner.GradleCompilerRunner
|
||||
import org.jetbrains.kotlin.compilerRunner.OutputItemsCollectorImpl
|
||||
import org.jetbrains.kotlin.gradle.dsl.CompilerArgumentAware
|
||||
import org.jetbrains.kotlin.gradle.dsl.prepareCompilerArguments
|
||||
import org.jetbrains.kotlin.gradle.tasks.*
|
||||
import java.io.File
|
||||
|
||||
|
||||
Reference in New Issue
Block a user