[Gradle, JS] Correct renaming
This commit is contained in:
+2
-2
@@ -38,7 +38,7 @@ import org.jetbrains.kotlin.gradle.model.builder.KotlinModelBuilder
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.*
|
||||
import org.jetbrains.kotlin.gradle.scripting.internal.ScriptingGradleSubplugin
|
||||
import org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinJsBinaryType
|
||||
import org.jetbrains.kotlin.gradle.targets.js.ir.JsBinary
|
||||
import org.jetbrains.kotlin.gradle.targets.js.ir.JsIrBinary
|
||||
import org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrCompilation
|
||||
import org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrLink
|
||||
import org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget
|
||||
@@ -354,7 +354,7 @@ internal class KotlinJsIrSourceSetProcessor(
|
||||
val compilation = kotlinCompilation as KotlinJsIrCompilation
|
||||
|
||||
compilation.binaries
|
||||
.withType(JsBinary::class.java)
|
||||
.withType(JsIrBinary::class.java)
|
||||
.all { binary ->
|
||||
registerKotlinCompileTask(
|
||||
binary.linkTaskName
|
||||
|
||||
+2
-2
@@ -14,7 +14,7 @@ import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilationWithResources
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinTarget
|
||||
import org.jetbrains.kotlin.gradle.targets.js.KotlinJsTarget
|
||||
import org.jetbrains.kotlin.gradle.targets.js.ir.JsBinary
|
||||
import org.jetbrains.kotlin.gradle.targets.js.ir.JsIrBinary
|
||||
import org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsBinaryContainer
|
||||
import org.jetbrains.kotlin.gradle.targets.js.npm.PackageJson
|
||||
import org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile
|
||||
@@ -28,7 +28,7 @@ open class KotlinJsCompilation(
|
||||
target.project.objects.newInstance(
|
||||
KotlinJsBinaryContainer::class.java,
|
||||
target,
|
||||
WrapUtil.toDomainObjectSet(JsBinary::class.java)
|
||||
WrapUtil.toDomainObjectSet(JsIrBinary::class.java)
|
||||
)
|
||||
|
||||
override val processResourcesTaskName: String
|
||||
|
||||
+4
-4
@@ -13,17 +13,17 @@ import org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinJsBinaryType
|
||||
import org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsBinaryContainer.Companion.generateBinaryName
|
||||
import org.jetbrains.kotlin.gradle.utils.lowerCamelCaseName
|
||||
|
||||
interface JsBinary2 {
|
||||
interface JsBinary {
|
||||
val compilation: KotlinJsCompilation
|
||||
val name: String
|
||||
val type: KotlinJsBinaryType
|
||||
}
|
||||
|
||||
sealed class JsBinary(
|
||||
sealed class JsIrBinary(
|
||||
override val compilation: KotlinJsCompilation,
|
||||
override val name: String,
|
||||
override val type: KotlinJsBinaryType
|
||||
) : JsBinary2 {
|
||||
) : JsBinary {
|
||||
val linkTaskName: String = linkTaskName()
|
||||
|
||||
val linkTask: TaskProvider<KotlinJsIrLink>
|
||||
@@ -50,7 +50,7 @@ class Executable(
|
||||
compilation: KotlinJsCompilation,
|
||||
name: String,
|
||||
type: KotlinJsBinaryType
|
||||
) : JsBinary(
|
||||
) : JsIrBinary(
|
||||
compilation,
|
||||
name,
|
||||
type
|
||||
|
||||
+9
-9
@@ -24,8 +24,8 @@ open class KotlinJsBinaryContainer
|
||||
@Inject
|
||||
constructor(
|
||||
val target: KotlinTargetWithBinaries<KotlinJsCompilation, KotlinJsBinaryContainer>,
|
||||
backingContainer: DomainObjectSet<JsBinary2>
|
||||
) : DomainObjectSet<JsBinary2> by backingContainer {
|
||||
backingContainer: DomainObjectSet<JsBinary>
|
||||
) : DomainObjectSet<JsBinary> by backingContainer {
|
||||
val project: Project
|
||||
get() = target.project
|
||||
|
||||
@@ -46,7 +46,7 @@ constructor(
|
||||
(this as KotlinJsIrSubTarget).produceExecutable()
|
||||
}
|
||||
|
||||
compilation.binaries.executableInternal(compilation)
|
||||
compilation.binaries.executableIrInternal(compilation)
|
||||
}
|
||||
|
||||
if (target is KotlinJsTarget) {
|
||||
@@ -65,7 +65,7 @@ constructor(
|
||||
}
|
||||
}
|
||||
|
||||
internal fun executableInternal(compilation: KotlinJsCompilation) = createBinaries(
|
||||
internal fun executableIrInternal(compilation: KotlinJsCompilation) = createBinaries(
|
||||
compilation = compilation,
|
||||
jsBinaryType = JsBinaryType.EXECUTABLE,
|
||||
create = ::Executable
|
||||
@@ -75,7 +75,7 @@ constructor(
|
||||
compilation = compilation,
|
||||
jsBinaryType = JsBinaryType.EXECUTABLE,
|
||||
create = { compilation, name, type ->
|
||||
object : JsBinary2 {
|
||||
object : JsBinary {
|
||||
override val compilation: KotlinJsCompilation = compilation
|
||||
override val name: String = name
|
||||
override val type: KotlinJsBinaryType = type
|
||||
@@ -83,14 +83,14 @@ constructor(
|
||||
}
|
||||
)
|
||||
|
||||
internal fun getBinary(
|
||||
internal fun getIrBinary(
|
||||
type: KotlinJsBinaryType
|
||||
): JsBinary =
|
||||
): JsIrBinary =
|
||||
matching { it.type == type }
|
||||
.withType(JsBinary::class.java)
|
||||
.withType(JsIrBinary::class.java)
|
||||
.single()
|
||||
|
||||
private fun <T : JsBinary2> createBinaries(
|
||||
private fun <T : JsBinary> createBinaries(
|
||||
compilation: KotlinJsCompilation,
|
||||
types: Collection<KotlinJsBinaryType> = listOf(PRODUCTION, DEVELOPMENT),
|
||||
jsBinaryType: JsBinaryType,
|
||||
|
||||
+3
-3
@@ -44,7 +44,7 @@ abstract class KotlinJsIrSubTarget(
|
||||
target.compilations.all {
|
||||
val npmProject = it.npmProject
|
||||
it.binaries
|
||||
.withType(JsBinary::class.java)
|
||||
.withType(JsIrBinary::class.java)
|
||||
.all { binary ->
|
||||
binary.linkTask.configure {
|
||||
it.kotlinOptions.outputFile = npmProject.dir.resolve(npmProject.main).canonicalPath
|
||||
@@ -75,7 +75,7 @@ abstract class KotlinJsIrSubTarget(
|
||||
|
||||
protected open fun configureTestRunDefaults(testRun: KotlinJsPlatformTestRun) {
|
||||
target.compilations.matching { it.name == KotlinCompilation.TEST_COMPILATION_NAME }.all { compilation ->
|
||||
compilation.binaries.executableInternal(compilation)
|
||||
compilation.binaries.executableIrInternal(compilation)
|
||||
configureTestsRun(testRun, compilation)
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,7 @@ abstract class KotlinJsIrSubTarget(
|
||||
testJs.group = LifecycleBasePlugin.VERIFICATION_GROUP
|
||||
testJs.description = testTaskDescription
|
||||
|
||||
val testExecutableTask = compilation.binaries.getBinary(
|
||||
val testExecutableTask = compilation.binaries.getIrBinary(
|
||||
KotlinJsBinaryType.DEVELOPMENT
|
||||
).linkTask
|
||||
|
||||
|
||||
+1
-1
@@ -118,7 +118,7 @@ constructor(
|
||||
it.compileKotlinTask.configureCommonJsOptions()
|
||||
|
||||
binaries
|
||||
.filterIsInstance<JsBinary>()
|
||||
.filterIsInstance<JsIrBinary>()
|
||||
.forEach {
|
||||
it.linkTask.configure { linkTask ->
|
||||
linkTask.configureCommonJsOptions()
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ open class KotlinJsIrTargetConfigurator(kotlinPluginVersion: String) :
|
||||
}
|
||||
|
||||
it.binaries
|
||||
.filterIsInstance<JsBinary>()
|
||||
.filterIsInstance<JsIrBinary>()
|
||||
.forEach {
|
||||
it.linkTask.configure { linkTask ->
|
||||
linkTask.kotlinOptions.configureOptions()
|
||||
|
||||
+2
-2
@@ -31,7 +31,7 @@ open class KotlinNodeJsIr @Inject constructor(target: KotlinJsIrTarget) :
|
||||
override fun configureRun(
|
||||
compilation: KotlinJsIrCompilation
|
||||
) {
|
||||
val developmentExecutable = compilation.binaries.getBinary(KotlinJsBinaryType.DEVELOPMENT)
|
||||
val developmentExecutable = compilation.binaries.getIrBinary(KotlinJsBinaryType.DEVELOPMENT)
|
||||
|
||||
val runTaskHolder = NodeJsExec.create(compilation, disambiguateCamelCased(RUN_TASK_NAME)) {
|
||||
inputFileProperty.set(developmentExecutable.linkTask.map { it.outputFileProperty.get() })
|
||||
@@ -42,7 +42,7 @@ open class KotlinNodeJsIr @Inject constructor(target: KotlinJsIrTarget) :
|
||||
override fun configureBuild(
|
||||
compilation: KotlinJsIrCompilation
|
||||
) {
|
||||
val productionExecutable = compilation.binaries.getBinary(KotlinJsBinaryType.PRODUCTION)
|
||||
val productionExecutable = compilation.binaries.getIrBinary(KotlinJsBinaryType.PRODUCTION)
|
||||
|
||||
val assembleTask = project.tasks.getByName(LifecycleBasePlugin.ASSEMBLE_TASK_NAME)
|
||||
assembleTask.dependsOn(productionExecutable.linkTask)
|
||||
|
||||
Reference in New Issue
Block a user