-
Notifications
You must be signed in to change notification settings - Fork 5
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
Handle date/time conversion in runtime via instantiable FormattedResources
#390
Draft
drewhamilton
wants to merge
17
commits into
main
Choose a base branch
from
drew/handle-date-time-conversion-in-runtime-via-injection
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
e59ddad
Add DateTimeConverter to runtime
drewhamilton 1363960
Generate DateTimeConverter instance in FormattedResources
drewhamilton f9a4c49
Rename all functions to `convertToCalendar`
drewhamilton 1e7ea0c
Generate use of dateTimeConverter in FormattedResources
drewhamilton 8d4a7da
Convert AndroidDateTimeConverter locale to lazy
drewhamilton 71ed64c
Add sample FormattedResourcesTest using dateTimeConverter substitution
drewhamilton ad34fc9
API dump
drewhamilton 129e9bf
Delete extra `copy`s
drewhamilton 128e07c
Add SubclassOptInRequired to DateTimeConverter
drewhamilton 7c7bd72
Test ICU4J in TypesTest to compare results with Android ICU
drewhamilton 4257663
Make `dateTimeConverter` public, visible for testing
drewhamilton 2ca2f81
Generate injectable FormattedResources along with default AndroidForm…
drewhamilton 91f00b7
Fix new NNBSP logic in TypesTest
drewhamilton d02b811
Rename FormattedResources to ParaphraseResources
drewhamilton 31c64d0
Add deprecated FormattedResources val to simplify migration to new na…
drewhamilton 12d4335
Publish JvmDateTimeConverter in new :runtime-test module
drewhamilton 087cf0d
Spotless
drewhamilton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
public final class app/cash/paraphrase/runtime/test/JvmDateTimeConverter : app/cash/paraphrase/DateTimeConverter { | ||
public static final field INSTANCE Lapp/cash/paraphrase/runtime/test/JvmDateTimeConverter; | ||
public fun convertToCalendar (Ljava/time/LocalDate;)Lcom/ibm/icu/util/Calendar; | ||
public synthetic fun convertToCalendar (Ljava/time/LocalDate;)Ljava/lang/Object; | ||
public fun convertToCalendar (Ljava/time/LocalDateTime;)Lcom/ibm/icu/util/Calendar; | ||
public synthetic fun convertToCalendar (Ljava/time/LocalDateTime;)Ljava/lang/Object; | ||
public fun convertToCalendar (Ljava/time/LocalTime;)Lcom/ibm/icu/util/Calendar; | ||
public synthetic fun convertToCalendar (Ljava/time/LocalTime;)Ljava/lang/Object; | ||
public fun convertToCalendar (Ljava/time/OffsetDateTime;)Lcom/ibm/icu/util/Calendar; | ||
public synthetic fun convertToCalendar (Ljava/time/OffsetDateTime;)Ljava/lang/Object; | ||
public fun convertToCalendar (Ljava/time/OffsetTime;)Lcom/ibm/icu/util/Calendar; | ||
public synthetic fun convertToCalendar (Ljava/time/OffsetTime;)Ljava/lang/Object; | ||
public fun convertToCalendar (Ljava/time/ZoneOffset;)Lcom/ibm/icu/util/Calendar; | ||
public synthetic fun convertToCalendar (Ljava/time/ZoneOffset;)Ljava/lang/Object; | ||
public fun convertToCalendar (Ljava/time/ZonedDateTime;)Lcom/ibm/icu/util/Calendar; | ||
public synthetic fun convertToCalendar (Ljava/time/ZonedDateTime;)Ljava/lang/Object; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
plugins { | ||
alias(libs.plugins.androidLibrary) | ||
alias(libs.plugins.kotlinAndroid) | ||
alias(libs.plugins.mavenPublish) | ||
} | ||
|
||
android { | ||
namespace = "app.cash.paraphrase.test" | ||
compileSdk = 34 | ||
|
||
defaultConfig { | ||
minSdk = 24 | ||
} | ||
|
||
compileOptions { | ||
isCoreLibraryDesugaringEnabled = true | ||
} | ||
} | ||
|
||
dependencies { | ||
api(projects.runtime) | ||
|
||
api(libs.icu4j) | ||
|
||
coreLibraryDesugaring(libs.coreLibraryDesugaring) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Maven | ||
POM_ARTIFACT_ID=paraphrase-runtime-test | ||
POM_NAME=Paraphrase test runtime |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
There's not a more concise way to share the
ParameterSpec
and thePropertySpec
that have the same name and type, is there?