Skip to content

Commit c3cabf8

Browse files
committed
Merge branch 'main' into 315-run-instrumented-tests-on-different-api-levels
2 parents 01a80c0 + d59e9c6 commit c3cabf8

143 files changed

Lines changed: 5519 additions & 4235 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

gradle/libs.versions.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
[versions]
2-
agp = "9.1.0"
2+
agp = "9.2.0"
33
android-desugar = "2.1.5"
44
androidx-annotation = "1.10.0"
55
androidx-core = "1.18.0"
66
androidx-test-rules = "1.7.0"
77
androidx-test-runner = "1.7.0"
88
dokka = "2.2.0"
99
ezvcard = "0.12.2"
10-
guava = "33.5.0-android"
11-
# noinspection NewerVersionAvailable
12-
ical4j = "3.2.19" # final version; update to 4.x will require much work
10+
guava = "33.6.0-android"
11+
ical4j = "4.2.5"
1312
junit = "4.13.2"
14-
kotlin = "2.3.20"
13+
kotlin = "2.3.21"
1514
kotlinx-coroutines-test = "1.10.2"
1615
mockk = "1.14.9"
1716
roboelectric = "4.16.1"

gradle/wrapper/gradle-wrapper.jar

-504 Bytes
Binary file not shown.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.0-bin.zip
44
networkTimeout=10000
5+
retries=0
6+
retryBackOffMs=500
57
validateDistributionUrl=true
68
zipStoreBase=GRADLE_USER_HOME
79
zipStorePath=wrapper/dists

gradlew

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

