From 757bc1c0012ef7873247f8824187ce7cf83db3dc Mon Sep 17 00:00:00 2001 From: hstyi Date: Fri, 28 Mar 2025 10:05:43 +0800 Subject: [PATCH] chore: improve dependencies --- THIRDPARTY | 128 ++++++++++++++++++-------------------- build.gradle.kts | 23 +++---- gradle/libs.versions.toml | 17 +---- 3 files changed, 71 insertions(+), 97 deletions(-) diff --git a/THIRDPARTY b/THIRDPARTY index 8f89b6b..c40d86d 100644 --- a/THIRDPARTY +++ b/THIRDPARTY @@ -1,244 +1,240 @@ -annotations 24.0.1 +annotations Apache License 2.0 https://github.com/JetBrains/java-annotations/blob/master/LICENSE.txt -bip39-lib-jvm 1.0.8 +kotlin-bip39 MIT License https://github.com/Electric-Coin-Company/kotlin-bip39/blob/main/LICENSE -colorpicker 2.0.1 +colorpicker BSD 3-Clause "New" or "Revised" License https://github.com/dheid/colorpicker/blob/main/LICENSE -commonmark 0.24.0 +commonmark BSD 2-Clause "Simplified" License https://github.com/commonmark/commonmark-java/blob/main/LICENSE.txt -commons-codec 1.18.0 +commons-codec Apache License 2.0 https://github.com/apache/commons-codec/blob/master/LICENSE.txt -commons-compress 1.27.1 +commons-compress Apache License 2.0 https://github.com/apache/commons-compress/blob/master/LICENSE.txt -commons-io 2.18.0 +commons-io Apache License 2.0 https://github.com/apache/commons-io/blob/master/LICENSE.txt -commons-lang3 3.17.0 +commons-lang3 Apache License 2.0 https://github.com/apache/commons-lang/blob/master/LICENSE.txt -commons-net 3.11.1 +commons-net Apache License 2.0 https://github.com/apache/commons-net/blob/master/LICENSE.txt -commons-text 1.13.0 +commons-text Apache License 2.0 https://github.com/apache/commons-text/blob/master/LICENSE.txt -commons-csv 1.13.0 +commons-csv Apache License 2.0 https://github.com/apache/commons-csv/blob/master/LICENSE.txt -ini4j 0.5.5-2 +ini4j Apache License 2.0 http://www.apache.org/licenses/LICENSE-2.0.txt -eddsa 0.3.0 +eddsa Creative Commons Zero v1.0 Universal https://github.com/str4d/ed25519-java/blob/master/LICENSE.txt -flatlaf 3.5.4 +flatlaf Apache License 2.0 https://github.com/JFormDesigner/FlatLaf/blob/main/LICENSE -flatlaf 3.5.4-no-natives +flatlaf-no-natives Apache License 2.0 https://github.com/JFormDesigner/FlatLaf/blob/main/LICENSE -flatlaf-extras 3.5.4 +flatlaf-extras Apache License 2.0 https://github.com/JFormDesigner/FlatLaf/blob/main/LICENSE -flatlaf-swingx 3.5.4 +flatlaf-swingx Apache License 2.0 https://github.com/JFormDesigner/FlatLaf/blob/main/LICENSE -JavaEWAH 1.2.3 +JavaEWAH Apache License 2.0 https://github.com/lemire/javaewah/blob/master/LICENSE -jbr-api 17.1.10.1 +jbr-api Apache License 2.0 https://github.com/JetBrains/JetBrainsRuntimeApi/blob/main/LICENSE -jcl-over-slf4j 1.7.36 +jcl-over-slf4j Apache License 2.0 https://www.apache.org/licenses/LICENSE-2.0.txt -jfa 1.2.0 +jfa Apache License 2.0 https://github.com/0x4a616e/jfa/blob/main/LICENSE -jgoodies-common 1.8.1 +jgoodies-common BSD-2-Clause License http://www.opensource.org/licenses/bsd-license.html -jgoodies-forms 1.9.0 +jgoodies-forms BSD-2-Clause License http://www.opensource.org/licenses/bsd-license.html -jna 5.16.0 +jna Apache License 2.0 https://github.com/java-native-access/jna/blob/master/AL2.0 -jna-platform 5.16.0 +jna-platform Apache License 2.0 https://github.com/java-native-access/jna/blob/master/AL2.0 -jnafilechooser-api 1.1.2 +jnafilechooser-api BSD 3-Clause "New" or "Revised" License https://github.com/steos/jnafilechooser/blob/master/LICENSE -jnafilechooser-win32 1.1.2 +jnafilechooser-win32 BSD 3-Clause "New" or "Revised" License https://github.com/steos/jnafilechooser/blob/master/LICENSE -jsvg 1.4.0 +jsvg MIT License https://github.com/weisJ/jsvg/blob/master/LICENSE -jSystemThemeDetector 3.9.1 +jSystemThemeDetector Apache License 2.0 https://github.com/Dansoftowner/jSystemThemeDetector/blob/master/LICENSE -kotlin-logging 1.7.9 +kotlin-logging Apache License 2.0 https://github.com/oshai/kotlin-logging/blob/master/LICENSE -kotlin-stdlib 2.1.10 +kotlin-stdlib Apache License 2.0 https://github.com/JetBrains/kotlin/blob/master/license/LICENSE.txt -kotlin-stdlib-jdk7 1.9.10 +kotlin-stdlib-jdk7 Apache License 2.0 https://github.com/JetBrains/kotlin/blob/master/license/LICENSE.txt -kotlin-stdlib-jdk8 1.9.10 +kotlin-stdlib-jdk8 Apache License 2.0 https://github.com/JetBrains/kotlin/blob/master/license/LICENSE.txt -kotlin-stdlib-jdk8 1.9.10 +kotlin-stdlib-jdk8 Apache License 2.0 https://github.com/JetBrains/kotlin/blob/master/license/LICENSE.txt -restart4j 0.0.1 +restart4j Apache License 2.0 https://github.com/hstyi/restart4j/blob/main/LICENSE -kotlinx-coroutines-core-jvm 1.10.1 +kotlinx-coroutines-core Apache License 2.0 https://www.apache.org/licenses/LICENSE-2.0 -kotlinx-coroutines-swing 1.10.1 +kotlinx-coroutines-swing Apache License 2.0 https://www.apache.org/licenses/LICENSE-2.0 -kotlinx-serialization-core-jvm 1.8.0 +kotlinx-serialization-json Apache License 2.0 https://github.com/Kotlin/kotlinx.serialization/blob/master/LICENSE.txt -kotlinx-serialization-json-jvm 1.8.0 -Apache License 2.0 -https://github.com/Kotlin/kotlinx.serialization/blob/master/LICENSE.txt - -logging-interceptor 4.12.0 +logging-interceptor Apache License 2.0 https://www.apache.org/licenses/LICENSE-2.0 -okhttp 4.12.0 +okhttp Apache License 2.0 https://www.apache.org/licenses/LICENSE-2.0 -okio-jvm 3.6.0 +okio-jvm Apache License 2.0 https://www.apache.org/licenses/LICENSE-2.0 -org.eclipse.jgit.ssh.apache 7.1.0.202411261347-r +org.eclipse.jgit.ssh.apache Eclipse Distribution License https://www.eclipse.org/org/documents/edl-v10.php -org.eclipse.jgit 7.1.0.202411261347-r +org.eclipse.jgit Eclipse Distribution License https://www.eclipse.org/org/documents/edl-v10.php -oshi-core 6.6.5 +oshi-core MIT License https://github.com/oshi/oshi/blob/master/LICENSE -pty4j 0.13.2 +pty4j Eclipse Public License 1.0 https://github.com/JetBrains/pty4j/blob/master/LICENSE -slf4j-api 2.0.16 +slf4j-api MIT License https://github.com/qos-ch/slf4j/blob/master/LICENSE.txt -slf4j-tinylog 2.7.0 +slf4j-tinylog Apache License 2.0 https://github.com/tinylog-org/tinylog/blob/v2.7/license.txt -sshd-common 2.14.0 +sshd-common Apache License 2.0 https://www.apache.org/licenses/LICENSE-2.0 -sshd-core 2.14.0 +sshd-core Apache License 2.0 https://www.apache.org/licenses/LICENSE-2.0 -sshd-osgi 2.14.0 +sshd-osgi Apache License 2.0 https://www.apache.org/licenses/LICENSE-2.0 -sshd-sftp 2.14.0 +sshd-sftp Apache License 2.0 https://www.apache.org/licenses/LICENSE-2.0 -swingx-all 1.6.5-1 +swingx-all GNU LESSER GENERAL PUBLIC LICENSE v3 https://www.gnu.org/licenses/lgpl-3.0 -tinylog-api 2.7.0 +tinylog-api Apache License 2.0 https://github.com/tinylog-org/tinylog/blob/v2.7/license.txt -tinylog-impl 2.7.0 +tinylog-impl Apache License 2.0 https://github.com/tinylog-org/tinylog/blob/v2.7/license.txt -versioncompare 1.4.1 +versioncompare Apache License 2.0 https://github.com/G00fY2/version-compare/blob/main/LICENSE -xodus-compress 2.0.1 +xodus-compress Apache License 2.0 https://github.com/JetBrains/xodus/blob/master/LICENSE.txt -xodus-environment 2.0.1 +xodus-environment Apache License 2.0 https://github.com/JetBrains/xodus/blob/master/LICENSE.txt -xodus-openAPI 2.0.1 +xodus-openAPI Apache License 2.0 https://github.com/JetBrains/xodus/blob/master/LICENSE.txt -xodus-utils 2.0.1 +xodus-utils Apache License 2.0 https://github.com/JetBrains/xodus/blob/master/LICENSE.txt -xodus-vfs 2.0.1 +xodus-vfs Apache License 2.0 https://github.com/JetBrains/xodus/blob/master/LICENSE.txt @@ -246,7 +242,7 @@ jediterm Apache License 2.0 https://github.com/JetBrains/jediterm/blob/master/LICENSE-APACHE-2.0.txt -mixpanel-java 1.5.3 +mixpanel-java Apache License 2.0 https://github.com/mixpanel/mixpanel-java/blob/master/LICENSE @@ -254,6 +250,6 @@ json-20231013 Public Domain. https://github.com/stleary/JSON-java/blob/master/LICENSE -jSerialComm 2.11.0 +jSerialComm Apache License 2.0 https://github.com/Fazecast/jSerialComm/blob/master/LICENSE-APACHE-2.0 \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 353ff09..99c1912 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -455,33 +455,26 @@ tasks.register("dist") { tasks.register("check-license") { doLast { - val thirdParty = mutableMapOf() val iterator = File(projectDir, "THIRDPARTY").readLines().iterator() val thirdPartyNames = mutableSetOf() while (iterator.hasNext()) { - val nameWithVersion = iterator.next() - if (nameWithVersion.isBlank()) { + val name = iterator.next() + if (name.isBlank()) { continue } // ignore license name iterator.next() + // ignore license url + iterator.next() - val license = iterator.next() - thirdParty[nameWithVersion.replace(StringUtils.SPACE, "-")] = license - thirdPartyNames.add(nameWithVersion.split(StringUtils.SPACE).first()) + thirdPartyNames.add(name) } - for (file in configurations.runtimeClasspath.get()) { - val name = file.nameWithoutExtension - if (!thirdParty.containsKey(name)) { - if (logger.isWarnEnabled) { - logger.warn("$name does not exist in third-party") - } - if (!thirdPartyNames.contains(name)) { - throw GradleException("$name No license found") - } + for (dependency in configurations.runtimeClasspath.get().allDependencies) { + if (!thirdPartyNames.contains(dependency.name)) { + throw GradleException("${dependency.name} No license found") } } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 868a6db..2b3f4a6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,7 +5,6 @@ pty4j = "0.13.2" tinylog = "2.7.0" kotlinx-coroutines = "1.10.1" flatlaf = "3.5.4" -trove4j = "1.0.20200330" kotlinx-serialization-json = "1.8.0" commons-codec = "1.18.0" commons-lang3 = "3.17.0" @@ -13,7 +12,6 @@ commons-csv = "1.13.0" commons-net = "3.11.1" commons-text = "1.13.0" commons-compress = "1.27.1" -koin-bom = "4.0.0" swingx = "1.6.5-1" jgoodies-forms = "1.9.0" jfa = "1.2.0" @@ -23,13 +21,9 @@ jna = "5.16.0" jSystemThemeDetector = "3.9.1" commons-io = "2.18.0" jbr-api = "17.1.10.1" -leveldb = "0.12" -guava = "33.3.1-jre" -credential-secure-storage = "1.0.3" hutool = "5.8.34" jsch = "0.2.21" okhttp = "4.12.0" -bcprov = "1.79" sshj = "0.39.0" sshd-core = "2.14.0" jgit = "7.1.0.202411261347-r" @@ -63,11 +57,8 @@ pty4j = { group = "org.jetbrains.pty4j", name = "pty4j", version.ref = "pty4j" } ini4j = { module = "org.jetbrains.intellij.deps:ini4j", version.ref = "ini4j" } flatlaf = { group = "com.formdev", name = "flatlaf", version.ref = "flatlaf" } flatlaf-extras = { group = "com.formdev", name = "flatlaf-extras", version.ref = "flatlaf" } -trove4j = { group = "org.jetbrains.intellij.deps", name = "trove4j", version.ref = "trove4j" } -koin-bom = { module = "io.insert-koin:koin-bom", version.ref = "koin-bom" } testcontainers-bom = { module = "org.testcontainers:testcontainers-bom", version.ref = "testcontainers" } testcontainers = { module = "org.testcontainers:testcontainers" } -koin-core = { module = "io.insert-koin:koin-core" } swingx = { module = "org.swinglabs.swingx:swingx-all", version.ref = "swingx" } jgoodies-forms = { module = "com.jgoodies:jgoodies-forms", version.ref = "jgoodies-forms" } jna = { module = "net.java.dev.jna:jna", version.ref = "jna" } @@ -80,26 +71,20 @@ commons-io = { module = "commons-io:commons-io", version.ref = "commons-io" } restart4j = { module = "com.github.hstyi:restart4j", version.ref = "restart4j" } jbr-api = { module = "com.jetbrains:jbr-api", version.ref = "jbr-api" } flatlaf-swingx = { module = "com.formdev:flatlaf-swingx", version.ref = "flatlaf" } -leveldb = { module = "org.iq80.leveldb:leveldb", version.ref = "leveldb" } -guava = { module = "com.google.guava:guava", version.ref = "guava" } hutool = { module = "cn.hutool:hutool-all", version.ref = "hutool" } -credential-secure-storage = { module = "com.microsoft:credential-secure-storage", version.ref = "credential-secure-storage" } jsch = { module = "com.github.mwiede:jsch", version.ref = "jsch" } okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" } okhttp-logging = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp" } -bcprov = { module = "org.bouncycastle:bcprov-jdk18on", version.ref = "bcprov" } sshj = { module = "com.hierynomus:sshj", version.ref = "sshj" } sshd-core = { module = "org.apache.sshd:sshd-core", version.ref = "sshd-core" } jgit = { module = "org.eclipse.jgit:org.eclipse.jgit", version.ref = "jgit" } commonmark = { module = "org.commonmark:commonmark", version.ref = "commonmark" } jgit-sshd = { module = "org.eclipse.jgit:org.eclipse.jgit.ssh.apache", version.ref = "jgit" } xodus-openAPI = { module = "org.jetbrains.xodus:xodus-openAPI", version.ref = "xodus" } -xodus-entity-store = { module = "org.jetbrains.xodus:xodus-entity-store", version.ref = "xodus" } xodus-environment = { module = "org.jetbrains.xodus:xodus-environment", version.ref = "xodus" } -xodus-crypto = { module = "org.jetbrains.xodus:xodus-crypto", version.ref = "xodus" } xodus-vfs = { module = "org.jetbrains.xodus:xodus-vfs", version.ref = "xodus" } jnafilechooser = { module = "com.github.steos.jnafilechooser:jnafilechooser-api", version.ref = "jnafilechooser" } -bip39 = { module = "cash.z.ecc.android:kotlin-bip39-jvm", version.ref = "bip39" } +bip39 = { module = "cash.z.ecc.android:kotlin-bip39", version.ref = "bip39" } rhino = { module = "org.mozilla:rhino", version.ref = "rhino" } delight-rhino-sandbox = { module = "org.javadelight:delight-rhino-sandbox", version.ref = "delight-rhino-sandbox" } colorpicker = { module = "org.drjekyll:colorpicker", version.ref = "colorpicker" }