Workarounds to build parts of stdlib as kotlin-runtime and mock runtime
Fix source paths of kotlin-stdlib-minimal-for-tests
This commit is contained in:
@@ -23,16 +23,19 @@ sourceSets {
|
||||
}
|
||||
|
||||
val copySources by task<Copy> {
|
||||
from(project(":kotlin-stdlib").projectDir.resolve("jvm/runtime"))
|
||||
.include("kotlin/TypeAliases.kt",
|
||||
"kotlin/text/TypeAliases.kt")
|
||||
from(project(":kotlin-stdlib").projectDir.resolve("src"))
|
||||
.include("kotlin/collections/TypeAliases.kt",
|
||||
"kotlin/jvm/JvmVersion.kt",
|
||||
"kotlin/util/Standard.kt",
|
||||
"kotlin/internal/Annotations.kt",
|
||||
"kotlin/internal/contracts/ContractBuilder.kt",
|
||||
"kotlin/internal/contracts/Effect.kt")
|
||||
val stdlibProjectDir = project(":kotlin-stdlib").projectDir
|
||||
|
||||
from(stdlibProjectDir.resolve("runtime"))
|
||||
.include("kotlin/TypeAliases.kt",
|
||||
"kotlin/text/TypeAliases.kt")
|
||||
from(stdlibProjectDir.resolve("src"))
|
||||
.include("kotlin/collections/TypeAliases.kt",
|
||||
"kotlin/jvm/JvmVersion.kt")
|
||||
from(stdlibProjectDir.resolve("../src"))
|
||||
.include("kotlin/util/Standard.kt",
|
||||
"kotlin/internal/Annotations.kt",
|
||||
"kotlin/internal/contracts/ContractBuilder.kt",
|
||||
"kotlin/internal/contracts/Effect.kt")
|
||||
into(File(buildDir, "src"))
|
||||
}
|
||||
|
||||
@@ -44,7 +47,7 @@ tasks.withType<JavaCompile> {
|
||||
tasks.withType<KotlinCompile> {
|
||||
dependsOn(copySources)
|
||||
kotlinOptions {
|
||||
freeCompilerArgs += listOf("-module-name", "kotlin-stdlib")
|
||||
freeCompilerArgs += listOf("-module-name", "kotlin-stdlib", "-Xmulti-platform")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@file:Suppress("ACTUAL_WITHOUT_EXPECT") // for building kotlin-runtime
|
||||
|
||||
package kotlin
|
||||
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@file:Suppress("ACTUAL_WITHOUT_EXPECT") // for building kotlin-runtime
|
||||
|
||||
package kotlin
|
||||
|
||||
public actual class UninitializedPropertyAccessException : RuntimeException {
|
||||
|
||||
@@ -22,6 +22,7 @@ import kotlin.annotation.AnnotationTarget.*
|
||||
* Marks the JVM backing field of the annotated property as `volatile`, meaning that writes to this field
|
||||
* are immediately made visible to other threads.
|
||||
*/
|
||||
@Suppress("ACTUAL_WITHOUT_EXPECT") // for building kotlin-runtime
|
||||
@Target(FIELD)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@MustBeDocumented
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@file:Suppress("ACTUAL_WITHOUT_EXPECT") // for building kotlin-runtime
|
||||
|
||||
package kotlin.jvm
|
||||
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@file:Suppress("ACTUAL_WITHOUT_EXPECT") // for building kotlin-runtime
|
||||
|
||||
package kotlin.text
|
||||
|
||||
@SinceKotlin("1.1") public actual typealias Appendable = java.lang.Appendable
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
@file:kotlin.jvm.JvmVersion
|
||||
|
||||
@file:Suppress("ACTUAL_WITHOUT_EXPECT") // for building kotlin-stdlib-minimal-for-test
|
||||
|
||||
package kotlin.collections
|
||||
|
||||
@SinceKotlin("1.1") public actual typealias RandomAccess = java.util.RandomAccess
|
||||
|
||||
@@ -44,6 +44,7 @@ compileKotlin {
|
||||
"-Xallow-kotlin-package",
|
||||
"-Xnormalize-constructor-calls=enable",
|
||||
"-Xdump-declarations-to=${buildDir}/runtime-declarations.json",
|
||||
"-Xmulti-platform",
|
||||
"-cp", "${rootDir}/dist/builtins",
|
||||
"-module-name", project.name
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user