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

Commit 43bd12ec authored by Fahim Salam Chowdhury's avatar Fahim Salam Chowdhury 👽
Browse files

Merge branch 'upstream/master' into 1292-Update_with_upstream

parents 3a77f0c2 a78e72f5
Loading
Loading
Loading
Loading
+25 −15
Original line number Diff line number Diff line
name: Build KDoc
name: Build and publish KDoc
on:
  push:
    branches: [main]

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
  contents: read
  pages: write
  id-token: write

jobs:
  build:
    name: Build and publish KDoc
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: true
      - uses: actions/setup-java@v2
        with:
          distribution: 'temurin'
          java-version: 11
          cache: 'gradle'
      - uses: gradle/wrapper-validation-action@v1
          java-version: 17
      - uses: gradle/gradle-build-action@v2

      - name: Build KDoc
        run: ./gradlew dokkaHtml
      - name: Publish KDoc
        if: success()
        uses: crazy-max/ghaction-github-pages@v2.5.0
        run: ./gradlew --no-daemon --no-configuration-cache ical4android:dokkaHtml

      - uses: actions/upload-pages-artifact@v1
        with:
          target_branch: gh-pages
          build_dir: build/dokka/html
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          path: lib/build/dokka/html

  deploy:
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    runs-on: ubuntu-latest
    needs: build
    steps:
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v1
+10 −18
Original line number Diff line number Diff line
@@ -40,33 +40,25 @@ jobs:
    - name: Checkout repository
      uses: actions/checkout@v3

    - uses: actions/setup-java@v2
      with:
        distribution: 'temurin'
        java-version: 17
    - uses: gradle/gradle-build-action@v2

    # Initializes the CodeQL tools for scanning.
    - name: Initialize CodeQL
      uses: github/codeql-action/init@v2
      with:
        languages: ${{ matrix.language }}
        # If you wish to specify custom queries, you can do so here or in a config file.
        # By default, queries listed here will override any specified in a config file.
        # Prefix the list here with "+" to use these queries and those in the config file.

        # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
        # queries: security-extended,security-and-quality


    # Autobuild attempts to build any compiled languages  (C/C++, C#, Go, or Java).
    # If this step fails, then you should remove it and run the build manually (see below)
    - name: Autobuild
      uses: github/codeql-action/autobuild@v2

    # ℹ️ Command-line programs to run using the OS shell.
    # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

    #   If the Autobuild fails above, remove it and uncomment the following three lines.
    #   modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
    #- name: Autobuild
    #  uses: github/codeql-action/autobuild@v2

    # - run: |
    #   echo "Run, Build Application using script"
    #   ./location_of_script_within_repo/buildscript.sh
    - name: Build
      run: ./gradlew --no-daemon assemble

    - name: Perform CodeQL Analysis
      uses: github/codeql-action/analyze@v2
+53 −31
Original line number Diff line number Diff line
@@ -6,17 +6,14 @@ jobs:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: true
      - uses: actions/setup-java@v2
        with:
          distribution: 'temurin'
          java-version: 11
          cache: 'gradle'
      - uses: gradle/wrapper-validation-action@v1
          java-version: 17
      - uses: gradle/gradle-build-action@v2

      - name: Check
        run: ./gradlew check
        run: ./gradlew --no-daemon check
      - name: Archive results
        uses: actions/upload-artifact@v2
        with:
@@ -27,42 +24,67 @@ jobs:

  test_on_emulator:
    name: Tests with emulator
    runs-on: privileged
    container:
      image: ghcr.io/bitfireat/docker-android-ci:main
      options: --privileged
      env:
        ANDROID_HOME: /sdk
        ANDROID_AVD_HOME: /root/.android/avd
    runs-on: ubuntu-latest-4-cores
    strategy:
      matrix:
        api-level: [ 31 ]
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: true
      - uses: gradle/wrapper-validation-action@v1
      - uses: actions/setup-java@v2
        with:
          distribution: 'temurin'
          java-version: 17
      - uses: gradle/gradle-build-action@v2

      - name: Enable KVM group perms
        run: |
          echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
          sudo udevadm control --reload-rules
          sudo udevadm trigger --name-match=kvm

      - name: Cache APKs and gradle dependencies
        uses: actions/cache@v2
      - name: Cache AVD and APKs
        uses: actions/cache@v3
        id: avd-cache
        with:
          key: ${{ runner.os }}-1
          path: |
            ~/.android/avd/*
            ~/.android/adb*
            ~/.apk
            ~/.gradle/caches
            ~/.gradle/wrapper
          key: avd-${{ matrix.api-level }}

      - name: Start emulator
        run: start-emulator.sh
      - name: Install task apps
        run: |
      - name: Create AVD and generate snapshot for caching
        if: steps.avd-cache.outputs.cache-hit != 'true'
        uses: reactivecircus/android-emulator-runner@v2
        with:
          api-level: ${{ matrix.api-level }}
          arch: x86_64
          force-avd-creation: false
          emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
          disable-animations: false
          script: echo "Generated AVD snapshot for caching."

      - name: Install task apps and run tests
        uses: reactivecircus/android-emulator-runner@v2
        with:
          api-level: ${{ matrix.api-level }}
          arch: x86_64
          force-avd-creation: false
          emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
          disable-animations: true
          script: |
            mkdir .apk && cd .apk
            wget -cq -O org.dmfs.tasks.apk https://f-droid.org/archive/org.dmfs.tasks_80800.apk && adb install org.dmfs.tasks.apk
            wget -cq -O org.tasks.apk https://f-droid.org/archive/org.tasks_120400.apk && adb install org.tasks.apk
            wget -cq -O at.techbee.jtx.apk https://f-droid.org/archive/at.techbee.jtx_100140002.apk && adb install at.techbee.jtx.apk
            cd ..
      - name: Run connected tests
        run: ./gradlew connectedCheck -Pandroid.testInstrumentationRunnerArguments.notAnnotation=androidx.test.filters.FlakyTest
            ./gradlew --no-daemon connectedCheck -Pandroid.testInstrumentationRunnerArguments.notAnnotation=androidx.test.filters.FlakyTest

      - name: Archive results
        if: always()
        uses: actions/upload-artifact@v2
        with:
          name: test-results
          path: |
            build/reports
            app/build/reports
+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 −102
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.7.20',
        dokka: '1.7.20',
        ical4j: '3.2.5',
        // 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:7.3.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'

    defaultConfig {
        minSdkVersion 21        // Android 5.0
        targetSdkVersion 32     // Android 12

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

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

    namespace 'at.bitfire.ical4android'

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

        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = "1.8"
    }
    packagingOptions {
        resources {
            excludes += ['META-INF/DEPENDENCIES', 'META-INF/LICENSE', 'META-INF/*.md']
        }
    }
    lint {
        disable 'AllowBackup', 'InvalidPackage'
    }

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

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${versions.kotlin}"
    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.6'    // 2.0.0 produces "Unsupported desugared library configuration version, please upgrade the D8/R8 compiler."

    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:4.2") { force = true }
    // noinspection GradleDependency
    api("org.apache.commons:commons-lang3:3.8.1") { force = true }

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

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

    androidTestImplementation 'androidx.test:core:1.4.0'
    androidTestImplementation 'androidx.test:runner:1.4.0'
    androidTestImplementation 'androidx.test:rules:1.4.0'
    testImplementation 'junit:junit:4.13.2'
}
 No newline at end of file
Loading