Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

Commit a78e72f

Browse files
ArnyminerZrfc2822
andauthored
Make it a real library (#102)
* Moved files to module Signed-off-by: Arnau Mora Gras <[email protected]> * Configured modules Signed-off-by: Arnau Mora Gras <[email protected]> * Fixed paths Signed-off-by: Arnau Mora Gras <[email protected]> * Configured Jitpack Signed-off-by: Arnau Mora Gras <[email protected]> * Updated usage instructions Signed-off-by: Arnau Mora Gras <[email protected]> * Config for `maven-publish` Signed-off-by: Arnau Mora Gras <[email protected]> * typo Signed-off-by: Arnau Mora <[email protected]> * Deprecations Signed-off-by: Arnau Mora <[email protected]> * Using environment variable for version Signed-off-by: Arnau Mora <[email protected]> * Excluded `META-INF/INDEX.LIST` Signed-off-by: Arnau Mora <[email protected]> * Included `META-INF/INDEX.LIST` again Signed-off-by: Arnau Mora <[email protected]> * Excluded dateutils Signed-off-by: Arnau Mora <[email protected]> * Excluded all groovy trans. dependencies Signed-off-by: Arnau Mora <[email protected]> * Excluded groovy with configurations Signed-off-by: Arnau Mora <[email protected]> * Removed transitive dependencies Signed-off-by: Arnau Mora <[email protected]> * Minor changes, rename source directories from java to kotlin --------- Signed-off-by: Arnau Mora Gras <[email protected]> Signed-off-by: Arnau Mora <[email protected]> Co-authored-by: Ricki Hirner <[email protected]>
1 parent 75e5be4 commit a78e72f

File tree

124 files changed

+188
-121
lines changed

Some content is hidden

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

124 files changed

+188
-121
lines changed

.github/workflows/build-kdoc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ jobs:
2121
- uses: gradle/gradle-build-action@v2
2222

2323
- name: Build KDoc
24-
run: ./gradlew --no-daemon --no-configuration-cache dokkaHtml
24+
run: ./gradlew --no-daemon --no-configuration-cache ical4android:dokkaHtml
2525

2626
- uses: actions/upload-pages-artifact@v1
2727
with:
28-
path: build/dokka/html
28+
path: lib/build/dokka/html
2929

3030
deploy:
3131
environment:

README.md

Lines changed: 20 additions & 5 deletions

build.gradle

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

build.gradle.kts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/***************************************************************************************************
2+
* Copyright © All Contributors. See LICENSE and AUTHORS in the root directory for details.
3+
**************************************************************************************************/
4+
5+
plugins {
6+
id("com.android.library") version "8.0.1" apply false
7+
id("org.jetbrains.kotlin.android") version "1.8.21" apply false
8+
id("org.jetbrains.dokka") version "1.8.10" apply false
9+
}
10+
11+
group = "at.bitfire"
12+
version = System.getenv("GIT_COMMIT")

jitpack.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
jdk:
2+
- openjdk17
3+
before_install:
4+
- sdk install java 17.0.1-open
5+
- sdk use java 17.0.1-open

lib/build.gradle.kts

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
/***************************************************************************************************
2+
* Copyright © All Contributors. See LICENSE and AUTHORS in the root directory for details.
3+
**************************************************************************************************/
4+
5+
plugins {
6+
id("com.android.library")
7+
id("kotlin-android")
8+
id("maven-publish")
9+
id("org.jetbrains.dokka")
10+
}
11+
12+
val version_ical4j = "3.2.11"
13+
14+
android {
15+
compileSdk = 33
16+
17+
namespace = "at.bitfire.ical4android"
18+
19+
defaultConfig {
20+
minSdk = 21 // Android 5.0
21+
22+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
23+
24+
buildConfigField("String", "version_ical4j", "\"${version_ical4j}\"")
25+
26+
aarMetadata {
27+
minCompileSdk = 29
28+
}
29+
}
30+
31+
compileOptions {
32+
// ical4j >= 3.x uses the Java 8 Time API
33+
isCoreLibraryDesugaringEnabled = true
34+
35+
sourceCompatibility = JavaVersion.VERSION_17
36+
targetCompatibility = JavaVersion.VERSION_17
37+
}
38+
kotlin {
39+
jvmToolchain(17)
40+
}
41+
42+
buildFeatures.buildConfig = true
43+
44+
sourceSets["main"].apply {
45+
kotlin {
46+
srcDir("${projectDir}/src/main/kotlin")
47+
}
48+
java {
49+
srcDir("${rootDir}/opentasks-contract/src/main/java")
50+
}
51+
}
52+
53+
packaging {
54+
resources {
55+
excludes += listOf("META-INF/DEPENDENCIES", "META-INF/LICENSE", "META-INF/*.md")
56+
}
57+
}
58+
59+
lint {
60+
disable += listOf("AllowBackup", "InvalidPackage")
61+
}
62+
63+
publishing {
64+
// Configure publish variant
65+
singleVariant("release") {
66+
withSourcesJar()
67+
}
68+
}
69+
}
70+
71+
publishing {
72+
// Configure publishing data
73+
publications {
74+
register("release", MavenPublication::class.java) {
75+
groupId = "com.github.bitfireAT"
76+
artifactId = "ical4android"
77+
version = System.getenv("GIT_COMMIT")
78+
79+
afterEvaluate {
80+
from(components["release"])
81+
}
82+
}
83+
}
84+
}
85+
86+
configurations.forEach {
87+
// exclude modules which are in conflict with system libraries
88+
it.exclude("commons-logging")
89+
it.exclude("org.json", "json")
90+
91+
// exclude groovy because we don"t need it, and it needs API 26+
92+
it.exclude("org.codehaus.groovy", "groovy")
93+
it.exclude("org.codehaus.groovy", "groovy-dateutil")
94+
}
95+
96+
dependencies {
97+
implementation("org.jetbrains.kotlin:kotlin-stdlib")
98+
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.3")
99+
100+
implementation("androidx.core:core-ktx:1.10.1")
101+
api("org.mnode.ical4j:ical4j:${version_ical4j}")
102+
implementation("org.slf4j:slf4j-jdk14:2.0.3") // ical4j logging over java.util.Logger
103+
104+
// ical4j requires newer Apache Commons libraries, which require Java8. Force latest Java7 versions.
105+
// noinspection GradleDependency
106+
api("org.apache.commons:commons-collections4") {
107+
version {
108+
strictly("4.2")
109+
}
110+
}
111+
// noinspection GradleDependency
112+
api("org.apache.commons:commons-lang3:3.8.1") {
113+
version {
114+
strictly("3.8.1")
115+
}
116+
}
117+
// noinspection GradleDependency
118+
@Suppress("GradleDependency")
119+
implementation("commons-io:commons-io:2.6")
120+
121+
androidTestImplementation("androidx.test:core:1.5.0")
122+
androidTestImplementation("androidx.test:runner:1.5.2")
123+
androidTestImplementation("androidx.test:rules:1.5.0")
124+
androidTestImplementation("io.mockk:mockk-android:1.13.4")
125+
testImplementation("junit:junit:4.13.2")
126+
}

src/androidTest/java/at/bitfire/ical4android/AbstractTasksTest.kt renamed to lib/src/androidTest/kotlin/at/bitfire/ical4android/AbstractTasksTest.kt

File renamed without changes.

src/androidTest/java/at/bitfire/ical4android/AndroidCalendarTest.kt renamed to lib/src/androidTest/kotlin/at/bitfire/ical4android/AndroidCalendarTest.kt

File renamed without changes.

src/androidTest/java/at/bitfire/ical4android/AndroidCompatTimeZoneRegistryTest.kt renamed to lib/src/androidTest/kotlin/at/bitfire/ical4android/AndroidCompatTimeZoneRegistryTest.kt

File renamed without changes.

src/androidTest/java/at/bitfire/ical4android/AndroidEventTest.kt renamed to lib/src/androidTest/kotlin/at/bitfire/ical4android/AndroidEventTest.kt

File renamed without changes.

0 commit comments

Comments
 (0)