Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(java): upgrade to gradle 8.2.2 #87

Merged
merged 1 commit into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/create-documentation-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

steps:
- name: Check out current repository code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Create the documentation pull request
uses: apivideo/api.video-create-readme-file-pull-request-action@main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-release-from-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
update-documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Create draft release if needed
uses: apivideo/api.video-release-from-changelog-action@main
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'
- name: Make gradlew executable
run: chmod +x ./gradlew
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog
All changes to this project will be documented in this file.

## [1.3.4] - 2024-01-08
- Upgrade dependencies, gradle and Kotlin

## [1.3.3] - 2023-12-14
- Add support for API level >= 34 for WorkManager

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Add this dependency to your project's POM:
<dependency>
<groupId>video.api</groupId>
<artifactId>android-video-uploader</artifactId>
<version>1.3.3</version>
<version>1.3.4</version>
<scope>compile</scope>
</dependency>
```
Expand All @@ -72,7 +72,7 @@ Add this dependency to your project's POM:
Add this dependency to your project's build file:

```groovy
implementation "video.api:android-video-uploader:1.3.3"
implementation "video.api:android-video-uploader:1.3.4"
```

#### Others
Expand All @@ -85,7 +85,7 @@ mvn clean package

Then manually install the following JARs:

* `target/android-video-uploader-1.3.3.jar`
* `target/android-video-uploader-1.3.4.jar`
* `target/lib/*.jar`

### Code sample
Expand Down
53 changes: 31 additions & 22 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apply plugin: 'maven-publish'
apply plugin: 'kotlin-android'

group = 'video.api'
version = '1.3.3'
version = '1.3.4'

buildscript {
repositories {
Expand All @@ -14,8 +14,8 @@ buildscript {
}
dependencies {
classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.17.1'
classpath 'com.android.tools.build:gradle:7.4.1'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.21'
classpath 'com.android.tools.build:gradle:8.2.2'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.22'
classpath 'de.mannodermaus.gradle.plugins:android-junit5:1.8.2.1'
}
}
Expand All @@ -33,13 +33,16 @@ if(hasProperty('target') && target == 'android') {
apply from: 'maven-push.gradle'

android {
compileSdkVersion 33
buildToolsVersion '30.0.3'
compileSdk 34

defaultConfig {
minSdkVersion 21
targetSdkVersion 33
minSdk 21
targetSdk 34

multiDexEnabled true

consumerProguardFiles 'consumer-rules.pro'

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArgument("runnerBuilder", "de.mannodermaus.junit5.AndroidJUnit5Builder")
testInstrumentationRunnerArgument("environmentVariables", "INTEGRATION_TESTS_API_KEY=${System.getenv("INTEGRATION_TESTS_API_KEY")}")
Expand All @@ -49,6 +52,12 @@ if(hasProperty('target') && target == 'android') {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

namespace "video.api.uploader.api"
}

} else {
Expand Down Expand Up @@ -83,30 +92,30 @@ if(hasProperty('target') && target == 'android') {
dependencies {
implementation 'io.swagger:swagger-annotations:1.5.24'
implementation "com.google.code.findbugs:jsr305:3.0.2"
api 'com.squareup.okhttp3:okhttp:4.10.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0'
implementation 'com.google.code.gson:gson:2.8.9'
implementation 'io.gsonfire:gson-fire:1.8.4'
implementation 'org.openapitools:jackson-databind-nullable:0.2.1'
api 'com.squareup.okhttp3:okhttp:4.12.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0'
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'io.gsonfire:gson-fire:1.9.0'
implementation 'org.openapitools:jackson-databind-nullable:0.2.6'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.10'
implementation 'org.threeten:threetenbp:1.5.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21"
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.work:work-runtime-ktx:2.8.0'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.8.0'
implementation 'org.threeten:threetenbp:1.6.8'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.22"
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.work:work-runtime-ktx:2.9.0'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:3.12.4'
testImplementation 'org.mockito:mockito-core:5.7.0'
testImplementation 'org.assertj:assertj-core:3.19.0'
testImplementation "com.google.truth:truth:1.1.3"
androidTestImplementation "com.google.truth:truth:1.1.3"
testImplementation "com.google.truth:truth:1.4.0"
androidTestImplementation "com.google.truth:truth:1.4.0"
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

androidTestImplementation 'androidx.test:rules:1.5.0'
androidTestImplementation 'androidx.test:core:1.5.0'
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
androidTestImplementation 'de.mannodermaus.junit5:android-test-core:1.3.0'
androidTestRuntimeOnly 'de.mannodermaus.junit5:android-test-runner:1.3.0'
androidTestImplementation 'de.mannodermaus.junit5:android-test-core:1.10.0'
androidTestRuntimeOnly 'de.mannodermaus.junit5:android-test-runner:1.10.0'
}

// Use spotless plugin to automatically format code, remove unused import, etc
Expand Down
28 changes: 28 additions & 0 deletions consumer-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

# Workaround for internal missing proguard rules
-dontwarn aQute.bnd.annotation.spi.ServiceProvider
-dontwarn jakarta.validation.valueextraction.UnwrapByDefault
-dontwarn jakarta.validation.valueextraction.ValueExtractor
-dontwarn javax.validation.valueextraction.UnwrapByDefault
-dontwarn javax.validation.valueextraction.ValueExtractor
8 changes: 7 additions & 1 deletion examples/service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,34 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

packagingOptions {
resources {
excludes += ['META-INF/DEPENDENCIES']
}
}

buildFeatures {
viewBinding true
}

namespace "video.api.uploader.service.example"
}

dependencies {

implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.preference:preference-ktx:1.2.0'
implementation 'androidx.preference:preference-ktx:1.2.1'

implementation project(path: ':')

Expand Down
3 changes: 1 addition & 2 deletions examples/service/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="video.api.uploader.service.example">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

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

Expand Down
10 changes: 8 additions & 2 deletions examples/workmanager/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,37 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

packagingOptions {
resources {
excludes += ['META-INF/DEPENDENCIES']
}
}

buildFeatures {
viewBinding true
}

namespace "video.api.uploader.work.example"
}

dependencies {

implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.preference:preference-ktx:1.2.0'
implementation 'androidx.preference:preference-ktx:1.2.1'

implementation project(path: ':')
implementation 'androidx.work:work-runtime-ktx:2.8.0'
implementation 'androidx.work:work-runtime-ktx:2.9.0'

testImplementation 'junit:junit:4.13.2'
}
3 changes: 1 addition & 2 deletions examples/workmanager/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="video.api.uploader.work.example">
xmlns:tools="http://schemas.android.com/tools">

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

Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
target = android
android.useAndroidX=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
16 changes: 13 additions & 3 deletions maven-push.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ apply plugin: 'maven-publish'
apply plugin: 'signing'

def isReleaseBuild() {
return !"1.3.3".contains("SNAPSHOT")
return !"1.3.4".contains("SNAPSHOT")
}

def getReleaseRepositoryUrl() {
Expand All @@ -39,15 +39,25 @@ def getRepositoryPassword() {
return hasProperty('OSSRH_PASSWORD') ? OSSRH_PASSWORD : System.getenv("OSSRH_PASSWORD")
}

afterEvaluate { project ->
android {
publishing {
multipleVariants {
withSourcesJar()
withJavadocJar()
allVariants()
}
}
}

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

groupId = "video.api"
artifactId = "android-video-uploader"
version = "1.3.3"
version = "1.3.4"

pom {
name = "video.api:android-video-uploader"
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<artifactId>android-video-uploader</artifactId>
<packaging>jar</packaging>
<name>${project.groupId}:${project.artifactId}</name>
<version>1.3.3</version>
<version>1.3.4</version>
<url>https://github.com/apivideo/api.video-android-uploader</url>
<description>The official Android api.video uploader</description>
<scm>
Expand Down
2 changes: 1 addition & 1 deletion src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<manifest package="video.api.uploader.api" xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

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

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/video/api/uploader/api/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private OkHttpClient initHttpClient(List<Interceptor> interceptors) {
private void init() {
verifyingSsl = true;
json = new JSON();
addDefaultHeader("AV-Origin-Client", "android-uploader:1.3.3");
addDefaultHeader("AV-Origin-Client", "android-uploader:1.3.4");
}

private boolean isValid(String regex, String field) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<resources>
<string name="upload_notification_channel_name">Video uploader</string>
<string name="upload_notification_progress_title">Uploading</string>
<string name="upload_notification_progress_text">Uploaded %1d of %1d</string>
<string name="upload_notification_progress_text">Uploaded %1d of %2d</string>
<string name="upload_notification_current_progress_text">%1d %%</string>
<string name="upload_notification_error_title">Upload error</string>
<string name="upload_notification_upload_started_title">Upload starting…</string>
Expand Down
Loading