Skip to content

Commit 39f06fd

Browse files
Revert "Upgrade Kotlin to 2.3.10"
This reverts commit ed6b7cb.
1 parent ed6b7cb commit 39f06fd

File tree

8 files changed

+144
-43
lines changed

8 files changed

+144
-43
lines changed

build.gradle.kts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@
1414
* limitations under the License.
1515
*/
1616
import com.vanniktech.maven.publish.AndroidSingleVariantLibrary
17-
import com.vanniktech.maven.publish.JavadocJar
1817
import com.vanniktech.maven.publish.MavenPublishBaseExtension
1918
import kotlinx.validation.ApiValidationExtension
20-
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2119
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2220
import org.jlleitschuh.gradle.ktlint.KtlintExtension
2321
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType
@@ -37,7 +35,6 @@ buildscript {
3735
classpath(libs.build.android)
3836
classpath(libs.build.mavenPublish)
3937
classpath(libs.build.kotlin)
40-
classpath(libs.build.compose.compiler)
4138
classpath(libs.build.ktlint)
4239
classpath(libs.build.binaryCompatibility)
4340
// Required for the gradle-maven-publish-plugin plugin.
@@ -82,21 +79,20 @@ subprojects {
8279
signAllPublications()
8380
pomFromGradleProperties()
8481

85-
@Suppress("DEPRECATION")
8682
configure(
8783
AndroidSingleVariantLibrary(variant = "release", sourcesJar = true, publishJavadocJar = true),
8884
)
8985
}
9086
}
9187

