Skip to content

Commit

Permalink
Bump kotlin monorepo to v2 (major) (#408)
Browse files Browse the repository at this point in the history
* Bump kotlin monorepo to v2

* Bump kotlin monorepo to v2

* Bump kotlin monorepo to v2

* Fix Kotlin 2.0 support

* Revert to Gradle 8.9

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Erik Christensen <[email protected]>
  • Loading branch information
renovate[bot] and erikc5000 authored Aug 16, 2024
1 parent 81af807 commit 0bdd06b
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
!/.idea/codeStyleSettings.xml
!/.idea/codeStyles
.gradle/
.kotlin/
build/
docs/api/
site/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,6 @@ interface DateTimeTextProvider {
/**
* The default provider of localized date-time text for the current platform.
*/
expect object PlatformDateTimeTextProvider : DateTimeTextProvider
expect object PlatformDateTimeTextProvider : DateTimeTextProvider {
override fun parsableTextFor(field: DateTimeField, styles: Set<TextStyle>, locale: Locale): ParsableTextList
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ interface TimeZoneRulesProvider {
/**
* The default time zone rules provider implementation for the current platform.
*/
expect object PlatformTimeZoneRulesProvider : TimeZoneRulesProvider
expect object PlatformTimeZoneRulesProvider : TimeZoneRulesProvider {
override val availableRegionIds: Set<String>
override fun hasRulesFor(regionId: String): Boolean
override fun rulesFor(regionId: String): TimeZoneRules
}

/**
* A discontinuity in the local timeline, usually caused by daylight savings time changes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ actual object PlatformDateTimeTextProvider : DateTimeTextProvider {
val locale: Locale
)

override fun parsableTextFor(field: DateTimeField, styles: Set<TextStyle>, locale: Locale): ParsableTextList {
actual override fun parsableTextFor(field: DateTimeField, styles: Set<TextStyle>, locale: Locale): ParsableTextList {
if (styles.isEmpty() || !supports(field)) {
return emptyList()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ actual object PlatformTimeZoneRulesProvider : TimeZoneRulesProvider {
private val cachedRegionIds = (NSTimeZone.knownTimeZoneNames as List<String>).toSet()

override val databaseVersion: String get() = NSTimeZone.timeZoneDataVersion
override val availableRegionIds: Set<String> get() = cachedRegionIds
actual override val availableRegionIds: Set<String> get() = cachedRegionIds

override fun hasRulesFor(regionId: String): Boolean {
actual override fun hasRulesFor(regionId: String): Boolean {
return cachedRegionIds.contains(regionId) || NSTimeZone.timeZoneWithName(regionId) != null
}

override fun rulesFor(regionId: String): TimeZoneRules {
actual override fun rulesFor(regionId: String): TimeZoneRules {
return timeZoneRules.getOrPut(regionId) {
DarwinTimeZoneRules(
NSTimeZone.timeZoneWithName(regionId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ actual object PlatformDateTimeTextProvider : DateTimeTextProvider {
val locale: Locale
)

override fun parsableTextFor(
actual override fun parsableTextFor(
field: DateTimeField,
styles: Set<TextStyle>,
locale: Locale
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ actual object PlatformTimeZoneRulesProvider : TimeZoneRulesProvider {
throw TimeZoneRulesException(e.message, e)
}

override val availableRegionIds: Set<String>
actual override val availableRegionIds: Set<String>
get() = ZoneId.getAvailableZoneIds()

override fun hasRulesFor(regionId: String): Boolean {
actual override fun hasRulesFor(regionId: String): Boolean {
return availableRegionIds.contains(regionId)
}

override fun rulesFor(regionId: String): TimeZoneRules {
actual override fun rulesFor(regionId: String): TimeZoneRules {
return try {
JavaTimeZoneRules(ZoneId.of(regionId).rules)
} catch (e: ZoneRulesException) {
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
kotlin = "1.9.25"
kotlin = "2.0.10"
dokka = "1.9.10"
serialization = "1.6.3"
atomicfu = "0.24.0"
Expand Down

0 comments on commit 0bdd06b

Please sign in to comment.