gabrielittner / lazythreetenbp Goto Github PK
View Code? Open in Web Editor NEWA lazy loading ZoneRuleProvider for ThreeTenBp.
License: Apache License 2.0
A lazy loading ZoneRuleProvider for ThreeTenBp.
License: Apache License 2.0
I'm using a library in my app which has a dependency on org.threeten:threetenbp:1.3.4
. After adding LazyThreeTenBP, my build broke with:
Error:com.android.builder.merge.DuplicateRelativeFileException: More than one file was found with OS independent path 'org/threeten/bp/format/ChronologyText.properties'
After investigating, it seems that LazyThreeTenBP has a compile dependency on treetenbp's no-tzdb
artifact, which breaks my dependency resolution and results in both artifacts being bundled. I can easily fix this by excluding that library's dependency, but it might be nicer if LazyThreeTenBP had an api
dependency on ThreeTenBP instead, and relied on the app to depend on it explicitly.
Hey ๐
I wasn't sure if the library is still maintained so I allowed myself to fork it and adjust it to my needs and I think I spotted an issue you should be aware of. It seems like the published artifact contains GeneratedZoneIdsProvider
which comes from sources:
generated/ticktock
๐ค
Here's how the diff looks like:
doesn't seem significant, but it felt like worth reporting here. It isn't intended, right?
Everything needs test. The compiler and provider could probably borrow from threetenbp for that.
What would be the difference in using this with no-tzdb
or using https://github.com/JakeWharton/ThreeTenABP?
Generally not a huge problem because the API is stable but it would be nice to get rid of it at least for runtime. Maybe there is a way without copying a lot of code.
Runtime:
org.threeten.bp.zone.StandardZoneRules.readExternal(DataInputStream)
to read tz data from fileCompiler:
org.threeten.bp.zone.TzdbZoneRulesCompiler
to parse input dataorg.threeten.bp.zone.StandardZoneRules.writeExternal(DataOutput)
to write tz data to file2022b has been released 2022-08-10 and its corresponding new rule could be effective as early as September 10th, 2022.
https://www.iana.org/time-zones
org.threeten.bp.zone.ZoneRulesProvider
tries to load available providers using ServiceLoader
in a static initializer block. That's not needed on Android. From some quick measurements costs up to 20ms for doing nothing. The measurement was done by calling ZoneRulesProvider.getAvailableZoneIds()
before the tz initialization (the method itself is basically a no-op in that case but triggers the block).
Need support for newer version of the 1.6.8 tz db, as I have bumped up the library which caused some errors for timezones not supported.
Plus I am not sure downgrading the tz db version will cause some downgrade issues/problems
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.