Skip to content

Commit

Permalink
Upgrade gradle, gradle dependencies and project dependencies
Browse files Browse the repository at this point in the history
* Gradle v8.1.1
* OkHttp v4.11.0
* Guava v32.0.0
* Jackson v2.15.2
* Apache Commons Compress v1.23.0

Fixes minio#1453

Signed-off-by: Bala.FA <[email protected]>
  • Loading branch information
balamurugana committed Jun 2, 2023
1 parent 5c8d783 commit 596ab3d
Show file tree
Hide file tree
Showing 10 changed files with 211 additions and 152 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
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.
Expand All @@ -54,7 +54,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, 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@v1
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -68,4 +68,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
6 changes: 3 additions & 3 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
echo "Error: use java.util.Objects instead of com.google.common.base.Objects"
exit 1
fi
- name: Setup java
- name: Setup java ${{ matrix.java-version }}
uses: actions/setup-java@v3
with:
distribution: temurin
Expand All @@ -35,7 +35,7 @@ jobs:
run: |
echo "DEV_VERSION=$(./gradlew properties | awk '/^version:/ { print $2 }')" >> $GITHUB_ENV
echo "RELEASE_VERSION=$(./gradlew properties -Prelease | awk '/^version:/ { print $2 }')" >> $GITHUB_ENV
- name: Gradle build on java ${{ matrix.java-version }}
- name: Gradle build on Ununtu
if: matrix.os == 'ubuntu-latest'
run: |
./gradlew build
Expand All @@ -46,7 +46,7 @@ jobs:
./gradlew build -Prelease
javac -cp api/build/libs/minio-${RELEASE_VERSION}-all.jar functional/TestUserAgent.java
java -Dversion=${RELEASE_VERSION} -cp api/build/libs/minio-${RELEASE_VERSION}-all.jar:functional TestUserAgent
- name: Gradle build on java ${{ matrix.java-version }}
- name: Gradle build on Windows
if: matrix.os == 'windows-latest'
run: |
$Env:Path += ';.'
Expand Down
42 changes: 24 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
* limitations under the License.
*/

/***************************/
/* gradleVersion = '7.6' */
/***************************/
/*****************************/
/* gradleVersion = '8.1.1' */
/*****************************/

plugins {
id "com.github.johnrengelman.shadow" version "7.1.2"
id "com.github.spotbugs" version "5.0.13"
id "com.github.spotbugs" version "5.0.14"
id "io.codearte.nexus-staging" version "0.30.0"
id "de.marcphilipp.nexus-publish" version "0.4.0"
id "com.diffplug.spotless" version "6.12.0"
id "com.diffplug.spotless" version "6.13.0"
}

