Skip to content

Commit 81e7ef0

Browse files
authored
Replace Annotation to compiler args. (#1602)
Change-Id: I691fc0f14d4bb2c62224dc77a5d0f3a08b59a75b
1 parent 4a07234 commit 81e7ef0

File tree

2 files changed

+14
-1
lines changed
  • build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid
  • core/model/src/main/kotlin/com/google/samples/apps/nowinandroid/core/model/data

2 files changed

+14
-1
lines changed

build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/KotlinAndroid.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,19 @@ private inline fun <reified T : KotlinTopLevelExtension> Project.configureKotlin
9090
// Enable experimental coroutines APIs, including Flow
9191
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
9292
)
93+
freeCompilerArgs.add(
94+
/**
95+
* Remove this args after Phase 3.
96+
* https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-consistent-copy-visibility/#deprecation-timeline
97+
*
98+
* Deprecation timeline
99+
* Phase 3. (Supposedly Kotlin 2.2 or Kotlin 2.3).
100+
* The default changes.
101+
* Unless ExposedCopyVisibility is used, the generated 'copy' method has the same visibility as the primary constructor.
102+
* The binary signature changes. The error on the declaration is no longer reported.
103+
* '-Xconsistent-data-class-copy-visibility' compiler flag and ConsistentCopyVisibility annotation are now unnecessary.
104+
*/
105+
"-Xconsistent-data-class-copy-visibility"
106+
)
93107
}
94108
}

core/model/src/main/kotlin/com/google/samples/apps/nowinandroid/core/model/data/UserNewsResource.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import kotlinx.datetime.Instant
2222
* A [NewsResource] with additional user information such as whether the user is following the
2323
* news resource's topics and whether they have saved (bookmarked) this news resource.
2424
*/
25-
@ConsistentCopyVisibility
2625
data class UserNewsResource internal constructor(
2726
val id: String,
2827
val title: String,

0 commit comments

Comments
 (0)