Skip to content

Commit

Permalink
Gradle build refactoring and version upgrade (6 to 8) 🚀🚀
Browse files Browse the repository at this point in the history
details:
   * gradle:          6.8.2 -->> 8.6
   * gradle 'launch4j' plugin: 2.4.9 -->> 3.0.5
   * gradle 'shadow' plugin is introduced (but gradle build is simplified)
   * gradle configurations are changed:
      ** 'compile' is replaced with 'implementation'
      ** 'testCompile' is replaced with 'testImplementation'

related links:
  * https://docs.gradle.org/8.6/userguide/upgrading_version_6.html#sec:configuration_removal
  * https://docs.gradle.org/8.6/userguide/upgrading_version_8.html#java_convention_deprecation
  * https://docs.gradle.org/8.6/dsl/org.gradle.api.plugins.JavaPluginExtension.html#org.gradle.api.plugins.JavaPluginExtension:sourceCompatibility
  * https://docs.gradle.org/8.6/javadoc/org/gradle/api/JavaVersion.html
  • Loading branch information
dejan2609 committed Feb 3, 2024
1 parent 923610f commit e8e85bc
Show file tree
Hide file tree
Showing 6 changed files with 225 additions and 158 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Raccoon is an APK downloader for fetching apps from Google Play.
Building
--------

Raccoon is build with gradle. It is recommended to use the "launch4j" task
instead of the standard one. Version can be changed via 'gradle.properties' file.
Raccoon is build with gradle.
Project version can be changed via 'gradle.properties' file.

#### How to build on Linux/MacOS/Windows (git bash/powershell terminal):
./gradlew createExe
Expand Down
57 changes: 27 additions & 30 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,64 +1,61 @@
plugins {
id "java"
id "eclipse"
id "edu.sc.seis.launch4j" version "2.4.9"
id "edu.sc.seis.launch4j" version "3.0.5"
id "com.github.johnrengelman.shadow" version "8.1.1"
}

// Settings
sourceCompatibility = 1.7
targetCompatibility = 1.7
java {
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
}

// In this section you declare where to find the dependencies of your project
repositories {
// You can declare any Maven/Ivy/file repository here.
mavenCentral()
}

task fatJar(type: Jar) {
shadowJar {
manifest {
// version can be changed via 'gradle.properties' file
attributes 'Implementation-Version': archiveVersion, 'Main-Class': 'de.onyxbits.raccoon.Main'
}
archiveBaseName = project.name
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
exclude 'META-INF/*', 'META-INF/maven/'
with jar
}

createExe {
copyConfigurable = project.tasks.fatJar.outputs.files
outfile = 'Raccoon-' +version +'.exe'
launch4j {
outfile = 'Raccoon-' + project.version +'.exe'
mainClassName = 'de.onyxbits.raccoon.Main'
jvmOptions = [ "-Dswing.defaultlaf=com.sun.java.swing.plaf.windows.WindowsLookAndFeel", "-Djava.net.preferIPv4Stack=true" ]
jar = "lib/${project.tasks.fatJar.archiveName}"
icon= '../../icon.ico'
jarTask = project.tasks.shadowJar
icon= "${rootDir}/icon.ico"
jreMinVersion ='1.7.0'
}

// In this section you declare the dependencies for your production and test code
dependencies {
// The production code uses the SLF4J logging API at compile time
// compile 'org.slf4j:slf4j-api:1.7.7'
compile 'net.dongliu:apk-parser:2.6.10'
compile 'org.hsqldb:hsqldb:2.5.1'
compile 'org.eclipse.jetty:jetty-server:8.1.22.v20160922'
compile 'com.google.zxing:core:3.4.1'
compile 'commons-codec:commons-codec:1.15'
compile 'com.google.protobuf:protobuf-java:3.14.0'
compile 'org.apache.httpcomponents:httpclient:4.5.13'
compile 'org.apache.httpcomponents:httpcore:4.4.14'
compile 'commons-io:commons-io:2.8.0'
compile 'commons-cli:commons-cli:1.4'
compile group: 'org.bouncycastle', name: 'bctls-jdk15on', version: '1.57'
// implementation 'org.slf4j:slf4j-api:1.7.7'
implementation 'net.dongliu:apk-parser:2.6.10'
implementation 'org.hsqldb:hsqldb:2.5.1'
implementation 'org.eclipse.jetty:jetty-server:8.1.22.v20160922'
implementation 'com.google.zxing:core:3.4.1'
implementation 'commons-codec:commons-codec:1.15'
implementation 'com.google.protobuf:protobuf-java:3.14.0'
implementation 'org.apache.httpcomponents:httpclient:4.5.13'
implementation 'org.apache.httpcomponents:httpcore:4.4.14'
implementation 'commons-io:commons-io:2.8.0'
implementation 'commons-cli:commons-cli:1.4'
implementation 'org.bouncycastle:bctls-jdk15on:1.57'

// Declare the dependency for your favourite test framework you want to use in your tests.
// TestNG is also supported by the Gradle Test task. Just change the
// testCompile dependency to testCompile 'org.testng:testng:6.8.1' and add
// testimplementation dependency to testimplementation 'org.testng:testng:6.8.1' and add
// 'test.useTestNG()' to your build script.
testCompile "junit:junit:4.13.1"
testImplementation "junit:junit:4.13.1"
}

wrapper {
gradleVersion = "6.8.2"
gradleVersion = "8.6"
distributionType = Wrapper.DistributionType.ALL
}
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 4 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-all.zip
distributionSha256Sum=85719317abd2112f021d4f41f09ec370534ba288432065f4b477b6a3b652910d
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit e8e85bc

Please sign in to comment.