100755100644
Lines changed: 10 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/build.gradle.kts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,9 @@ android {
3434

3535
buildFeatures.buildConfig = true
3636

37-
sourceSets["main"].apply {
38-
kotlin {
39-
directories += "${projectDir}/src/main/kotlin"
40-
}
41-
java {
42-
directories += "${rootDir}/opentasks-contract/src/main/java"
37+
sourceSets {
38+
getByName("main") {
39+
java.directories += "${rootDir}/opentasks-contract/src/main/java"
4340
}
4441
}
4542

@@ -150,4 +147,12 @@ dependencies {
150147
testImplementation(libs.kotlin.coroutines.test)
151148
testImplementation(libs.mockk)
152149
testImplementation(libs.roboelectric)
153-
}
150+
}
151+
152+
tasks.withType<Test>().configureEach {
153+
options {
154+
// Prevent Robolectric from instrumenting ical4j classes to avoid problems with registering
155+
// ical4j's ZoneRulesProviderImpl more than once with Java's ZoneRulesProvider.
156+
systemProperty("org.robolectric.packagesToNotAcquire", "net.fortuna.ical4j")
157+
}
158+
}

lib/consumer-rules.pro

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
-dontwarn org.codehaus.groovy.**
1111
-dontwarn org.jparsec.**
1212

13-
# keep to be used by ical4j
14-
-keep class at.bitfire.ical4android.AndroidCompatTimeZoneRegistry { *; }
15-
-keep class at.bitfire.ical4android.AndroidCompatTimeZoneRegistry$Factory { *; }
16-
1713
# keep all vCard properties/parameters (used via reflection)
1814
-keep class ezvcard.io.scribe.** { *; }
1915
-keep class ezvcard.property.** { *; }

lib/src/androidTest/kotlin/at/bitfire/ical4android/AndroidCompatTimeZoneRegistryTest.kt

Lines changed: 0 additions & 100 deletions
This file was deleted.

lib/src/androidTest/kotlin/at/bitfire/ical4android/DmfsStyleProvidersTaskTest.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
package at.bitfire.ical4android
88

9+
import android.os.Build
910
import androidx.test.platform.app.InstrumentationRegistry
1011
import at.bitfire.synctools.test.GrantPermissionOrSkipRule
1112
import org.junit.After
@@ -25,7 +26,13 @@ abstract class DmfsStyleProvidersTaskTest(
2526
companion object {
2627
@Parameterized.Parameters(name="{0}")
2728
@JvmStatic
28-
fun taskProviders() = listOf(TaskProvider.ProviderName.OpenTasks,TaskProvider.ProviderName.TasksOrg)
29+
fun taskProviders() = buildList {
30+
add(TaskProvider.ProviderName.OpenTasks)
31+
32+
// tasks.org requires Android 8
33+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
34+
add(TaskProvider.ProviderName.TasksOrg)
35+
}
2936
}
3037

3138
@get:Rule

lib/src/androidTest/kotlin/at/bitfire/ical4android/DmfsTaskTest.kt

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import androidx.core.content.contentValuesOf
1313
import at.bitfire.ical4android.impl.TestTaskList
1414
import at.bitfire.synctools.storage.LocalStorageException
1515
import at.bitfire.synctools.storage.tasks.DmfsTaskList
16-
import net.fortuna.ical4j.model.Date
1716
import net.fortuna.ical4j.model.TimeZoneRegistryFactory
1817
import net.fortuna.ical4j.model.component.VAlarm
1918
import net.fortuna.ical4j.model.parameter.RelType
@@ -31,6 +30,8 @@ import org.junit.Assert.assertFalse
3130
import org.junit.Assert.assertNotNull
3231
import org.junit.Before
3332
import org.junit.Test
33+
import java.time.LocalDate
34+
import java.time.ZonedDateTime
3435

3536
class DmfsTaskTest(
3637
providerName: TaskProvider.ProviderName
@@ -87,18 +88,27 @@ class DmfsTaskTest(
8788
task.summary = "Sample event"
8889
task.description = "Sample event with date/time"
8990
task.location = "Sample location"
90-
task.dtStart = DtStart("20150501T120000", tzVienna)
91-
task.due = Due("20150501T140000", tzVienna)
91+
task.dtStart = DtStart(ZonedDateTime.of(
92+
2015, 5, 1,
93+
12, 0, 0, 0,
94+
tzVienna.toZoneId()
95+
))
96+
task.due = Due(ZonedDateTime.of(
97+
2015, 5, 1,
98+
14, 0, 0, 0,
99+
tzVienna.toZoneId()
100+
))
92101
task.organizer = Organizer("mailto:organizer@example.com")
93102
assertFalse(task.isAllDay())
94103

95104
// extended properties
96105
task.categories.addAll(arrayOf("Cat1", "Cat2"))
97106
task.comment = "A comment"
98107

99-
val sibling = RelatedTo("most-fields2@example.com")
100-
sibling.parameters.add(RelType.SIBLING)
101-
task.relatedTo.add(sibling)
108+
task.relatedTo.add(
109+
RelatedTo("most-fields2@example.com")
110+
.add(RelType.SIBLING)
111+
)
102112

103113
task.unknownProperties += XProperty("X-UNKNOWN-PROP", "Unknown Value")
104114

@@ -133,9 +143,9 @@ class DmfsTaskTest(
133143
val task = Task()
134144
task.uid = "invalidDUE@ical4android.tests"
135145
task.summary = "Task with invalid DUE"
136-
task.dtStart = DtStart(Date("20150102"))
146+
task.dtStart = DtStart(LocalDate.of(2015, 1, 2))
137147

138-
task.due = Due(Date("20150101"))
148+
task.due = Due(LocalDate.of(2015, 1, 1))
139149
DmfsTask(taskList!!, task, "9468a4cf-0d5b-4379-a704-12f1f84100ba", null, 0).add()
140150
}
141151

@@ -144,7 +154,7 @@ class DmfsTaskTest(
144154
val task = Task()
145155
task.uid = "TaskWithManyAlarms"
146156
task.summary = "Task with many alarms"
147-
task.dtStart = DtStart(Date("20150102"))
157+
task.dtStart = DtStart(LocalDate.of(2015, 1, 2))
148158

149159
for (i in 1..1050)
150160
task.alarms += VAlarm(java.time.Duration.ofMinutes(i.toLong()))
@@ -162,7 +172,11 @@ class DmfsTaskTest(
162172
task.summary = "Sample event"
163173
task.description = "Sample event with date/time"
164174
task.location = "Sample location"
165-
task.dtStart = DtStart("20150501T120000", tzVienna)
175+
task.dtStart = DtStart(ZonedDateTime.of(
176+
2015, 5, 1,
177+
12, 0, 0, 0,
178+
tzVienna.toZoneId()
179+
))
166180
assertFalse(task.isAllDay())
167181
val uri = DmfsTask(taskList!!, task, "9468a4cf-0d5b-4379-a704-12f1f84100ba", null, 0).add()
168182
assertNotNull(uri)

0 commit comments

Comments
 (0)