Gradle: moved declaration of all external dependencies to libs.versions.toml and use Gradle version catalog

This commit is contained in:
Karl Tauber
2023-05-18 15:37:03 +02:00
parent e9fb2b3fdc
commit 9d84501bc8
13 changed files with 87 additions and 33 deletions

View File

@@ -27,12 +27,11 @@ plugins {
val sigtest = configurations.create( "sigtest" ) val sigtest = configurations.create( "sigtest" )
dependencies { dependencies {
testImplementation( "org.junit.jupiter:junit-jupiter-api:5.7.2" ) testImplementation( libs.bundles.junit )
testImplementation( "org.junit.jupiter:junit-jupiter-params" ) testRuntimeOnly( libs.junit.engine )
testRuntimeOnly( "org.junit.jupiter:junit-jupiter-engine" )
// https://github.com/jtulach/netbeans-apitest // https://github.com/jtulach/netbeans-apitest
sigtest( "org.netbeans.tools:sigtest-maven-plugin:1.7" ) sigtest( libs.sigtest )
} }
java { java {

View File

@@ -27,8 +27,8 @@ dependencies {
implementation( project( ":flatlaf-fonts-roboto" ) ) implementation( project( ":flatlaf-fonts-roboto" ) )
implementation( project( ":flatlaf-fonts-roboto-mono" ) ) implementation( project( ":flatlaf-fonts-roboto-mono" ) )
implementation( project( ":flatlaf-intellij-themes" ) ) implementation( project( ":flatlaf-intellij-themes" ) )
implementation( "com.miglayout:miglayout-swing:5.3" ) implementation( libs.miglayout.swing )
implementation( "com.jgoodies:jgoodies-forms:1.9.0" ) implementation( libs.jgoodies.forms )
// implementation( project( ":flatlaf-natives-jna" ) ) // implementation( project( ":flatlaf-natives-jna" ) )
} }

View File

@@ -23,7 +23,7 @@ plugins {
dependencies { dependencies {
implementation( project( ":flatlaf-core" ) ) implementation( project( ":flatlaf-core" ) )
implementation( "com.formdev:svgSalamander:1.1.3" ) implementation( libs.svgSalamander )
} }
flatlafModuleInfo { flatlafModuleInfo {

View File

@@ -33,9 +33,8 @@ plugins {
dependencies { dependencies {
implementation( project( ":flatlaf-core" ) ) implementation( project( ":flatlaf-core" ) )
testImplementation( "org.junit.jupiter:junit-jupiter-api:5.7.2" ) testImplementation( libs.bundles.junit )
testImplementation( "org.junit.jupiter:junit-jupiter-params" ) testRuntimeOnly( libs.junit.engine )
testRuntimeOnly( "org.junit.jupiter:junit-jupiter-engine" )
} }
flatlafModuleInfo { flatlafModuleInfo {

View File

@@ -33,9 +33,8 @@ plugins {
dependencies { dependencies {
implementation( project( ":flatlaf-core" ) ) implementation( project( ":flatlaf-core" ) )
testImplementation( "org.junit.jupiter:junit-jupiter-api:5.7.2" ) testImplementation( libs.bundles.junit )
testImplementation( "org.junit.jupiter:junit-jupiter-params" ) testRuntimeOnly( libs.junit.engine )
testRuntimeOnly( "org.junit.jupiter:junit-jupiter-engine" )
} }
flatlafModuleInfo { flatlafModuleInfo {

View File

@@ -33,9 +33,8 @@ plugins {
dependencies { dependencies {
implementation( project( ":flatlaf-core" ) ) implementation( project( ":flatlaf-core" ) )
testImplementation( "org.junit.jupiter:junit-jupiter-api:5.7.2" ) testImplementation( libs.bundles.junit )
testImplementation( "org.junit.jupiter:junit-jupiter-params" ) testRuntimeOnly( libs.junit.engine )
testRuntimeOnly( "org.junit.jupiter:junit-jupiter-engine" )
} }
flatlafModuleInfo { flatlafModuleInfo {

View File

@@ -33,9 +33,8 @@ plugins {
dependencies { dependencies {
implementation( project( ":flatlaf-core" ) ) implementation( project( ":flatlaf-core" ) )
testImplementation( "org.junit.jupiter:junit-jupiter-api:5.7.2" ) testImplementation( libs.bundles.junit )
testImplementation( "org.junit.jupiter:junit-jupiter-params" ) testRuntimeOnly( libs.junit.engine )
testRuntimeOnly( "org.junit.jupiter:junit-jupiter-engine" )
} }
flatlafModuleInfo { flatlafModuleInfo {

View File

@@ -24,7 +24,7 @@ dependencies {
implementation( project( ":flatlaf-core" ) ) implementation( project( ":flatlaf-core" ) )
// use compileOnly() because there are various JIDE libraries available on Maven Central // use compileOnly() because there are various JIDE libraries available on Maven Central
compileOnly( "com.formdev:jide-oss:3.7.12" ) compileOnly( libs.jide.oss )
} }
java { java {

View File

@@ -21,6 +21,6 @@ plugins {
dependencies { dependencies {
implementation( project( ":flatlaf-core" ) ) implementation( project( ":flatlaf-core" ) )
implementation( "net.java.dev.jna:jna:5.12.1" ) implementation( libs.jna )
implementation( "net.java.dev.jna:jna-platform:5.12.1" ) implementation( libs.jna.platform )
} }

View File

@@ -25,7 +25,7 @@ dependencies {
implementation( project( ":flatlaf-core" ) ) implementation( project( ":flatlaf-core" ) )
// use compileOnly() because there are various SwingX libraries available on Maven Central // use compileOnly() because there are various SwingX libraries available on Maven Central
compileOnly( "org.swinglabs.swingx:swingx-all:1.6.5-1" ) compileOnly( libs.swingx.all )
} }
flatlafModuleInfo { flatlafModuleInfo {

View File

@@ -34,13 +34,13 @@ dependencies {
implementation( project( ":flatlaf-demo" ) ) implementation( project( ":flatlaf-demo" ) )
// implementation( project( ":flatlaf-natives-jna" ) ) // implementation( project( ":flatlaf-natives-jna" ) )
implementation( "com.miglayout:miglayout-swing:5.3" ) implementation( libs.miglayout.swing )
implementation( "com.jgoodies:jgoodies-forms:1.9.0" ) implementation( libs.jgoodies.forms )
implementation( "org.swinglabs.swingx:swingx-all:1.6.5-1" ) implementation( libs.swingx.all )
implementation( "org.swinglabs.swingx:swingx-beaninfo:1.6.5-1" ) implementation( libs.swingx.beaninfo )
implementation( "com.formdev:jide-oss:3.7.12" ) implementation( libs.jide.oss )
implementation( "com.glazedlists:glazedlists:1.11.0" ) implementation( libs.glazedlists )
implementation( "org.netbeans.api:org-openide-awt:RELEASE112" ) implementation( libs.netbeans.api.awt )
} }
applyLafs() applyLafs()

View File

@@ -27,9 +27,9 @@ dependencies {
implementation( project( ":flatlaf-fonts-roboto" ) ) implementation( project( ":flatlaf-fonts-roboto" ) )
implementation( project( ":flatlaf-fonts-roboto-mono" ) ) implementation( project( ":flatlaf-fonts-roboto-mono" ) )
implementation( "com.miglayout:miglayout-swing:5.3" ) implementation( libs.miglayout.swing )
implementation( "com.fifesoft:rsyntaxtextarea:3.1.4" ) implementation( libs.fifesoft.rsyntaxtextarea )
implementation( "com.fifesoft:autocomplete:3.1.3" ) implementation( libs.fifesoft.autocomplete )
} }
tasks { tasks {

59
gradle/libs.versions.toml Normal file
View File

@@ -0,0 +1,59 @@
#
# Copyright 2023 FormDev Software GmbH
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
[versions]
junit = "5.7.2"
[libraries]
# flatlaf-core
sigtest = "org.netbeans.tools:sigtest-maven-plugin:1.7"
# flatlaf-extras
svgSalamander = "com.formdev:svgSalamander:1.1.3"
# flatlaf-jide-oss
jide-oss = "com.formdev:jide-oss:3.7.12"
# flatlaf-swingx
swingx-all = "org.swinglabs.swingx:swingx-all:1.6.5-1"
swingx-beaninfo = "org.swinglabs.swingx:swingx-beaninfo:1.6.5-1"
# flatlaf-demo
miglayout-swing = "com.miglayout:miglayout-swing:5.3"
jgoodies-forms = "com.jgoodies:jgoodies-forms:1.9.0"
# flatlaf-theme-editor
fifesoft-rsyntaxtextarea = "com.fifesoft:rsyntaxtextarea:3.1.4"
fifesoft-autocomplete = "com.fifesoft:autocomplete:3.1.3"
# flatlaf-testing
glazedlists = "com.glazedlists:glazedlists:1.11.0"
netbeans-api-awt = "org.netbeans.api:org-openide-awt:RELEASE112"
# flatlaf-natives-jna
jna = "net.java.dev.jna:jna:5.12.1"
jna-platform = "net.java.dev.jna:jna-platform:5.12.1"
# junit
junit-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit" }
junit-params = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "junit" }
junit-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit" }
[bundles]
junit = [ "junit-api", "junit-params" ]