Skip to content

removed duplicated dependencies, changed synctools to davx5 - #2354

Open
patrickunterwegs wants to merge 3 commits into
developfrom
claude/ical4j-direct-no-synctools
Open

removed duplicated dependencies, changed synctools to davx5#2354
patrickunterwegs wants to merge 3 commits into
developfrom
claude/ical4j-direct-no-synctools

Conversation

@patrickunterwegs

Copy link
Copy Markdown
Member

No description provided.

patrickunterwegs and others added 3 commits July 16, 2026 16:57
* Migrate Ical4androidUtil to davx5 synctools API (ical4j 4.x)

The davx5-ose synctools submodule replaced the former fat JtxICalObject /
JtxCollection<T> classes with an Entity + builder/handler design and moved
the packages from at.bitfire.ical4android to at.bitfire.synctools.

Rewrite the ICS import/export helpers accordingly, mirroring DAVx5's own
JtxSyncManager usage:

- Look up collections via JtxCollectionProvider.getCollection().
- Export: map jtx objects (main + recurrence exceptions) to VJOURNAL/VTODO
  with JtxObjectHandler + AndroidAttachmentFetcher, then build and output a
  single VCALENDAR via ical4j.
- Import: parse with ICalendarParser, group components by UID with
  CalendarUidSplitter, build entities with JtxObjectBuilder, mark them dirty
  and insert via JtxRecurringCollection; keep UID/sequence de-duplication
  against existing entries.
- Drop the obsolete LocalJtxICalObject / LocalJtxCollection subclasses.
- Acquire and close the content provider client per call.

Also point ICalObject.kt's TimeApiExtensions.toLocalDate import at the new
at.bitfire.synctools.util package.

The in-file duplicate-UID import test now expects 0 skipped, because
CalendarUidSplitter already collapses same-UID/same-RECURRENCE-ID components
during parsing (per RFC 5545); DB-level skipping on re-import is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011JEizQuqZkmoSJf6saEPDH

* Source synctools via davx5-ose submodule composite build

The jitpack artifact com.github.bitfireat.davx5-ose:synctools:v4.5.17.1-ose
does not resolve (jitpack can't build/serve the davx5-ose multi-module
project), which fails the build before any source compiles.

Consume synctools from source instead:
- Add davx5-ose as a Git submodule pinned to tag v4.5.17.1-ose.
- Include it as a Gradle composite build in settings.gradle.kts, with an
  explicit dependencySubstitution mapping the version-catalog coordinate
  (libs.synctools) to the local :synctools project. The explicit target keeps
  only :synctools and davx5-ose's build-logic configured, not :app-ose/:core.

jtxBoard and davx5-ose v4.5.17.1-ose are version-aligned (Gradle 9.6.1,
AGP 9.2.1, Kotlin 2.4.0, KSP 2.3.9, Java toolchain 21), synctools' own
dependencies come from Maven Central/Google, and all CI workflows already
check out submodules, so no workflow changes are needed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011JEizQuqZkmoSJf6saEPDH

* Use desugar_jdk_libs_nio to match synctools requirement

The synctools library requires the desugar_jdk_libs_nio core-library
desugaring flavor (java.nio support), so :app:checkOseDebugAarMetadata failed
with the base desugar_jdk_libs variant. Switch to the _nio artifact (same
version 2.1.5, a superset), matching davx5-ose's own configuration.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011JEizQuqZkmoSJf6saEPDH

---------

Co-authored-by: Claude <noreply@anthropic.com>
Remove the dependency on the (discontinued) synctools library and the davx5-ose
Git submodule entirely, and implement the local .ics import/export directly on
ical4j 4.x against jtx Board's own data model.

- ICalendarMapping.kt: maps ICalObject + sub-entities <-> VJOURNAL/VTODO (incl.
  VALARM), ported from the proven pre-synctools ical4j mapping and adapted to
  jtx Board's models, contract JSON helpers and Css3Color.
- UnknownProperty.kt: minimal ical4j property <-> JSON (un)known-property helper.
- TemporalExtensions.kt: toTimestamp/toLocalDate/getTimeZoneId helpers that
  replace the former synctools time utilities.
- Ical4androidUtil.kt: reads/writes via the Room DAO (blocking *Sync methods),
  assembles/parses the iCalendar with ical4j; keeps UID/sequence de-duplication
  on import and marks imported entries dirty.
- ICalDatabaseDao.kt: add blocking getters needed for export
  (organizer/unknown/relatedto per object, ids-by-collection, by-UID).
- Point ICalObject/DetailsCardRecur time-util imports at the new local helpers.
- Remove the synctools dependency + davx5-ose submodule + composite build, and
  revert core library desugaring to the base desugar_jdk_libs variant.

Note: local unit tests only cover compilation; the round-trip Ical4androidUtilTest
requires an emulator and should be run before merge.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011JEizQuqZkmoSJf6saEPDH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants