New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Kotlin to 1.7.20-RC #2682
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
dokka_it_kotlin_version=1.7.10 | ||
dokka_it_kotlin_version=1.7.20-RC | ||
dokka_it_android_gradle_plugin_version=4.0.0 | ||
android.useAndroidX=true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
dokka_it_kotlin_version=1.7.10 | ||
dokka_it_kotlin_version=1.7.20-RC |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
dokka_it_kotlin_version=1.7.10 | ||
dokka_it_kotlin_version=1.7.20-RC |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
dokka_it_kotlin_version=1.7.10 | ||
dokka_it_kotlin_version=1.7.20-RC |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
dokka_it_kotlin_version=1.7.10 | ||
dokka_it_kotlin_version=1.7.20-RC | ||
react_version=18.1.0-pre.345 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
dokka_it_kotlin_version=1.7.10 | ||
dokka_it_kotlin_version=1.7.20-RC |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
dokka_it_kotlin_version=1.7.10 | ||
dokka_it_kotlin_version=1.7.20-RC |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
dokka_it_kotlin_version=1.7.10 | ||
dokka_it_kotlin_version=1.7.20-RC | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
dokka_it_kotlin_version=1.7.10 | ||
dokka_it_kotlin_version=1.7.20-RC | ||
#these flags are enabled by default since 1.6.20. | ||
#remove when this test is executed with Kotlin >= 1.6.20 | ||
kotlin.mpp.enableGranularSourceSetsMetadata=true | ||
kotlin.native.enableDependencyPropagation=false | ||
kotlin.native.enableDependencyPropagation=false |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,26 +10,36 @@ import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet | |
internal typealias KotlinCompilation = | ||
org.jetbrains.kotlin.gradle.plugin.KotlinCompilation<KotlinCommonOptions> | ||
|
||
internal fun Project.compilationsOf(sourceSet: KotlinSourceSet): List<KotlinCompilation> { | ||
//KT-45412 Make sure .kotlinSourceSets and .allKotlinSourceSets include the default source set | ||
return allCompilationsOf(sourceSet).filter { compilation -> | ||
sourceSet in compilation.kotlinSourceSets || sourceSet == compilation.defaultSourceSet | ||
} | ||
} | ||
|
||
internal fun Project.allCompilationsOf( | ||
sourceSet: KotlinSourceSet | ||
): List<KotlinCompilation> { | ||
return when (val kotlin = kotlin) { | ||
is KotlinMultiplatformExtension -> kotlin.allCompilationsOf(sourceSet) | ||
is KotlinSingleTargetExtension -> kotlin.allCompilationsOf(sourceSet) | ||
is KotlinMultiplatformExtension -> allCompilationsOf(kotlin, sourceSet) | ||
is KotlinSingleTargetExtension<*> -> allCompilationsOf(kotlin, sourceSet) | ||
else -> emptyList() | ||
} | ||
} | ||
|
||
internal fun Project.compilationsOf(sourceSet: KotlinSourceSet): List<KotlinCompilation> { | ||
//KT-45412 Make sure .kotlinSourceSets and .allKotlinSourceSets include the default source set | ||
return allCompilationsOf(sourceSet).filter { compilation -> sourceSet in compilation.kotlinSourceSets || sourceSet == compilation.defaultSourceSet } | ||
} | ||
|
||
private fun KotlinMultiplatformExtension.allCompilationsOf(sourceSet: KotlinSourceSet): List<KotlinCompilation> { | ||
val allCompilations = targets.flatMap { target -> target.compilations } | ||
return allCompilations.filter { compilation -> sourceSet in compilation.allKotlinSourceSets || sourceSet == compilation.defaultSourceSet } | ||
Comment on lines
-23
to
-30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It failed with
|
||
private fun allCompilationsOf( | ||
kotlin: KotlinMultiplatformExtension, | ||
sourceSet: KotlinSourceSet | ||
): List<KotlinCompilation> { | ||
val allCompilations = kotlin.targets.flatMap { target -> target.compilations } | ||
return allCompilations.filter { compilation -> | ||
sourceSet in compilation.allKotlinSourceSets || sourceSet == compilation.defaultSourceSet | ||
} | ||
} | ||
|
||
private fun KotlinSingleTargetExtension.allCompilationsOf(sourceSet: KotlinSourceSet): List<KotlinCompilation> { | ||
return target.compilations.filter { compilation -> sourceSet in compilation.allKotlinSourceSets } | ||
private fun allCompilationsOf( | ||
kotlin: KotlinSingleTargetExtension<*>, | ||
sourceSet: KotlinSourceSet | ||
): List<KotlinCompilation> { | ||
return kotlin.target.compilations.filter { compilation -> sourceSet in compilation.allKotlinSourceSets } | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,7 +113,7 @@ class GradleDokkaSourceSetBuilderTest { | |
sourceSet.dependsOn(sourceSet.DokkaSourceSetID("s3")) | ||
sourceSet.dependsOn(GradleDokkaSourceSetBuilder("s4", project)) | ||
sourceSet.dependsOn(GradleDokkaSourceSetBuilder("s5", project).build()) | ||
sourceSet.dependsOn(DefaultKotlinSourceSet(project, "s6")) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like there was some refactoring of gradle api, |
||
sourceSet.dependsOn(createDefaultKotlinSourceSet("s6")) | ||
sourceSet.dependsOn(DefaultAndroidSourceSet("s7", project, false)) | ||
|
||
assertEquals( | ||
|
@@ -123,6 +123,10 @@ class GradleDokkaSourceSetBuilderTest { | |
) | ||
} | ||
|
||
private fun createDefaultKotlinSourceSet(displayName: String): DefaultKotlinSourceSet { | ||
return project.objects.newInstance(DefaultKotlinSourceSet::class.java, project, displayName) | ||
} | ||
|
||
@Test | ||
fun samples() { | ||
val sourceSet = GradleDokkaSourceSetBuilder("", project) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A new primary constructor arg has been added (doesn't look like we need it), so have to use named parameters