From e253acd5fde5d192e6afaab4f25848b45fe671af Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Thu, 7 Sep 2017 16:31:19 +0300 Subject: [PATCH] Introduce kotlin-stdlib-jdk7/8 libraries, deprecate kotlin-stdlib-jre7/8 The idea is to keep all declarations in the same packages from Kotlin's point of view, but use JvmPackageName annotation to move them to another JVM package, to avoid the split package problem which is otherwise unsolvable when using module path on Java 9 (KT-19258). In this commit, kotlin-stdlib-jre7/8 are moved to kotlin-stdlib-jdk7/8 and in the subsequent commit, -jre7/8 are restored. This is done in order to make Git recognize this as a file move to preserve history. Include new stdlib-jdkN artifacts in manifest version tests. --- build.gradle.kts | 2 ++ libraries/ReadMe.md | 2 +- libraries/stdlib/{jre7 => jdk7}/build.gradle | 8 ++++---- .../src/kotlin/AutoCloseable.kt | 7 ++++--- .../internal/JRE7PlatformImplementations.kt | 0 .../test/TryWithResourcesAutoCloseableTest.kt | 0 .../test/TryWithResourcesCloseableTest.kt | 0 .../test/internalAnnotations.kt | 0 libraries/stdlib/{jre8 => jdk8}/build.gradle | 13 ++++++------ .../src/kotlin/collections/Collections.kt | 11 +++++----- .../internal/JRE8PlatformImplementations.kt | 0 .../src/kotlin/streams/Streams.kt | 20 ++++++++++--------- .../src/kotlin/text/RegexExtensions.kt | 6 ++++-- .../test/collections/CollectionTest.kt | 0 .../test/collections/IterableTest.kt | 0 .../test/collections/ListTest.kt | 0 .../test/collections/MapTest.kt | 0 .../test/collections/StreamsTest.kt | 0 .../{jre8 => jdk8}/test/text/RegexTest.kt | 0 .../binary-compatibility-validator/ReadMe.md | 2 +- .../build.gradle | 2 ++ ...stdlib-jre7.txt => kotlin-stdlib-jdk7.txt} | 2 +- ...stdlib-jre8.txt => kotlin-stdlib-jdk8.txt} | 4 ++-- .../RuntimePublicAPITest.kt | 8 ++++++++ .../tools/kotlin-maven-plugin-test/pom.xml | 2 ++ .../test-kotlin-version-in-manifest/pom.xml | 10 ++++++++++ .../src/main/kotlin/test.kt | 2 ++ settings.gradle | 4 ++++ 28 files changed, 69 insertions(+), 36 deletions(-) rename libraries/stdlib/{jre7 => jdk7}/build.gradle (88%) rename libraries/stdlib/{jre7 => jdk7}/src/kotlin/AutoCloseable.kt (93%) rename libraries/stdlib/{jre7 => jdk7}/src/kotlin/internal/JRE7PlatformImplementations.kt (100%) rename libraries/stdlib/{jre7 => jdk7}/test/TryWithResourcesAutoCloseableTest.kt (100%) rename libraries/stdlib/{jre7 => jdk7}/test/TryWithResourcesCloseableTest.kt (100%) rename libraries/stdlib/{jre7 => jdk7}/test/internalAnnotations.kt (100%) rename libraries/stdlib/{jre8 => jdk8}/build.gradle (84%) rename libraries/stdlib/{jre8 => jdk8}/src/kotlin/collections/Collections.kt (84%) rename libraries/stdlib/{jre8 => jdk8}/src/kotlin/internal/JRE8PlatformImplementations.kt (100%) rename libraries/stdlib/{jre8 => jdk8}/src/kotlin/streams/Streams.kt (88%) rename libraries/stdlib/{jre8 => jdk8}/src/kotlin/text/RegexExtensions.kt (87%) rename libraries/stdlib/{jre8 => jdk8}/test/collections/CollectionTest.kt (100%) rename libraries/stdlib/{jre8 => jdk8}/test/collections/IterableTest.kt (100%) rename libraries/stdlib/{jre8 => jdk8}/test/collections/ListTest.kt (100%) rename libraries/stdlib/{jre8 => jdk8}/test/collections/MapTest.kt (100%) rename libraries/stdlib/{jre8 => jdk8}/test/collections/StreamsTest.kt (100%) rename libraries/stdlib/{jre8 => jdk8}/test/text/RegexTest.kt (100%) rename libraries/tools/binary-compatibility-validator/reference-public-api/{kotlin-stdlib-jre7.txt => kotlin-stdlib-jdk7.txt} (65%) rename libraries/tools/binary-compatibility-validator/reference-public-api/{kotlin-stdlib-jre8.txt => kotlin-stdlib-jdk8.txt} (88%) diff --git a/build.gradle.kts b/build.gradle.kts index 1f0b2755580..d33ec2930b8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -155,6 +155,8 @@ val coreLibProjects = listOf( ":kotlin-stdlib-js", ":kotlin-stdlib-jre7", ":kotlin-stdlib-jre8", + ":kotlin-stdlib-jdk7", + ":kotlin-stdlib-jdk8", ":kotlin-test:kotlin-test-common", ":kotlin-test:kotlin-test-jvm", ":kotlin-test:kotlin-test-junit", diff --git a/libraries/ReadMe.md b/libraries/ReadMe.md index b926e88d05a..e18d9e07958 100644 --- a/libraries/ReadMe.md +++ b/libraries/ReadMe.md @@ -14,7 +14,7 @@ You need to install a recent [Maven](http://maven.apache.org/) distribution and JDK_18="path to JDK 1.8" The main part of the Kotlin standard library, `kotlin-stdlib`, is compiled against JDK 1.6 and also there are two extensions -for the standard library, `kotlin-stdlib-jre7` and `kotlin-stdlib-jre8`, which are compiled against JDK 1.7 and 1.8 respectively, +for the standard library, `kotlin-stdlib-jdk7` and `kotlin-stdlib-jdk8`, which are compiled against JDK 1.7 and 1.8 respectively, so you need to have all these JDKs installed. Be sure to build Kotlin compiler distribution before launching Gradle and Maven: see [root ReadMe.md, section "Building"](../ReadMe.md#installing-plugin). diff --git a/libraries/stdlib/jre7/build.gradle b/libraries/stdlib/jdk7/build.gradle similarity index 88% rename from libraries/stdlib/jre7/build.gradle rename to libraries/stdlib/jdk7/build.gradle index 6f84ac6d3ed..279d03286cd 100644 --- a/libraries/stdlib/jre7/build.gradle +++ b/libraries/stdlib/jdk7/build.gradle @@ -1,4 +1,4 @@ -description = 'Kotlin Standard Library JRE 7 extension' +description = 'Kotlin Standard Library JDK 7 extension' apply plugin: 'kotlin' @@ -49,7 +49,7 @@ compileKotlin { kotlinOptions.freeCompilerArgs = [ "-Xallow-kotlin-package", "-Xmultifile-parts-inherit", - "-Xdump-declarations-to", "${buildDir}/stdlib-jre7-declarations.json", + "-Xdump-declarations-to", "${buildDir}/stdlib-jdk7-declarations.json", "-module-name", project.name ] } @@ -64,7 +64,7 @@ test { executable = "$JDK_17/bin/java" } -task testJre6Tests(type: Test) { +task testJdk6Tests(type: Test) { dependsOn(':kotlin-stdlib:testClasses') group = "verification" @@ -79,4 +79,4 @@ task testJre6Tests(type: Test) { } } -check.dependsOn testJre6Tests \ No newline at end of file +check.dependsOn testJdk6Tests diff --git a/libraries/stdlib/jre7/src/kotlin/AutoCloseable.kt b/libraries/stdlib/jdk7/src/kotlin/AutoCloseable.kt similarity index 93% rename from libraries/stdlib/jre7/src/kotlin/AutoCloseable.kt rename to libraries/stdlib/jdk7/src/kotlin/AutoCloseable.kt index cf47b37dea9..31770fab79a 100644 --- a/libraries/stdlib/jre7/src/kotlin/AutoCloseable.kt +++ b/libraries/stdlib/jdk7/src/kotlin/AutoCloseable.kt @@ -14,7 +14,9 @@ * limitations under the License. */ +@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") @file:JvmName("AutoCloseableKt") +@file:kotlin.jvm.JvmPackageName("kotlin.jdk7") package kotlin /** @@ -27,8 +29,7 @@ package kotlin * @param block a function to process this [AutoCloseable] resource. * @return the result of [block] function invoked on this resource. */ -@SinceKotlin("1.1") -@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") +@SinceKotlin("1.2") @kotlin.internal.InlineOnly public inline fun T.use(block: (T) -> R): R { var exception: Throwable? = null @@ -48,7 +49,7 @@ public inline fun T.use(block: (T) -> R): R { * * The suppressed exception is added to the list of suppressed exceptions of [cause] exception. */ -@SinceKotlin("1.1") +@SinceKotlin("1.2") @PublishedApi internal fun AutoCloseable?.closeFinally(cause: Throwable?) = when { this == null -> {} diff --git a/libraries/stdlib/jre7/src/kotlin/internal/JRE7PlatformImplementations.kt b/libraries/stdlib/jdk7/src/kotlin/internal/JRE7PlatformImplementations.kt similarity index 100% rename from libraries/stdlib/jre7/src/kotlin/internal/JRE7PlatformImplementations.kt rename to libraries/stdlib/jdk7/src/kotlin/internal/JRE7PlatformImplementations.kt diff --git a/libraries/stdlib/jre7/test/TryWithResourcesAutoCloseableTest.kt b/libraries/stdlib/jdk7/test/TryWithResourcesAutoCloseableTest.kt similarity index 100% rename from libraries/stdlib/jre7/test/TryWithResourcesAutoCloseableTest.kt rename to libraries/stdlib/jdk7/test/TryWithResourcesAutoCloseableTest.kt diff --git a/libraries/stdlib/jre7/test/TryWithResourcesCloseableTest.kt b/libraries/stdlib/jdk7/test/TryWithResourcesCloseableTest.kt similarity index 100% rename from libraries/stdlib/jre7/test/TryWithResourcesCloseableTest.kt rename to libraries/stdlib/jdk7/test/TryWithResourcesCloseableTest.kt diff --git a/libraries/stdlib/jre7/test/internalAnnotations.kt b/libraries/stdlib/jdk7/test/internalAnnotations.kt similarity index 100% rename from libraries/stdlib/jre7/test/internalAnnotations.kt rename to libraries/stdlib/jdk7/test/internalAnnotations.kt diff --git a/libraries/stdlib/jre8/build.gradle b/libraries/stdlib/jdk8/build.gradle similarity index 84% rename from libraries/stdlib/jre8/build.gradle rename to libraries/stdlib/jdk8/build.gradle index 96799152049..67dbb060424 100644 --- a/libraries/stdlib/jre8/build.gradle +++ b/libraries/stdlib/jdk8/build.gradle @@ -1,4 +1,4 @@ -description = 'Kotlin Standard Library JRE 8 extension' +description = 'Kotlin Standard Library JDK 8 extension' apply plugin: 'kotlin' @@ -9,7 +9,7 @@ ext.jvmTarget = "1.8" dependencies { compile project(':kotlin-stdlib') - compile project(':kotlin-stdlib-jre7') + compile project(':kotlin-stdlib-jdk7') testCompile project(':kotlin-test:kotlin-test-junit') } @@ -24,7 +24,7 @@ sourceSets { srcDir 'test' if(!System.properties.'idea.active') { srcDir '../test' - srcDir '../jre7/test' + srcDir '../jdk7/test' } } } @@ -52,7 +52,7 @@ compileKotlin { kotlinOptions.freeCompilerArgs = [ "-Xallow-kotlin-package", "-Xmultifile-parts-inherit", - "-Xdump-declarations-to", "${buildDir}/stdlib-jre8-declarations.json", + "-Xdump-declarations-to", "${buildDir}/stdlib-jdk8-declarations.json", "-module-name", project.name ] } @@ -67,8 +67,7 @@ test { executable = "$JDK_18/bin/java" } - -task testJre6Tests(type: Test) { +task testJdk6Tests(type: Test) { dependsOn(':kotlin-stdlib:testClasses') group = "verification" @@ -83,4 +82,4 @@ task testJre6Tests(type: Test) { } } -check.dependsOn testJre6Tests \ No newline at end of file +check.dependsOn testJdk6Tests diff --git a/libraries/stdlib/jre8/src/kotlin/collections/Collections.kt b/libraries/stdlib/jdk8/src/kotlin/collections/Collections.kt similarity index 84% rename from libraries/stdlib/jre8/src/kotlin/collections/Collections.kt rename to libraries/stdlib/jdk8/src/kotlin/collections/Collections.kt index 38870e5c550..f67aa631c6b 100644 --- a/libraries/stdlib/jre8/src/kotlin/collections/Collections.kt +++ b/libraries/stdlib/jdk8/src/kotlin/collections/Collections.kt @@ -14,16 +14,16 @@ * limitations under the License. */ -@file:Suppress("UNCHECKED_CAST", "NOTHING_TO_INLINE") -@file:JvmName("CollectionsJRE8Kt") +@file:Suppress("UNCHECKED_CAST", "NOTHING_TO_INLINE", "INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") +@file:JvmName("CollectionsJDK8Kt") +@file:kotlin.jvm.JvmPackageName("kotlin.collections.jdk8") package kotlin.collections /** * Returns the value to which the specified key is mapped, or * [defaultValue] if this map contains no mapping for the key. */ -@SinceKotlin("1.1") -@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") +@SinceKotlin("1.2") @kotlin.internal.InlineOnly public inline fun <@kotlin.internal.OnlyInputTypes K, V> Map.getOrDefault(key: K, defaultValue: V): V = (this as Map).getOrDefault(key, defaultValue) @@ -33,8 +33,7 @@ public inline fun <@kotlin.internal.OnlyInputTypes K, V> Map.getOrDefa * Removes the entry for the specified key only if it is currently * mapped to the specified value. */ -@SinceKotlin("1.1") -@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") +@SinceKotlin("1.2") @kotlin.internal.InlineOnly public inline fun <@kotlin.internal.OnlyInputTypes K, @kotlin.internal.OnlyInputTypes V> MutableMap.remove(key: K, value: V): Boolean = (this as MutableMap).remove(key, value) diff --git a/libraries/stdlib/jre8/src/kotlin/internal/JRE8PlatformImplementations.kt b/libraries/stdlib/jdk8/src/kotlin/internal/JRE8PlatformImplementations.kt similarity index 100% rename from libraries/stdlib/jre8/src/kotlin/internal/JRE8PlatformImplementations.kt rename to libraries/stdlib/jdk8/src/kotlin/internal/JRE8PlatformImplementations.kt diff --git a/libraries/stdlib/jre8/src/kotlin/streams/Streams.kt b/libraries/stdlib/jdk8/src/kotlin/streams/Streams.kt similarity index 88% rename from libraries/stdlib/jre8/src/kotlin/streams/Streams.kt rename to libraries/stdlib/jdk8/src/kotlin/streams/Streams.kt index 28327fc7951..4c7cda20474 100644 --- a/libraries/stdlib/jre8/src/kotlin/streams/Streams.kt +++ b/libraries/stdlib/jdk8/src/kotlin/streams/Streams.kt @@ -14,7 +14,9 @@ * limitations under the License. */ +@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") @file:JvmName("StreamsKt") +@file:kotlin.jvm.JvmPackageName("kotlin.streams.jdk8") package kotlin.streams import java.util.* @@ -23,53 +25,53 @@ import java.util.stream.* /** * Creates a [Sequence] instance that wraps the original stream iterating through its elements. */ -@SinceKotlin("1.1") +@SinceKotlin("1.2") public fun Stream.asSequence(): Sequence = Sequence { iterator() } /** * Creates a [Sequence] instance that wraps the original stream iterating through its elements. */ -@SinceKotlin("1.1") +@SinceKotlin("1.2") public fun IntStream.asSequence(): Sequence = Sequence { iterator() } /** * Creates a [Sequence] instance that wraps the original stream iterating through its elements. */ -@SinceKotlin("1.1") +@SinceKotlin("1.2") public fun LongStream.asSequence(): Sequence = Sequence { iterator() } /** * Creates a [Sequence] instance that wraps the original stream iterating through its elements. */ -@SinceKotlin("1.1") +@SinceKotlin("1.2") public fun DoubleStream.asSequence(): Sequence = Sequence { iterator() } /** * Creates a sequential [Stream] instance that produces elements from the original sequence. */ -@SinceKotlin("1.1") +@SinceKotlin("1.2") public fun Sequence.asStream(): Stream = StreamSupport.stream({ Spliterators.spliteratorUnknownSize(iterator(), Spliterator.ORDERED) }, Spliterator.ORDERED, false) /** * Returns a [List] containing all elements produced by this stream. */ -@SinceKotlin("1.1") +@SinceKotlin("1.2") public fun Stream.toList(): List = collect(Collectors.toList()) /** * Returns a [List] containing all elements produced by this stream. */ -@SinceKotlin("1.1") +@SinceKotlin("1.2") public fun IntStream.toList(): List = toArray().asList() /** * Returns a [List] containing all elements produced by this stream. */ -@SinceKotlin("1.1") +@SinceKotlin("1.2") public fun LongStream.toList(): List = toArray().asList() /** * Returns a [List] containing all elements produced by this stream. */ -@SinceKotlin("1.1") +@SinceKotlin("1.2") public fun DoubleStream.toList(): List = toArray().asList() diff --git a/libraries/stdlib/jre8/src/kotlin/text/RegexExtensions.kt b/libraries/stdlib/jdk8/src/kotlin/text/RegexExtensions.kt similarity index 87% rename from libraries/stdlib/jre8/src/kotlin/text/RegexExtensions.kt rename to libraries/stdlib/jdk8/src/kotlin/text/RegexExtensions.kt index 098ee02b9f7..b88f240f59d 100644 --- a/libraries/stdlib/jre8/src/kotlin/text/RegexExtensions.kt +++ b/libraries/stdlib/jdk8/src/kotlin/text/RegexExtensions.kt @@ -14,7 +14,9 @@ * limitations under the License. */ -@file:JvmName("RegexExtensionsJRE8Kt") +@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") +@file:JvmName("RegexExtensionsJDK8Kt") +@file:kotlin.jvm.JvmPackageName("kotlin.text.jdk8") package kotlin.text /** @@ -23,7 +25,7 @@ package kotlin.text * @return An instance of [MatchGroup] if the group with the specified [name] was matched or `null` otherwise. * @throws [UnsupportedOperationException] if getting named groups isn't supported on the current platform. */ -@SinceKotlin("1.1") +@SinceKotlin("1.2") public operator fun MatchGroupCollection.get(name: String): MatchGroup? { val namedGroups = this as? MatchNamedGroupCollection ?: throw UnsupportedOperationException("Retrieving groups by name is not supported on this platform.") diff --git a/libraries/stdlib/jre8/test/collections/CollectionTest.kt b/libraries/stdlib/jdk8/test/collections/CollectionTest.kt similarity index 100% rename from libraries/stdlib/jre8/test/collections/CollectionTest.kt rename to libraries/stdlib/jdk8/test/collections/CollectionTest.kt diff --git a/libraries/stdlib/jre8/test/collections/IterableTest.kt b/libraries/stdlib/jdk8/test/collections/IterableTest.kt similarity index 100% rename from libraries/stdlib/jre8/test/collections/IterableTest.kt rename to libraries/stdlib/jdk8/test/collections/IterableTest.kt diff --git a/libraries/stdlib/jre8/test/collections/ListTest.kt b/libraries/stdlib/jdk8/test/collections/ListTest.kt similarity index 100% rename from libraries/stdlib/jre8/test/collections/ListTest.kt rename to libraries/stdlib/jdk8/test/collections/ListTest.kt diff --git a/libraries/stdlib/jre8/test/collections/MapTest.kt b/libraries/stdlib/jdk8/test/collections/MapTest.kt similarity index 100% rename from libraries/stdlib/jre8/test/collections/MapTest.kt rename to libraries/stdlib/jdk8/test/collections/MapTest.kt diff --git a/libraries/stdlib/jre8/test/collections/StreamsTest.kt b/libraries/stdlib/jdk8/test/collections/StreamsTest.kt similarity index 100% rename from libraries/stdlib/jre8/test/collections/StreamsTest.kt rename to libraries/stdlib/jdk8/test/collections/StreamsTest.kt diff --git a/libraries/stdlib/jre8/test/text/RegexTest.kt b/libraries/stdlib/jdk8/test/text/RegexTest.kt similarity index 100% rename from libraries/stdlib/jre8/test/text/RegexTest.kt rename to libraries/stdlib/jdk8/test/text/RegexTest.kt diff --git a/libraries/tools/binary-compatibility-validator/ReadMe.md b/libraries/tools/binary-compatibility-validator/ReadMe.md index 9c6ff96c66e..51fc5e9a055 100644 --- a/libraries/tools/binary-compatibility-validator/ReadMe.md +++ b/libraries/tools/binary-compatibility-validator/ReadMe.md @@ -7,7 +7,7 @@ and ensure that the public binary API wasn't changed in a way that make this cha Compile and run tests. `CasesPublicAPITest` verifies the tool itself, and `RuntimePublicAPITest` dumps the public API of `kotlin-stdlib`, -`kotlin-stdlib-jre7/8` and `kotlin-reflect` jars, +`kotlin-stdlib-jdk7/8`, `kotlin-stdlib-jre7/8` and `kotlin-reflect` jars, which must be built beforehand with gradle. Use `clean assemble` tasks, since the incremental compilation currently doesn't produce all the required output. diff --git a/libraries/tools/binary-compatibility-validator/build.gradle b/libraries/tools/binary-compatibility-validator/build.gradle index 1ebc87428ad..3b62f8eca4e 100644 --- a/libraries/tools/binary-compatibility-validator/build.gradle +++ b/libraries/tools/binary-compatibility-validator/build.gradle @@ -13,6 +13,8 @@ dependencies { testArtifacts project(':kotlin-stdlib') testArtifacts project(':kotlin-stdlib-jre7') testArtifacts project(':kotlin-stdlib-jre8') + testArtifacts project(':kotlin-stdlib-jdk7') + testArtifacts project(':kotlin-stdlib-jdk8') testArtifacts project(':kotlin-reflect') // legacy // testArtifacts project(':kotlin-runtime') diff --git a/libraries/tools/binary-compatibility-validator/reference-public-api/kotlin-stdlib-jre7.txt b/libraries/tools/binary-compatibility-validator/reference-public-api/kotlin-stdlib-jdk7.txt similarity index 65% rename from libraries/tools/binary-compatibility-validator/reference-public-api/kotlin-stdlib-jre7.txt rename to libraries/tools/binary-compatibility-validator/reference-public-api/kotlin-stdlib-jdk7.txt index 5e9eb275b06..c77b8fc031c 100644 --- a/libraries/tools/binary-compatibility-validator/reference-public-api/kotlin-stdlib-jre7.txt +++ b/libraries/tools/binary-compatibility-validator/reference-public-api/kotlin-stdlib-jdk7.txt @@ -1,4 +1,4 @@ -public final class kotlin/AutoCloseableKt { +public final class kotlin/jdk7/AutoCloseableKt { public static final fun closeFinally (Ljava/lang/AutoCloseable;Ljava/lang/Throwable;)V } diff --git a/libraries/tools/binary-compatibility-validator/reference-public-api/kotlin-stdlib-jre8.txt b/libraries/tools/binary-compatibility-validator/reference-public-api/kotlin-stdlib-jdk8.txt similarity index 88% rename from libraries/tools/binary-compatibility-validator/reference-public-api/kotlin-stdlib-jre8.txt rename to libraries/tools/binary-compatibility-validator/reference-public-api/kotlin-stdlib-jdk8.txt index cb60b69937b..a0ae21027fc 100644 --- a/libraries/tools/binary-compatibility-validator/reference-public-api/kotlin-stdlib-jre8.txt +++ b/libraries/tools/binary-compatibility-validator/reference-public-api/kotlin-stdlib-jdk8.txt @@ -1,4 +1,4 @@ -public final class kotlin/streams/StreamsKt { +public final class kotlin/streams/jdk8/StreamsKt { public static final fun asSequence (Ljava/util/stream/DoubleStream;)Lkotlin/sequences/Sequence; public static final fun asSequence (Ljava/util/stream/IntStream;)Lkotlin/sequences/Sequence; public static final fun asSequence (Ljava/util/stream/LongStream;)Lkotlin/sequences/Sequence; @@ -10,7 +10,7 @@ public final class kotlin/streams/StreamsKt { public static final fun toList (Ljava/util/stream/Stream;)Ljava/util/List; } -public final class kotlin/text/RegexExtensionsJRE8Kt { +public final class kotlin/text/jdk8/RegexExtensionsJDK8Kt { public static final fun get (Lkotlin/text/MatchGroupCollection;Ljava/lang/String;)Lkotlin/text/MatchGroup; } diff --git a/libraries/tools/binary-compatibility-validator/src/test/kotlin/org.jetbrains.kotlin.tools.tests/RuntimePublicAPITest.kt b/libraries/tools/binary-compatibility-validator/src/test/kotlin/org.jetbrains.kotlin.tools.tests/RuntimePublicAPITest.kt index aad8fc07a41..d1bbceb4411 100644 --- a/libraries/tools/binary-compatibility-validator/src/test/kotlin/org.jetbrains.kotlin.tools.tests/RuntimePublicAPITest.kt +++ b/libraries/tools/binary-compatibility-validator/src/test/kotlin/org.jetbrains.kotlin.tools.tests/RuntimePublicAPITest.kt @@ -41,6 +41,14 @@ class RuntimePublicAPITest { snapshotAPIAndCompare("../../stdlib/build/libs", "kotlin-stdlib", listOf("../stdlib-declarations.json", "../runtime-declarations.json"), listOf("kotlin.jvm.internal")) } + @Test fun kotlinStdlibJdk7() { + snapshotAPIAndCompare("../../stdlib/jdk7/build/libs", "kotlin-stdlib-jdk7", listOf("../stdlib-jdk7-declarations.json")) + } + + @Test fun kotlinStdlibJdk8() { + snapshotAPIAndCompare("../../stdlib/jdk8/build/libs", "kotlin-stdlib-jdk8", listOf("../stdlib-jdk8-declarations.json")) + } + @Test fun kotlinStdlibJre7() { snapshotAPIAndCompare("../../stdlib/jre7/build/libs", "kotlin-stdlib-jre7", listOf("../stdlib-jre7-declarations.json")) } diff --git a/libraries/tools/kotlin-maven-plugin-test/pom.xml b/libraries/tools/kotlin-maven-plugin-test/pom.xml index 900a056a10d..087219ca1f1 100644 --- a/libraries/tools/kotlin-maven-plugin-test/pom.xml +++ b/libraries/tools/kotlin-maven-plugin-test/pom.xml @@ -127,6 +127,8 @@ org.jetbrains.kotlin:kotlin-stdlib:${project.version} org.jetbrains.kotlin:kotlin-stdlib-common:${project.version} org.jetbrains.kotlin:kotlin-stdlib-js:${project.version} + org.jetbrains.kotlin:kotlin-stdlib-jdk7:${project.version} + org.jetbrains.kotlin:kotlin-stdlib-jdk8:${project.version} org.jetbrains.kotlin:kotlin-stdlib-jre7:${project.version} org.jetbrains.kotlin:kotlin-stdlib-jre8:${project.version} org.jetbrains.kotlin:kotlin-reflect:${project.version} diff --git a/libraries/tools/kotlin-maven-plugin-test/src/it/test-kotlin-version-in-manifest/pom.xml b/libraries/tools/kotlin-maven-plugin-test/src/it/test-kotlin-version-in-manifest/pom.xml index ec8c90981e9..1b67a1f9b81 100644 --- a/libraries/tools/kotlin-maven-plugin-test/src/it/test-kotlin-version-in-manifest/pom.xml +++ b/libraries/tools/kotlin-maven-plugin-test/src/it/test-kotlin-version-in-manifest/pom.xml @@ -44,6 +44,16 @@ kotlin-stdlib-jre8 ${kotlin.version} + + org.jetbrains.kotlin + kotlin-stdlib-jdk7 + ${kotlin.version} + + + org.jetbrains.kotlin + kotlin-stdlib-jdk8 + ${kotlin.version} + org.jetbrains.kotlin kotlin-script-runtime diff --git a/libraries/tools/kotlin-maven-plugin-test/src/it/test-kotlin-version-in-manifest/src/main/kotlin/test.kt b/libraries/tools/kotlin-maven-plugin-test/src/it/test-kotlin-version-in-manifest/src/main/kotlin/test.kt index 339d170b079..0868e994d1f 100644 --- a/libraries/tools/kotlin-maven-plugin-test/src/it/test-kotlin-version-in-manifest/src/main/kotlin/test.kt +++ b/libraries/tools/kotlin-maven-plugin-test/src/it/test-kotlin-version-in-manifest/src/main/kotlin/test.kt @@ -26,6 +26,8 @@ val LIBRARIES = listOf( "kotlin-stdlib-common", "kotlin-stdlib-jre7", "kotlin-stdlib-jre8", + "kotlin-stdlib-jdk7", + "kotlin-stdlib-jdk8", "kotlin-reflect", "kotlin-script-runtime" ) diff --git a/settings.gradle b/settings.gradle index 4b4016cbe86..23680da4d26 100644 --- a/settings.gradle +++ b/settings.gradle @@ -98,6 +98,8 @@ include ":kotlin-build-common", ":kotlin-stdlib-js", ":kotlin-stdlib-jre7", ":kotlin-stdlib-jre8", + ":kotlin-stdlib-jdk7", + ":kotlin-stdlib-jdk8", ":kotlin-stdlib:samples", ":prepare:build.version", ":kotlin-build-common", @@ -154,6 +156,8 @@ project(':kotlin-stdlib').projectDir = "$rootDir/libraries/stdlib" as File project(':kotlin-stdlib-js').projectDir = "$rootDir/libraries/stdlib/js" as File project(':kotlin-stdlib-jre7').projectDir = "$rootDir/libraries/stdlib/jre7" as File project(':kotlin-stdlib-jre8').projectDir = "$rootDir/libraries/stdlib/jre8" as File +project(':kotlin-stdlib-jdk7').projectDir = "$rootDir/libraries/stdlib/jdk7" as File +project(':kotlin-stdlib-jdk8').projectDir = "$rootDir/libraries/stdlib/jdk8" as File project(':kotlin-stdlib:samples').projectDir = "$rootDir/libraries/stdlib/samples" as File project(':kotlin-reflect').projectDir = "$rootDir/libraries/tools/kotlin-reflect" as File project(':kotlin-compiler').projectDir = "$rootDir/prepare/compiler" as File