[K/N] Merge :kotlin-native-shared with :native:kotlin-native-utils
* Code was moved to utils, but sources are included to the shared until bootstrap advance. * Fixed dependencies and set API & LV to 1.4 for the modules used with Gradle. Merge-request: KT-MR-9122 Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
This commit is contained in:
committed by
Space Team
parent
633d840c88
commit
aed6272107
@@ -1,3 +1,5 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("jps-compatible")
|
||||
@@ -16,6 +18,14 @@ sourceSets {
|
||||
"test" { projectDefault() }
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile>().configureEach {
|
||||
kotlinOptions {
|
||||
languageVersion = "1.4"
|
||||
apiVersion = "1.4"
|
||||
freeCompilerArgs += listOf("-Xsuppress-version-warnings")
|
||||
}
|
||||
}
|
||||
|
||||
publish()
|
||||
|
||||
standardPublicJars()
|
||||
@@ -29,11 +29,11 @@ object WobblyTF8 {
|
||||
if (char1 < '\u0080') {
|
||||
// U+0000..U+007F -> 0xxxxxxx
|
||||
// 7 meaningful bits -> 1 byte
|
||||
buffer[writtenBytes++] = char1.code
|
||||
buffer[writtenBytes++] = char1.toInt()
|
||||
} else if (char1 < '\u0800') {
|
||||
// U+0080..U+07FF -> 110xxxxx 10xxxxxx
|
||||
// 11 meaningful bits -> 2 bytes
|
||||
val codePoint = char1.code
|
||||
val codePoint = char1.toInt()
|
||||
buffer[writtenBytes++] = (codePoint ushr 6) or 0b1100_0000
|
||||
buffer[writtenBytes++] = (codePoint and 0b0011_1111) or 0b1000_0000
|
||||
} else {
|
||||
@@ -55,7 +55,7 @@ object WobblyTF8 {
|
||||
|
||||
// U+0800..U+FFFF -> 1110xxxx 10xxxxxx 10xxxxxx
|
||||
// 16 meaningful bits -> 3 bytes
|
||||
val codePoint = char1.code
|
||||
val codePoint = char1.toInt()
|
||||
buffer[writtenBytes++] = (codePoint ushr 12) or 0b1110_0000
|
||||
buffer[writtenBytes++] = ((codePoint ushr 6) and 0b0011_1111) or 0b1000_0000
|
||||
buffer[writtenBytes++] = (codePoint and 0b0011_1111) or 0b1000_0000
|
||||
|
||||
@@ -152,9 +152,9 @@ class WobblyTF8Test {
|
||||
fun ByteArray.decodeWithWobbly(): String = WobblyTF8.decode(this)
|
||||
fun ByteArray.decodeWithUTF8(): String = toString(Charsets.UTF_8)
|
||||
|
||||
val CODE_POINTS_BEFORE_SURROGATES = MIN_CODE_POINT until MIN_SURROGATE.code
|
||||
val CODE_POINTS_SURROGATES = MIN_SURROGATE.code..MAX_SURROGATE.code
|
||||
val CODE_POINTS_AFTER_SURROGATES = (MAX_SURROGATE.code + 1) until MIN_SUPPLEMENTARY_CODE_POINT
|
||||
val CODE_POINTS_BEFORE_SURROGATES = MIN_CODE_POINT until MIN_SURROGATE.toInt()
|
||||
val CODE_POINTS_SURROGATES = MIN_SURROGATE.toInt()..MAX_SURROGATE.toInt()
|
||||
val CODE_POINTS_AFTER_SURROGATES = (MAX_SURROGATE.toInt() + 1) until MIN_SUPPLEMENTARY_CODE_POINT
|
||||
val CODE_POINTS_SUPPLEMENTARY = MIN_SUPPLEMENTARY_CODE_POINT..MAX_CODE_POINT
|
||||
|
||||
fun generateWellFormedString(
|
||||
|
||||
Reference in New Issue
Block a user