New :caldav module — MIT, plain JVM, api-depends on :dav. Separate from the vendored MPL tree so the licences stay unmixed, and so "no Android types" is a compile-time guarantee rather than a discipline. Chunk 2 split again: the Android account layer (Keystore, AccountManager, Custom Tabs, account-add UI) is 2c, with different verification and an on-device review. - ServiceDiscovery: the RFC 6764 ladder. SRV priority/weight, TXT path=, non-443 ports, "." targets, well-known then root. - CollectionClassifier: the two filters that are inversions of the obvious rule. An absent or empty supported-calendar-component-set means "supports everything", and classification is a positive test for CALDAV:calendar on an unordered set — excluding schedule-outbox would drop SOGo's main calendar. - CalDavDiscovery: OPTIONS gate, principal, every home set, Depth-1 by name. A failing home set does not fail the account, and every home set failing is reported as an error rather than as an account with no lists. - NextcloudLoginFlow: POST not GET, a User-Agent the user can recognise when revoking, 404-means-pending only, both URLs origin-checked, host mismatch carried rather than refused (reverse proxies are ordinary). - PreemptiveBasicInterceptor, ServerQuirks. dnsjava 3.6.3 (BSD-3) added: Android's DnsResolver is callback-only and cannot do the TXT path lookup, and JNDI's DNS provider does not exist on Android. Behind an interface, so every trap is tested with a fake and no network. :dav gains change 6 — <D:unauthenticated/> is parsed rather than inferred from a null href, which also fires on a merely non-conformant empty element. 52 tests here, 78 in :dav. SYNC.md's live-probed trap table is executable now.
37 lines
1.2 KiB
Kotlin
37 lines
1.2 KiB
Kotlin
plugins {
|
|
// No version — AGP already puts the Kotlin plugin on the build classpath.
|
|
id("org.jetbrains.kotlin.jvm")
|
|
}
|
|
|
|
// Our CalDAV protocol layer: discovery, auth, Nextcloud Login Flow v2. MIT, and
|
|
// deliberately a separate module from the MPL-2.0 vendored `:dav`.
|
|
//
|
|
// A plain JVM module, like `:dav`, and for the same two reasons: it enforces "no
|
|
// Android types" at compile time rather than by discipline, and it lets the whole
|
|
// protocol layer be tested against MockWebServer on the JVM. Anything that needs
|
|
// the platform — Keystore, AccountManager, Custom Tabs — belongs in `:app`.
|
|
java {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
|
|
kotlin {
|
|
compilerOptions {
|
|
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
api(project(":dav"))
|
|
implementation(libs.dnsjava)
|
|
// Runtime API only (Json.parseToJsonElement) — no @Serializable, so the
|
|
// serialization compiler plugin is not needed here.
|
|
implementation(libs.kotlinx.serialization.json)
|
|
|
|
compileOnly(libs.xpp3)
|
|
testImplementation(libs.xpp3)
|
|
testImplementation(libs.junit4)
|
|
testImplementation(libs.okhttp.mockwebserver)
|
|
testImplementation(libs.truth)
|
|
}
|