kaikramer / keystore-explorer

KeyStore Explorer is a free GUI replacement for the Java command-line utilities keytool and jarsigner.
https://keystore-explorer.org/
GNU General Public License v3.0
1.7k stars 275 forks source link

can't build latest release v5.4.4 with current gradle 7.1.1 #282

Closed zeners closed 3 years ago

zeners commented 3 years ago

i'm getting an error trying to build current release with gradle 7.1.1

$ gradle -v

------------------------------------------------------------
Gradle 7.1.1
------------------------------------------------------------

Build time:   2021-07-17 00:45:00 UTC
Revision:     <unknown>

Kotlin:       1.4.31
Groovy:       3.0.7
Ant:          Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM:          1.8.0_292 (Oracle Corporation 25.292-b10)
OS:           Linux 5.10.52-1-MANJARO amd64

gradle output:

$ gradle clean build
Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

* Where:
Build file '****/keystore-explorer-5.4.4/kse/build.gradle' line: 103

* What went wrong:
A problem occurred evaluating root project 'kse'.
> Could not find method compile() for arguments [{group=org.bouncycastle, name=bcpkix-jdk15on, version=1.66}] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

please tag a new minor release, if possible

kaikramer commented 3 years ago

Please use the included Gradle wrapper (see paragraph "Building" in the README.md) to build KSE.

Maybe I'll upgrade to Gradle 7 later this year, but right now there is no reason to do it and getting the next release ready has priority anyway.

If you want to contribute to the KSE project, feel free to do the upgrade to Gradle 7. It might be as easy as replacing "compile" with whatever it is called now.

zeners commented 3 years ago

Thanks for the insight. I played around with the gradle file and most of the input came from the current master. Till the next release i will use the following patch-file (github don't support .patch attachments? )

Index: kse/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/kse/build.gradle b/kse/build.gradle
--- a/kse/build.gradle  (revision 9d46b4b43d4b18d2806dd399ec68685337732bb1)
+++ b/kse/build.gradle  (date 1627287073068)
@@ -100,24 +100,24 @@
 targetCompatibility = 1.8

 dependencies {
-   compile group: 'org.bouncycastle', name: 'bcpkix-jdk15on', version: '1.66'
-   compile group: 'net.java.dev.jna', name: 'jna', version: '5.6.0'
-   compile group: 'commons-io', name: 'commons-io', version: '2.7'
-   compile group: 'com.miglayout', name: 'miglayout-swing', version: '5.2'
-   compile group: 'com.formdev', name: 'flatlaf', version: '0.38'
+   implementation group: 'org.bouncycastle', name: 'bcpkix-jdk15on', version: '1.66'
+   implementation group: 'net.java.dev.jna', name: 'jna', version: '5.6.0'
+   implementation group: 'commons-io', name: 'commons-io', version: '2.7'
+   implementation group: 'com.miglayout', name: 'miglayout-swing', version: '5.2'
+   implementation group: 'com.formdev', name: 'flatlaf', version: '0.38'

    // VAqua Look & Feel not in a public repository yet
    if (file("lib/VAqua7.jar").exists()) {
-       compile files('lib/VAqua7.jar')
+       implementation files('lib/VAqua7.jar')
    }

-   testCompile("org.assertj:assertj-core:3.16.1")
-   testCompile("org.junit.jupiter:junit-jupiter-api:5.6.2")
-   testCompile("org.junit.jupiter:junit-jupiter-params:5.6.2")
-   testRuntime("org.junit.jupiter:junit-jupiter-engine:5.6.2")
+   testImplementation("org.assertj:assertj-core:3.16.1")
+   testImplementation("org.junit.jupiter:junit-jupiter-api:5.6.2")
+   testImplementation("org.junit.jupiter:junit-jupiter-params:5.6.2")
+   testImplementation("org.junit.jupiter:junit-jupiter-engine:5.6.2")

    // To avoid compiler warnings about @API annotations in JUnit code:
-   testCompileOnly('org.apiguardian:apiguardian-api:1.1.0')
+   testRuntimeOnly('org.apiguardian:apiguardian-api:1.1.0')
 }

@@ -132,7 +132,7 @@
                    'Specification-Version': project.version,
                    'Specification-Vendor': project.vendor,
                    'Main-Class': project.mainClassName,
-                   'Class-Path': configurations.compile.collect { 'lib/' + it.getName() }.join(' '),
+                   'Class-Path': configurations.runtimeClasspath.files.collect { 'lib/' + it.getName() }.join(' '),
                    'Built-Date': new Date().format("yyyy-MM-dd HH:mm:ss"),
                    'SplashScreen-Image': 'org/kse/gui/images/splash.png',
                    'Sealed': 'true'
@@ -187,7 +187,7 @@
        }
    }
    into("$distFileNamePrefix/lib") {
-       from configurations.runtime
+       from configurations.runtimeClasspath.files
    }
    into("$distFileNamePrefix/licenses") {
        from(licensesDir) {
@@ -205,7 +205,7 @@
 }

 task copyDependencies(type: Copy) {
-   from configurations.compile
+   from configurations.runtimeClasspath.files
    into dependenciesDir
 }

@@ -352,7 +352,7 @@

    into "/opt/${packageName}"
    from(jar.outputs.files)
-   from(configurations.runtime) {
+   from(configurations.runtimeClasspath.files) {
        into 'lib'
    }
    from('lib') {
ogarcia commented 3 years ago

@zeners works perfect! Thanks!