From 668bd209f272169cde850dcae66feea5e9f44f8c Mon Sep 17 00:00:00 2001 From: Dmitry Savvinov Date: Mon, 9 Jul 2018 18:42:24 +0300 Subject: [PATCH] Use -Xallow-kotlin-package while compiling common sources K2MetadataCompiler doesn't perform explicit check of compilation of 'kotlin' package, thus stdlib build wasn't passing '-Xallow-kotlin-package'. However, we have special hack for compiling stdlib with contracts: if '-Xallow-kotlin-package' is passed, then allow compiling contracts for custom functions. We have to do it this way, because we don't want stdlib artifacts to be marked with pre-release flag, even though contracts for custom functions are not enabled yet (see eae9923dbe66525d7f786d360749704251e71a03). Therefore, it's crucial to pass -Xallow-kotlin-package properly for that side-effect. --- libraries/kotlin.test/common/build.gradle | 3 ++- libraries/stdlib/common/build.gradle | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libraries/kotlin.test/common/build.gradle b/libraries/kotlin.test/common/build.gradle index 24aba8f6ccf..555d30c1830 100644 --- a/libraries/kotlin.test/common/build.gradle +++ b/libraries/kotlin.test/common/build.gradle @@ -35,7 +35,8 @@ artifacts { compileKotlinCommon { kotlinOptions { freeCompilerArgs = [ - "-module-name", project.name + "-module-name", project.name, + "-Xallow-kotlin-package" ] } } \ No newline at end of file diff --git a/libraries/stdlib/common/build.gradle b/libraries/stdlib/common/build.gradle index cf8390ac924..bc2cd2ed320 100644 --- a/libraries/stdlib/common/build.gradle +++ b/libraries/stdlib/common/build.gradle @@ -57,7 +57,8 @@ compileKotlinCommon { kotlinOptions { freeCompilerArgs = [ "-module-name", project.name, - "-Xuse-experimental=kotlin.Experimental" + "-Xuse-experimental=kotlin.Experimental", + "-Xallow-kotlin-package" ] } } @@ -69,7 +70,8 @@ compileUnsignedKotlinCommon { freeCompilerArgs += [ "-Xuse-experimental=kotlin.Experimental", "-Xuse-experimental=kotlin.ExperimentalUnsignedTypes", - "-XXLanguage:+InlineClasses" + "-XXLanguage:+InlineClasses", + "-Xallow-kotlin-package" ] } }