Skip to content

Commit

Permalink
Merge pull request #432 from matomo-org/Java17
Browse files Browse the repository at this point in the history
Build with java 17
  • Loading branch information
hannesa2 authored Sep 24, 2023
2 parents 4562b1b + 44570e5 commit 2d06aaa
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 45 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/pull-request-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 11
java-version: 17
- uses: gradle/wrapper-validation-action@v1
- name: Build project
run: ./gradlew assembleDebug
- name: Run tests
run: ./gradlew test
- name: Jacoco
run: ./gradlew :tracker:jacocoTestReport
- name: Codecov
run: bash <(curl -s https://codecov.io/bash)
# - name: Jacoco
# run: ./gradlew :tracker:jacocoTestReport
# - name: Codecov
# run: bash <(curl -s https://codecov.io/bash)
Check:
name: Check
runs-on: ubuntu-latest
Expand All @@ -43,7 +43,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 11
java-version: 17
- name: Code checks
run: ./gradlew check
- name: Archive Lint report
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 11
java-version: 17
- name: Build project
run: ./gradlew assembleRelease
env:
Expand Down
1 change: 0 additions & 1 deletion _config.yml

This file was deleted.

4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
buildscript {
ext.kotlin_version = '1.9.0'
repositories {
google()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.dicedmelon.gradle:jacoco-android:0.1.5'
// classpath 'com.dicedmelon.gradle:jacoco-android:0.1.5'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

Expand Down
9 changes: 9 additions & 0 deletions exampleapp/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

android {
defaultConfig {
Expand All @@ -13,6 +14,13 @@ android {
release {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
}
namespace 'org.matomo.demo'
}

Expand All @@ -21,4 +29,5 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation "com.jakewharton.timber:timber:${timberVersion}"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
}
2 changes: 1 addition & 1 deletion jitpack.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
jdk:
- openjdk11
- openjdk17
58 changes: 23 additions & 35 deletions tracker/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
apply plugin: 'kotlin-android'

android {
defaultConfig {
Expand All @@ -14,14 +15,21 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
}
testOptions.unitTests.includeAndroidResources = true
namespace 'org.matomo.sdk'
}

dependencies {
implementation 'androidx.annotation:annotation:1.7.0'
implementation "com.jakewharton.timber:timber:${timberVersion}"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"

testImplementation 'org.awaitility:awaitility:4.2.0'
testImplementation 'androidx.test:core:1.5.0'
Expand All @@ -39,19 +47,16 @@ dependencies {
testImplementation 'org.robolectric:robolectric:4.9.2'
}

/**
* Coverage
*/
apply plugin: 'com.dicedmelon.gradle.jacoco-android'

jacoco {
toolVersion = '0.8.5'
}

tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
jacoco.excludes = ['jdk.internal.*']
}
//apply plugin: 'com.dicedmelon.gradle.jacoco-android'
//
//jacoco {
// toolVersion = '0.8.5'
//}
//
//tasks.withType(Test) {
// jacoco.includeNoLocationClasses = true
// jacoco.excludes = ['jdk.internal.*']
//}

/**
* Javadoc
Expand All @@ -76,28 +81,11 @@ android.libraryVariants.all { variant ->
}
}

afterEvaluate {
publishing {
publications {
release(MavenPublication) {
publishing {
publications {
release(MavenPublication) {
afterEvaluate {
from components.release

groupId = 'org.matomo.sdk'
artifactId = 'tracker'
version = getTag()

pom {
name = 'Matomo SDK for Android'
description = 'SDK for Android to measure your apps with Matomo'
url = 'https://github.com/matomo-org/matomo-sdk-android'

licenses {
license {
name = 'BSD-3 Clause'
url = 'https://github.com/matomo-org/matomo-sdk-android/blob/master/LICENSE'
}
}
}
}
}
}
Expand Down

0 comments on commit 2d06aaa

Please sign in to comment.