/*
Expand Down Expand Up @@ -52,17 +52,17 @@ subprojects {

dependencies {
api "com.carrotsearch.thirdparty:simple-xml-safe:2.7.1"
api "com.google.guava:guava:30.1.1-jre"
api "com.squareup.okhttp3:okhttp:4.10.0"
api "com.fasterxml.jackson.core:jackson-annotations:2.13.4"
api "com.fasterxml.jackson.core:jackson-core:2.13.4"
api "com.fasterxml.jackson.core:jackson-databind:2.13.4.2"
api "org.bouncycastle:bcprov-jdk15on:1.69"
api 'org.apache.commons:commons-compress:1.21'
api "org.xerial.snappy:snappy-java:1.1.8.4"
compileOnly "com.github.spotbugs:spotbugs-annotations:4.1.2"

testImplementation "com.squareup.okhttp3:mockwebserver:4.8.1"
api "com.google.guava:guava:32.0.0-jre"
api "com.squareup.okhttp3:okhttp:4.11.0"
api "com.fasterxml.jackson.core:jackson-annotations:2.15.2"
api "com.fasterxml.jackson.core:jackson-core:2.15.2"
api "com.fasterxml.jackson.core:jackson-databind:2.15.2"
api "org.bouncycastle:bcprov-jdk15on:1.70"
api 'org.apache.commons:commons-compress:1.23.0'
api "org.xerial.snappy:snappy-java:1.1.10.0"
compileOnly "com.github.spotbugs:spotbugs-annotations:4.7.3"

testImplementation "com.squareup.okhttp3:mockwebserver:4.11.0"
testImplementation "junit:junit:4.13.2"
}

Expand Down Expand Up @@ -242,7 +242,7 @@ project(':adminapi') {

dependencies {
api project(':api')
api "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.4"
api "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.15.2"
testImplementation project(':api')
}

Expand Down Expand Up @@ -346,10 +346,13 @@ project(':adminapi') {

project(':examples') {
dependencies {
compileOnly "me.tongfei:progressbar:0.5.3"
compileOnly "me.tongfei:progressbar:0.9.5"
compileOnly project(':api')
}

compileJava.dependsOn spotlessGroovyGradle, spotlessJava
spotbugsMain.dependsOn compileTestJava, jar, localeTest, spotlessGroovyGradle, spotlessJava

sourceSets {
main {
java {
Expand All @@ -368,6 +371,9 @@ project(':functional') {
implementation project(':adminapi')
}

compileJava.dependsOn spotlessGroovyGradle, spotlessJava
spotbugsMain.dependsOn compileTestJava, jar, localeTest, spotlessGroovyGradle, spotlessJava

sourceSets {
main {
java {
Expand Down
2 changes: 0 additions & 2 deletions examples/GetObjectProgressBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import java.nio.file.StandardOpenOption;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import me.tongfei.progressbar.ProgressBarStyle;

public class GetObjectProgressBar {
/** MinioClient.getObjectProgressBar() example. */
Expand Down Expand Up @@ -66,7 +65,6 @@ public static void main(String[] args)
InputStream is =
new ProgressStream(
"Downloading .. ",
ProgressBarStyle.ASCII,
stat.size(),
minioClient.getObject(
GetObjectArgs.builder().bucket("my-bucketname").object("my-objectname").build()));
Expand Down
14 changes: 4 additions & 10 deletions examples/ProgressStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import java.io.IOException;
import java.io.InputStream;
import me.tongfei.progressbar.ProgressBar;
import me.tongfei.progressbar.ProgressBarStyle;

public class ProgressStream extends InputStream {
private InputStream in;
Expand All @@ -29,12 +28,11 @@ public class ProgressStream extends InputStream {
* input.
*
* @param msg Custom message string.
* @param style Custom progress bar style.
* @param stream InputStream to be wrapped.
* @throws IOException For any exception generated by the InputStream.
*/
public ProgressStream(String msg, ProgressBarStyle style, InputStream stream) throws IOException {
this(msg, style, (long) stream.available(), stream);
public ProgressStream(String msg, InputStream stream) throws IOException {
this(msg, (long) stream.available(), stream);
}

/**
Expand All @@ -43,21 +41,18 @@ public ProgressStream(String msg, ProgressBarStyle style, InputStream stream) th
* input.
*
* @param msg Custom message string.
* @param style Custom progress bar style.
* @param size Size of the progress bar.
* @param stream InputStream to be wrapped.
* @throws IOException For any exception generated by the InputStream.
*/
public ProgressStream(String msg, ProgressBarStyle style, long size, InputStream stream)
throws IOException {
public ProgressStream(String msg, long size, InputStream stream) throws IOException {
super();

// Allocate the reader.
this.in = stream;

// Initialize progress bar.
this.pb = new ProgressBar(msg, size, style);
this.pb.start();
this.pb = new ProgressBar(msg, size);
}

@Override
Expand All @@ -67,7 +62,6 @@ public int available() throws IOException {

@Override
public void close() throws IOException {
this.pb.stop();
this.in.close();
return;
}
Expand Down
4 changes: 1 addition & 3 deletions examples/PutObjectProgressBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.io.InputStream;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import me.tongfei.progressbar.ProgressBarStyle;

public class PutObjectProgressBar {
/** MinioClient.putObjectProgressBar() example. */
Expand All @@ -49,8 +48,7 @@ public static void main(String[] args)

File file = new File("my-filename");
InputStream pis =
new BufferedInputStream(
new ProgressStream("Uploading... ", ProgressBarStyle.ASCII, new FileInputStream(file)));
new BufferedInputStream(new ProgressStream("Uploading... ", new FileInputStream(file)));
minioClient.putObject(
PutObjectArgs.builder().bucket(bucketName).object(objectName).stream(
pis, pis.available(), -1)
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,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 596ab3d

Please sign in to comment.