Skip to content

Commit

Permalink
Merge pull request #104 from tus/upgrade-gradle
Browse files Browse the repository at this point in the history
Upgrade to Gradle 8.6
  • Loading branch information
cdr-chakotay authored Apr 8, 2024
2 parents f4311bc + d8fac86 commit 8a31da1
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
android:
strategy:
matrix:
java: [ '11','19' ]
java: [ '17','21' ]

runs-on: ubuntu-latest

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.3.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
1 change: 1 addition & 0 deletions example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ android {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
namespace 'io.tus.android.example'
}

dependencies {
Expand Down
3 changes: 1 addition & 2 deletions example/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.tus.android.example">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET" />

Expand Down
6 changes: 6 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
android.useAndroidX=true

# Build settings (needed for upgrades of the Android Gradle plugin)
android.defaults.buildfeatures.buildconfig=false
android.enableR8.fullMode=true
android.nonTransitiveRClass=true
android.nonFinalResIds=true
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
50 changes: 33 additions & 17 deletions tus-android-client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ plugins {
}

android {
compileSdkVersion 33
buildToolsVersion '30.0.3'
compileSdk 33
setBuildToolsVersion("30.0.3")

defaultConfig {
minSdkVersion 14
targetSdkVersion 33
targetSdk 33
}
buildTypes {
release {
Expand All @@ -21,6 +21,7 @@ android {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
namespace 'io.tus.android.client'
}

def config = new ConfigSlurper().parse(new File("${projectDir}/src/main/res/tus-android-client-version/version.properties").toURI().toURL())
Expand All @@ -34,22 +35,29 @@ dependencies {
testImplementation 'junit:junit:4.13.2'
}

task sourcesJar(type: Jar) {
archiveClassifier.set('sources')
from android.sourceSets.main.java.srcDirs
}
afterEvaluate {
tasks.register('sourcesJar', Jar) {
archiveClassifier.set('sources')
from android.sourceSets.main.java.srcDirs
}

task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
android.libraryVariants.all { variant ->
owner.classpath += variant.javaCompileProvider.get().classpath
tasks.register('javadoc', Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
android.libraryVariants.all { variant ->
owner.classpath += variant.javaCompileProvider.get().classpath
}
}

tasks.register('javadocJar', Jar) {
dependsOn javadoc
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}
}

task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier.set('javadoc')
from javadoc.destinationDir
artifacts {
archives sourcesJar, javadocJar
}
}

def pomConfig = {
Expand All @@ -62,6 +70,11 @@ def pomConfig = {
name 'Marius Kleidl'
email '[email protected]'
}
developer {
id 'cdr-chakotay'
name 'Florian Kuenzig'
email '[email protected]'
}
}

inceptionYear '2015'
Expand All @@ -83,14 +96,17 @@ publishing {
publications {
androidRelease(MavenPublication) {
afterEvaluate {
from components.release
from components.findByName('release')
groupId 'io.tus.android.client'
artifactId 'tus-android-client'
description project.getDescription()
version project.getVersion()

artifact sourcesJar
artifact javadocJar
artifact (project.layout.buildDirectory.dir('outputs/aar/tus-android-client-release.aar')) {
builtBy assemble
}

pom.withXml {
def root = asNode()
Expand Down
3 changes: 1 addition & 2 deletions tus-android-client/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.tus.android.client">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>

0 comments on commit 8a31da1

Please sign in to comment.