9288
tasks.withType<KotlinCompile> {
93-
compilerOptions {
89+
kotlinOptions {
9490
// Allow warnings when running from IDE, makes it easier to experiment.
9591
if (!isRunningFromIde) {
96-
allWarningsAsErrors.set(true)
92+
allWarningsAsErrors = true
9793
}
9894

99-
jvmTarget.set(JvmTarget.JVM_1_8)
95+
jvmTarget = "1.8"
10096
}
10197
}
10298

@@ -112,7 +108,6 @@ subprojects {
112108
reporter(ReporterType.JSON)
113109
}
114110

115-
@Suppress("DEPRECATION")
116111
disabledRules.set(
117112
setOf(
118113
// IntelliJ refuses to sort imports correctly.

compose-tests/build.gradle.kts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
21
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
32

43
plugins {
54
id("com.android.library")
65
kotlin("android")
7-
id("org.jetbrains.kotlin.plugin.compose")
86
}
97

108
android {
@@ -26,6 +24,10 @@ android {
2624
compose = true
2725
}
2826

27+
composeOptions {
28+
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
29+
}
30+
2931
packaging {
3032
resources.excludes += listOf(
3133
"META-INF/AL2.0",
@@ -37,10 +39,10 @@ android {
3739
}
3840

3941
tasks.withType<KotlinCompile> {
40-
compilerOptions {
41-
jvmTarget.set(JvmTarget.JVM_1_8)
42-
freeCompilerArgs.addAll(
43-
"-opt-in=kotlin.RequiresOptIn"
42+
kotlinOptions {
43+
jvmTarget = "1.8"
44+
freeCompilerArgs += listOf(
45+
"-Xopt-in=kotlin.RequiresOptIn"
4446
)
4547
}
4648
}

compose-unsupported-tests/build.gradle.kts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
21
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
32

43
plugins {
54
id("com.android.library")
65
kotlin("android")
7-
id("org.jetbrains.kotlin.plugin.compose")
86
}
97

108
android {
@@ -26,6 +24,10 @@ android {
2624
compose = true
2725
}
2826

27+
composeOptions {
28+
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
29+
}
30+
2931
packaging {
3032
resources.excludes += listOf(
3133
"META-INF/AL2.0",
@@ -37,10 +39,10 @@ android {
3739
}
3840

3941
tasks.withType<KotlinCompile> {
40-
compilerOptions {
41-
jvmTarget.set(JvmTarget.JVM_1_8)
42-
freeCompilerArgs.addAll(
43-
"-opt-in=kotlin.RequiresOptIn"
42+
kotlinOptions {
43+
jvmTarget = "1.8"
44+
freeCompilerArgs += listOf(
45+
"-Xopt-in=kotlin.RequiresOptIn"
4446
)
4547
}
4648
}

gradle/libs.versions.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
[versions]
22

3-
kotlin = "2.3.10"
3+
kotlin = "1.9.10"
44
androidx-test = "1.5.0"
5+
compose-compiler = "1.5.3"
6+
57
# We compile against an older version of Compose intentionally to support consumers that aren't on
68
# the latest.
79
#noinspection GradleDependency
@@ -12,16 +14,16 @@ compose = "1.10.1"
1214
compose-old = "1.3.0"
1315
# Use a separate property for the sample so we can test with different versions easily.
1416
compose-sample = "1.6.8"
17+
compose-sample-compiler = "1.5.3"
1518

1619
[libraries]
1720

1821
build-android = "com.android.tools.build:gradle:8.13.2"
1922
build-mavenPublish = "com.vanniktech:gradle-maven-publish-plugin:0.36.0"
2023
build-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
21-
build-compose-compiler = { module = "org.jetbrains.kotlin:compose-compiler-gradle-plugin", version.ref = "kotlin" }
2224
build-ktlint = "org.jlleitschuh.gradle:ktlint-gradle:11.6.1"
23-
build-binaryCompatibility = "org.jetbrains.kotlinx:binary-compatibility-validator:0.16.3"
24-
build-dokka = "org.jetbrains.dokka:dokka-gradle-plugin:2.1.0"
25+
build-binaryCompatibility = "org.jetbrains.kotlinx:binary-compatibility-validator:0.6.0"
26+
build-dokka = "org.jetbrains.dokka:dokka-gradle-plugin:1.9.10"
2527

2628
appCompat = "androidx.appcompat:appcompat:1.3.1"
2729
constraintLayout = "androidx.constraintlayout:constraintlayout:2.1.0"

radiography/api/radiography.api

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ public abstract interface annotation class radiography/ExperimentalRadiographyCo
88

99
public final class radiography/Radiography {
1010
public static final field INSTANCE Lradiography/Radiography;
11+
public final synthetic fun renderScannableViewTree$radiography_release (Ljava/lang/StringBuilder;Lradiography/ScannableView;Ljava/util/List;Lradiography/ViewFilter;)V
1112
public static final fun scan ()Ljava/lang/String;
1213
public static final fun scan (Lradiography/ScanScope;)Ljava/lang/String;
1314
public static final fun scan (Lradiography/ScanScope;Ljava/util/List;)Ljava/lang/String;
@@ -21,6 +22,7 @@ public abstract interface class radiography/ScanScope {
2122

2223
public final class radiography/ScanScopes {
2324
public static final field AllWindowsScope Lradiography/ScanScope;
25+
public static final field EmptyScope Lradiography/ScanScope;
2426
public static final field FocusedWindowScope Lradiography/ScanScope;
2527
public static final field INSTANCE Lradiography/ScanScopes;
2628
public static final fun composeTestTagScope (Ljava/lang/String;)Lradiography/ScanScope;
@@ -76,6 +78,10 @@ public final class radiography/ScannableView$ComposeView : radiography/Scannable
7678
public fun toString ()Ljava/lang/String;
7779
}
7880

81+
public final class radiography/ScannableViewKt {
82+
public static final fun toScannableView (Lradiography/internal/ComposeLayoutInfo;)Lradiography/ScannableView;
83+
}
84+
7985
public abstract interface class radiography/ViewFilter {
8086
public abstract fun matches (Lradiography/ScannableView;)Z
8187
}
@@ -85,6 +91,7 @@ public final class radiography/ViewFilters {
8591
public static final field NoFilter Lradiography/ViewFilter;
8692
public static final fun and (Lradiography/ViewFilter;Lradiography/ViewFilter;)Lradiography/ViewFilter;
8793
public static final fun androidViewFilterFor (Ljava/lang/Class;Lkotlin/jvm/functions/Function1;)Lradiography/ViewFilter;
94+
public final synthetic fun androidViewFilterFor (Lkotlin/jvm/functions/Function1;)Lradiography/ViewFilter;
8895
public static final fun skipComposeTestTagsFilter ([Ljava/lang/String;)Lradiography/ViewFilter;
8996
public static final fun skipIdsViewFilter ([I)Lradiography/ViewFilter;
9097
}
@@ -100,6 +107,10 @@ public final class radiography/ViewStateRenderers {
100107
public static final field INSTANCE Lradiography/ViewStateRenderers;
101108
public static final field ViewRenderer Lradiography/ViewStateRenderer;
102109
public static final fun androidViewStateRendererFor (Ljava/lang/Class;Lkotlin/jvm/functions/Function2;)Lradiography/ViewStateRenderer;
110+
public final synthetic fun androidViewStateRendererFor (Lkotlin/jvm/functions/Function2;)Lradiography/ViewStateRenderer;
111+
public final fun appendTextValue$radiography_release (Lradiography/AttributeAppendable;Ljava/lang/String;Ljava/lang/CharSequence;ZI)V
112+
public static final synthetic fun composeTextRenderer$radiography_release (ZI)Lradiography/ViewStateRenderer;
113+
public static synthetic fun composeTextRenderer$radiography_release$default (ZIILjava/lang/Object;)Lradiography/ViewStateRenderer;
103114
public static final fun textViewRenderer ()Lradiography/ViewStateRenderer;
104115
public static final fun textViewRenderer (Z)Lradiography/ViewStateRenderer;
105116
public static final fun textViewRenderer (ZI)Lradiography/ViewStateRenderer;
@@ -111,3 +122,91 @@ public final class radiography/ViewsKt {
111122
public static synthetic fun scan$default (Landroid/view/View;Ljava/util/List;Lradiography/ViewFilter;ILjava/lang/Object;)Ljava/lang/String;
112123
}
113124

125+
public abstract class radiography/internal/ComposeLayoutInfo {
126+
}
127+
128+
public final class radiography/internal/ComposeLayoutInfo$AndroidViewInfo : radiography/internal/ComposeLayoutInfo {
129+
public fun <init> (Landroid/view/View;)V
130+
public final fun component1 ()Landroid/view/View;
131+
public final fun copy (Landroid/view/View;)Lradiography/internal/ComposeLayoutInfo$AndroidViewInfo;
132+
public static synthetic fun copy$default (Lradiography/internal/ComposeLayoutInfo$AndroidViewInfo;Landroid/view/View;ILjava/lang/Object;)Lradiography/internal/ComposeLayoutInfo$AndroidViewInfo;
133+
public fun equals (Ljava/lang/Object;)Z
134+
public final fun getView ()Landroid/view/View;
135+
public fun hashCode ()I
136+
public fun toString ()Ljava/lang/String;
137+
}
138+
139+
public final class radiography/internal/ComposeLayoutInfo$LayoutNodeInfo : radiography/internal/ComposeLayoutInfo {
140+
public fun <init> (Ljava/lang/String;Ljava/util/List;Landroidx/compose/ui/unit/IntRect;Ljava/util/List;Lkotlin/sequences/Sequence;Ljava/util/List;)V
141+
public final fun component1 ()Ljava/lang/String;
142+
public final fun component2 ()Ljava/util/List;
143+
public final fun component3 ()Landroidx/compose/ui/unit/IntRect;
144+
public final fun component4 ()Ljava/util/List;
145+
public final fun component5 ()Lkotlin/sequences/Sequence;
146+
public final fun component6 ()Ljava/util/List;
147+
public final fun copy (Ljava/lang/String;Ljava/util/List;Landroidx/compose/ui/unit/IntRect;Ljava/util/List;Lkotlin/sequences/Sequence;Ljava/util/List;)Lradiography/internal/ComposeLayoutInfo$LayoutNodeInfo;
148+
public static synthetic fun copy$default (Lradiography/internal/ComposeLayoutInfo$LayoutNodeInfo;Ljava/lang/String;Ljava/util/List;Landroidx/compose/ui/unit/IntRect;Ljava/util/List;Lkotlin/sequences/Sequence;Ljava/util/List;ILjava/lang/Object;)Lradiography/internal/ComposeLayoutInfo$LayoutNodeInfo;
149+
public fun equals (Ljava/lang/Object;)Z
150+
public final fun getBounds ()Landroidx/compose/ui/unit/IntRect;
151+
public final fun getCallChain ()Ljava/util/List;
152+
public final fun getChildren ()Lkotlin/sequences/Sequence;
153+
public final fun getModifiers ()Ljava/util/List;
154+
public final fun getName ()Ljava/lang/String;
155+
public final fun getSemanticsNodes ()Ljava/util/List;
156+
public fun hashCode ()I
157+
public fun toString ()Ljava/lang/String;
158+
}
159+
160+
public final class radiography/internal/ComposeLayoutInfo$SubcompositionInfo : radiography/internal/ComposeLayoutInfo {
161+
public fun <init> (Ljava/lang/String;Ljava/util/List;Landroidx/compose/ui/unit/IntRect;Lkotlin/sequences/Sequence;)V
162+
public final fun component1 ()Ljava/lang/String;
163+
public final fun component2 ()Ljava/util/List;
164+
public final fun component3 ()Landroidx/compose/ui/unit/IntRect;
165+
public final fun component4 ()Lkotlin/sequences/Sequence;
166+
public final fun copy (Ljava/lang/String;Ljava/util/List;Landroidx/compose/ui/unit/IntRect;Lkotlin/sequences/Sequence;)Lradiography/internal/ComposeLayoutInfo$SubcompositionInfo;
167+
public static synthetic fun copy$default (Lradiography/internal/ComposeLayoutInfo$SubcompositionInfo;Ljava/lang/String;Ljava/util/List;Landroidx/compose/ui/unit/IntRect;Lkotlin/sequences/Sequence;ILjava/lang/Object;)Lradiography/internal/ComposeLayoutInfo$SubcompositionInfo;
168+
public fun equals (Ljava/lang/Object;)Z
169+
public final fun getBounds ()Landroidx/compose/ui/unit/IntRect;
170+
public final fun getCallChain ()Ljava/util/List;
171+
public final fun getChildren ()Lkotlin/sequences/Sequence;
172+
public final fun getName ()Ljava/lang/String;
173+
public fun hashCode ()I
174+
public fun toString ()Ljava/lang/String;
175+
}
176+
177+
public final class radiography/internal/ComposeLayoutInfoKt {
178+
public static final fun computeLayoutInfos (Landroidx/compose/ui/tooling/data/Group;Ljava/util/List;Landroidx/compose/ui/semantics/SemanticsOwner;)Lkotlin/sequences/Sequence;
179+
public static synthetic fun computeLayoutInfos$default (Landroidx/compose/ui/tooling/data/Group;Ljava/util/List;Landroidx/compose/ui/semantics/SemanticsOwner;ILjava/lang/Object;)Lkotlin/sequences/Sequence;
180+
}
181+
182+
public final class radiography/internal/ComposeViewsKt {
183+
public static final field COMPOSE_UNSUPPORTED_MESSAGE Ljava/lang/String;
184+
public static final fun composeRenderingError (Ljava/lang/LinkageError;)Lradiography/ScannableView;
185+
public static final fun getComposeScannableViews (Landroid/view/View;)Lkotlin/Pair;
186+
public static final fun getMightBeComposeView (Landroid/view/View;)Z
187+
public static final fun isComposeAvailable ()Z
188+
}
189+
190+
public final class radiography/internal/CompositionContextsKt {
191+
public static final fun getCompositionContexts (Landroidx/compose/ui/tooling/data/Group;)Lkotlin/sequences/Sequence;
192+
public static final fun tryGetComposers (Landroidx/compose/runtime/CompositionContext;)Ljava/lang/Iterable;
193+
}
194+
195+
public final class radiography/internal/RenderTreeStringKt {
196+
public static final fun renderTreeString (Ljava/lang/StringBuilder;Ljava/lang/Object;Lkotlin/jvm/functions/Function2;)V
197+
}
198+
199+
public final class radiography/internal/SemanticsKt {
200+
public static final fun findTestTags (Lradiography/ScannableView$ComposeView;)Lkotlin/sequences/Sequence;
201+
}
202+
203+
public final class radiography/internal/SemanticsPropertiesHelpers {
204+
public static final field INSTANCE Lradiography/internal/SemanticsPropertiesHelpers;
205+
public final fun getHideFromAccessibility ()Landroidx/compose/ui/semantics/SemanticsPropertyKey;
206+
}
207+
208+
public final class radiography/internal/StringsKt {
209+
public static final fun ellipsize (Ljava/lang/CharSequence;I)Ljava/lang/CharSequence;
210+
public static final fun formatPixelDimensions (II)Ljava/lang/String;
211+
}
212+

radiography/build.gradle.kts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,17 @@ android {
4747
}
4848

4949
tasks.withType<KotlinCompile> {
50-
compilerOptions {
51-
freeCompilerArgs.addAll(
52-
listOfNotNull(
53-
"-opt-in=kotlin.RequiresOptIn",
50+
kotlinOptions {
51+
freeCompilerArgs += listOfNotNull(
52+
"-Xopt-in=kotlin.RequiresOptIn",
5453

55-
// Require explicit public modifiers and types.
56-
// TODO this should be moved to a top-level `kotlin { explicitApi() }` once that's working
57-
// for android projects, see https://youtrack.jetbrains.com/issue/KT-37652.
58-
"-Xexplicit-api=strict".takeUnless {
59-
// Tests aren't part of the public API, don't turn explicit API mode on for them.
60-
name.contains("test", ignoreCase = true)
61-
}
62-
)
54+
// Require explicit public modifiers and types.
55+
// TODO this should be moved to a top-level `kotlin { explicitApi() }` once that's working
56+
// for android projects, see https://youtrack.jetbrains.com/issue/KT-37652.
57+
"-Xexplicit-api=strict".takeUnless {
58+
// Tests aren't part of the public API, don't turn explicit API mode on for them.
59+
name.contains("test", ignoreCase = true)
60+
}
6361
)
6462
}
6563
}

radiography/src/main/java/radiography/internal/RenderTreeString.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ private fun <N> renderRecursively(
3030

3131
nodeDescription.lineSequence().forEachIndexed { index, line ->
3232
builder.appendLinePrefix(depth, continuePreviousLine = index > 0, lastChildMask = lastChildMask)
33-
builder.appendLine(line)
33+
@Suppress("DEPRECATION")
34+
(builder.appendln(line))
3435
}
3536

3637
val lastChildIndex = children.size - 1

sample-compose/build.gradle.kts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
21
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
32

43
plugins {
54
id("com.android.application")
65
kotlin("android")
7-
id("org.jetbrains.kotlin.plugin.compose")
86
}
97

108
android {
@@ -26,6 +24,10 @@ android {
2624
compose = true
2725
}
2826

27+
composeOptions {
28+
kotlinCompilerExtensionVersion = libs.versions.compose.sample.compiler.get()
29+
}
30+
2931
packaging {
3032
resources.excludes += listOf(
3133
"META-INF/AL2.0",
@@ -37,10 +39,10 @@ android {
3739
}
3840

3941
tasks.withType<KotlinCompile> {
40-
compilerOptions {
41-
jvmTarget.set(JvmTarget.JVM_1_8)
42-
freeCompilerArgs.addAll(
43-
"-opt-in=kotlin.RequiresOptIn"
42+
kotlinOptions {
43+
jvmTarget = "1.8"
44+
freeCompilerArgs += listOf(
45+
"-Xopt-in=kotlin.RequiresOptIn"
4446
)
4547
}
4648
}

0 commit comments

Comments
 (0)