[Gradle] kgp-idea: Implement isIdeaProjectLevel and KlibExtra

KT-55189
This commit is contained in:
Sebastian Sellmair
2022-11-30 16:46:49 +01:00
committed by Space Team
parent bb039ae535
commit 0f533a8a2f
2 changed files with 50 additions and 0 deletions
@@ -0,0 +1,31 @@
/*
* Copyright 2010-2022 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.idea.tcs.extras
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinBinaryDependency
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinExtra
import org.jetbrains.kotlin.tooling.core.extrasKeyOf
import org.jetbrains.kotlin.tooling.core.getValue
import org.jetbrains.kotlin.tooling.core.setValue
import java.io.Serializable
var IdeaKotlinBinaryDependency.klibExtra by KlibExtra.key
@IdeaKotlinExtra
data class KlibExtra(
val builtInsPlatform: String?,
val uniqueName: String?,
val shortName: String?,
val packageFqName: String?,
val nativeTargets: List<String>?,
val commonizerTarget: String?,
val isInterop: Boolean?
) : Serializable {
companion object {
private const val serialVersionUID = 0L
val key = extrasKeyOf<KlibExtra>()
}
}
@@ -0,0 +1,19 @@
/*
* Copyright 2010-2022 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.idea.tcs.extras
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinBinaryDependency
import org.jetbrains.kotlin.tooling.core.extrasKeyOf
import org.jetbrains.kotlin.tooling.core.getValue
import org.jetbrains.kotlin.tooling.core.setValue
val isIdeaProjectLevelKey = extrasKeyOf<Boolean>("IdeaKotlinBinaryDependency.isIdeaProjectLevel")
/**
* Marks any binary dependency as Global in the sense of "this library is considered
* the same, no matter in which Gradle project / IntelliJ module it will be used
*/
var IdeaKotlinBinaryDependency.isIdeaProjectLevel by isIdeaProjectLevelKey