Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit a78e72f5 authored by Arnau Mora's avatar Arnau Mora Committed by GitHub
Browse files

Make it a real library (#102)



* Moved files to module

Signed-off-by: default avatarArnau Mora Gras <arnyminerz@proton.me>

* Configured modules

Signed-off-by: default avatarArnau Mora Gras <arnyminerz@proton.me>

* Fixed paths

Signed-off-by: default avatarArnau Mora Gras <arnyminerz@proton.me>

* Configured Jitpack

Signed-off-by: default avatarArnau Mora Gras <arnyminerz@proton.me>

* Updated usage instructions

Signed-off-by: default avatarArnau Mora Gras <arnyminerz@proton.me>

* Config for `maven-publish`

Signed-off-by: default avatarArnau Mora Gras <arnyminerz@proton.me>

* typo

Signed-off-by: default avatarArnau Mora <arnyminerz@proton.me>

* Deprecations

Signed-off-by: default avatarArnau Mora <arnyminerz@proton.me>

* Using environment variable for version

Signed-off-by: default avatarArnau Mora <arnyminerz@proton.me>

* Excluded `META-INF/INDEX.LIST`

Signed-off-by: default avatarArnau Mora <arnyminerz@proton.me>

* Included `META-INF/INDEX.LIST` again

Signed-off-by: default avatarArnau Mora <arnyminerz@proton.me>

* Excluded dateutils

Signed-off-by: default avatarArnau Mora <arnyminerz@proton.me>

* Excluded all groovy trans. dependencies

Signed-off-by: default avatarArnau Mora <arnyminerz@proton.me>

* Excluded groovy with configurations

Signed-off-by: default avatarArnau Mora <arnyminerz@proton.me>

* Removed transitive dependencies

Signed-off-by: default avatarArnau Mora <arnyminerz@proton.me>

* Minor changes, rename source directories from java to kotlin

---------

Signed-off-by: default avatarArnau Mora Gras <arnyminerz@proton.me>
Signed-off-by: default avatarArnau Mora <arnyminerz@proton.me>
Co-authored-by: default avatarRicki Hirner <hirner@bitfire.at>
parent 75e5be4f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -21,11 +21,11 @@ jobs:
      - uses: gradle/gradle-build-action@v2

      - name: Build KDoc
        run: ./gradlew --no-daemon --no-configuration-cache dokkaHtml
        run: ./gradlew --no-daemon --no-configuration-cache ical4android:dokkaHtml

      - uses: actions/upload-pages-artifact@v1
        with:
          path: build/dokka/html
          path: lib/build/dokka/html

  deploy:
    environment:
+20 −5
Original line number Diff line number Diff line

[![Development tests](https://github.com/bitfireAT/ical4android/actions/workflows/test-dev.yml/badge.svg)](https://github.com/bitfireAT/ical4android/actions/workflows/test-dev.yml)
[![Documentation](https://img.shields.io/badge/documentation-kdoc-brightgreen)](https://bitfireat.github.io/ical4android/)
[![Latest Version](https://img.shields.io/jitpack/version/com.github.bitfireAT/ical4android)](https://jitpack.io/#bitfireAT/ical4android)


# ical4android
@@ -32,17 +33,31 @@ by Google LLC. Android is a trademark of Google LLC._

## How to use

You can use ical4android as a git submodule or using [jitpack.io](https://jitpack.io/#bitfireAT/ical4android):

1. Add the [jitpack.io](https://jitpack.io) repository to your project's level `build.gradle`:
    ```groovy
    allprojects {
        repositories {
            maven { url 'https://jitpack.io' }
            // ... more repos
            maven { url "https://jitpack.io" }
        }
    }
    ```
   or if you are using `settings.gradle`:
    ```groovy
    dependencyResolutionManagement {
        repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
        repositories {
            // ... more repos
            maven { url "https://jitpack.io" }
        }
    }
    ```
2. Add the dependency to your module's `build.gradle` file:
    ```groovy
    dependencies {
        implementation 'com.github.bitfireAT:ical4android:<version>'        // see tags for latest version, like 1.0, or use the latest commit ID from main branch
        //implementation 'com.github.bitfireAT:ical4android:main-SNAPSHOT'  // use it only for testing because it doesn't generate reproducible builds
       implementation 'com.github.bitfireAT:ical4android:<version>'
    }
    ```


## Contact

build.gradle

deleted100644 → 0
+0 −114
Original line number Diff line number Diff line
/***************************************************************************************************
 * Copyright © All Contributors. See LICENSE and AUTHORS in the root directory for details.
 **************************************************************************************************/

buildscript {
    ext.versions = [
        kotlin: '1.8.20',
        dokka: '1.8.10',
        ical4j: '3.2.11',
        // latest Apache Commons versions that don't require Java 8 (Android 7)
        commonsIO: '2.6'
    ]

    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:8.0.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
        classpath "org.jetbrains.dokka:dokka-gradle-plugin:${versions.dokka}"
    }
}

repositories {
    google()
    mavenCentral()
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'org.jetbrains.dokka'

android {
    compileSdkVersion 33
    buildToolsVersion '33.0.0'

    namespace 'at.bitfire.ical4android'

    defaultConfig {
        minSdkVersion 21        // Android 5.0
        targetSdkVersion 33     // Android 13

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

        buildConfigField "String", "version_ical4j", "\"${versions.ical4j}\""
    }

    compileOptions {
        // ical4j >= 3.x uses the Java 8 Time API
        coreLibraryDesugaringEnabled true

        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }

    buildFeatures {
        buildConfig = true
    }

    sourceSets {
        main.java.srcDirs = [ "src/main/java", "opentasks-contract/src/main/java" ]
    }

    packagingOptions {
        resources {
            excludes += ['META-INF/DEPENDENCIES', 'META-INF/LICENSE', 'META-INF/*.md']
        }
    }

    lint {
        disable 'AllowBackup', 'InvalidPackage'
    }
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib:${versions.kotlin}"
    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.3'

    api("org.mnode.ical4j:ical4j:${versions.ical4j}") {
        // exclude modules which are in conflict with system libraries
        exclude group: 'commons-logging'
        exclude group: 'org.json', module: 'json'
        // exclude groovy because we don't need it
        exclude group: 'org.codehaus.groovy', module: 'groovy'
        exclude group: 'org.codehaus.groovy', module: 'groovy-dateutil'
    }
    // ical4j requires newer Apache Commons libraries, which require Java8. Force latest Java7 versions.
    // noinspection GradleDependency
    api("org.apache.commons:commons-collections4") {
        version {
            strictly '4.2'
        }
    }
    // noinspection GradleDependency
    api("org.apache.commons:commons-lang3:3.8.1") {
        version {
            strictly '3.8.1'
        }
    }

    // noinspection GradleDependency
    implementation "commons-io:commons-io:${versions.commonsIO}"

    implementation 'org.slf4j:slf4j-jdk14:2.0.3'
    implementation 'androidx.core:core-ktx:1.10.0'

    androidTestImplementation 'androidx.test:core:1.5.0'
    androidTestImplementation 'androidx.test:runner:1.5.2'
    androidTestImplementation 'androidx.test:rules:1.5.0'
    androidTestImplementation 'io.mockk:mockk-android:1.13.4'
    testImplementation 'junit:junit:4.13.2'
}
 No newline at end of file

build.gradle.kts

0 → 100644
+12 −0
Original line number Diff line number Diff line
/***************************************************************************************************
 * Copyright © All Contributors. See LICENSE and AUTHORS in the root directory for details.
 **************************************************************************************************/

plugins {
    id("com.android.library") version "8.0.1" apply false
    id("org.jetbrains.kotlin.android") version "1.8.21" apply false
    id("org.jetbrains.dokka") version "1.8.10" apply false
}

group = "at.bitfire"
version = System.getenv("GIT_COMMIT")

jitpack.yml

0 → 100644
+5 −0
Original line number Diff line number Diff line
jdk:
  - openjdk17
before_install:
  - sdk install java 17.0.1-open
  - sdk use java 17.0.1-open
 No newline at end of file
Loading