Skip to content

Commit

Permalink
Gradle: Use Java 11 & Android Gradle Plugin 8.0.2 (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
vanniktech authored Jul 2, 2023
1 parent 24f6eab commit ddd14f8
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
java_version: [11]
java_version: [17]

steps:
- name: Checkout
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Install JDK 11
- name: Install JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
java-version: 17

- name: Setup gradle
uses: gradle/gradle-build-action@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Install JDK 11
- name: Install JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
java-version: 17

- name: Setup gradle
uses: gradle/gradle-build-action@v2
Expand Down
5 changes: 2 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.0.2'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.22'
classpath 'org.jetbrains.dokka:dokka-gradle-plugin:1.8.20'
classpath 'com.vanniktech:gradle-code-quality-tools-plugin:0.22.0'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.25.3'
classpath 'app.cash.licensee:licensee-gradle-plugin:1.7.0'
Expand Down Expand Up @@ -78,8 +79,6 @@ codeQualityTools {
}

subprojects {
task allDependencies(type: DependencyReportTask) {}

repositories {
mavenCentral()
google()
Expand Down
4 changes: 0 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,9 @@ POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=vanniktech
POM_DEVELOPER_NAME=Niklas Baudy

android.suppressUnsupportedOptionWarnings=android.suppressUnsupportedOptionWarnings,android.enableR8
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=false

android.defaults.buildfeatures.buildconfig=false
android.defaults.buildfeatures.aidl=false
android.defaults.buildfeatures.renderscript=false
android.defaults.buildfeatures.resvalues=false
android.defaults.buildfeatures.shaders=false
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
16 changes: 10 additions & 6 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ done
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

Expand Down Expand Up @@ -133,26 +130,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -197,6 +197,10 @@ if "$cygwin" || "$msys" ; then
done
fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand Down
18 changes: 12 additions & 6 deletions rxpermission-testing/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
plugins {
id("app.cash.licensee")
id("com.android.library")
id("com.vanniktech.maven.publish")
id("org.jetbrains.dokka")
id("org.jetbrains.kotlin.android")
}

apply plugin: 'com.android.library'

licensee {
allow("Apache-2.0")
allow("CC0-1.0")
}

kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}

android {
namespace = "com.vanniktech.rxpermission.testing"

Expand All @@ -21,8 +29,8 @@ android {
resourcePrefix 'rx_permission_testing_'

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
}

Expand All @@ -34,5 +42,3 @@ dependencies {
testImplementation deps.test.junit
testImplementation deps.test.assertj3
}

apply plugin: "com.vanniktech.maven.publish"
14 changes: 10 additions & 4 deletions rxpermission/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
plugins {
id("app.cash.licensee")
id("com.android.library")
id("com.vanniktech.maven.publish")
id("org.jetbrains.dokka")
id("org.jetbrains.kotlin.android")
}

Expand All @@ -9,6 +11,12 @@ licensee {
allow("CC0-1.0")
}

kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}

android {
namespace "com.vanniktech.rxpermission"

Expand All @@ -31,8 +39,8 @@ android {
resourcePrefix 'rx_permission_'

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
}

Expand All @@ -53,5 +61,3 @@ dependencies {
androidTestImplementation deps.support.test.rules
androidTestImplementation deps.support.test.uiautomator
}

apply plugin: "com.vanniktech.maven.publish"
4 changes: 1 addition & 3 deletions rxpermission/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.vanniktech.rxpermission">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application>
<activity
android:name=".ShadowActivity"
Expand Down
15 changes: 12 additions & 3 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
apply plugin: 'com.android.application'
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
}

kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}

android {
namespace "com.vanniktech.rxpermission.sample"
Expand All @@ -15,8 +24,8 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

buildTypes {
Expand Down
1 change: 1 addition & 0 deletions sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.CAMERA"/>
<uses-feature android:name="android.hardware.camera" android:required="false"/>

<application
android:allowBackup="true"
Expand Down

0 comments on commit ddd14f8

Please sign in to comment.