Skip to content

Commit

Permalink
Use api/implementation in dependencies
Browse files Browse the repository at this point in the history
Also removed assorted Gradle 6 warnings.
  • Loading branch information
ar committed Nov 23, 2019
1 parent 20ad8e9 commit 27634a2
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 66 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ allprojects {
}

subprojects {
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'pmd'
Expand Down
29 changes: 12 additions & 17 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -154,19 +154,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $i + 1`
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

Expand All @@ -175,14 +175,9 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
APP_ARGS=`save "$@"`

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"
78 changes: 38 additions & 40 deletions jpos/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:4.2.0'
classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:4.3.1'
classpath 'org.owasp:dependency-check-gradle:5.2.1'
}
}
Expand All @@ -13,30 +13,30 @@ apply plugin: 'org.owasp.dependencycheck'
import aQute.bnd.gradle.Bundle

dependencies {
compile libraries.jdom
compile libraries.jdbm
compile libraries.sleepycat_je
compile libraries.commons_cli
compile libraries.jline
compile libraries.beanshell
compile libraries.javatuples
compile libraries.osgi_core
compile libraries.bouncycastle
compile libraries.sshd
compile libraries.slf4j_api
compile libraries.javassist
compile libraries.hdrhistogram
compile libraries.yaml;
api libraries.jdom
api libraries.javatuples
implementation libraries.commons_cli
implementation libraries.jline
implementation libraries.beanshell
implementation libraries.osgi_core
implementation libraries.bouncycastle
implementation libraries.sshd
implementation libraries.slf4j_api
implementation libraries.javassist
implementation libraries.hdrhistogram
implementation libraries.yaml;
implementation libraries.jdbm
implementation libraries.sleepycat_je

testCompile libraries.commons_lang3
testCompile libraries.hamcrest
testCompile libraries.fest_assert
testCompile libraries.xmlunit
testImplementation libraries.commons_lang3
testImplementation libraries.hamcrest
testImplementation libraries.fest_assert
testImplementation libraries.xmlunit
testImplementation libraries.junit
testCompile(libraries.mockito) {
testImplementation (libraries.mockito) {
exclude(module: 'hamcrest-core')
}
testCompile libraries.mockito_jupiter
testImplementation libraries.mockito_jupiter

// JSONPackager on hold
// compile (libraries.jsonsimple) {
Expand Down Expand Up @@ -82,7 +82,7 @@ def jposCopySpec = copySpec {
from(file("${project.buildDir}/${project.libsDirName}/${q2ArchiveJarName}"))

into("lib") {
from(configurations.runtime)
from(configurations.runtimeClasspath)
}
}

Expand All @@ -107,9 +107,8 @@ task listJars {

jar () {
manifest {
def manifestClasspath = configurations.runtime.collect { "lib/" + it.getName() }.join(' ')
attributes 'Implementation-Title': 'jPOS',
'Implementation-Version': version,
'Implementation-Version': project.version,
'Automatic-Module-Name': moduleName
}
bnd (
Expand All @@ -128,11 +127,9 @@ task q2jar (type: Bundle) {
classifier = 'q2'
from sourceSets.main.output.classesDirs, sourceSets.main.output.resourcesDir
manifest {
// classesDir = new File(buildDir, 'classes/java/main') // sourceSets.main.output.classesDir deprecated
// classpath = sourceSets.main.runtimeClasspath
def manifestClasspath = configurations.runtime.collect { "lib/" + it.getName() }.join(' ')
def manifestClasspath = configurations.runtimeClasspath.collect { "lib/" + it.getName() }.join(' ')
attributes 'Implementation-Title': 'jPOS',
'Implementation-Version': version,
'Implementation-Version': project.version,
'Automatic-Module-Name': moduleName,
'Main-Class': 'org.jpos.q2.Q2',
'Class-Path': manifestClasspath
Expand All @@ -145,7 +142,7 @@ task q2jar (type: Bundle) {
'Bundle-Activator': bundleActivator,
'Import-Package': bundleImportPackage,
'Export-Package': bundleExportPackage,
'Include-Resource': configurations.runtime.collect { '-lib/' + it.getName() }.join(' ')
'Include-Resource': configurations.runtimeClasspath.collect { '-lib/' + it.getName() }.join(' ')
)
}

Expand All @@ -154,11 +151,9 @@ task bundleFull (type: Bundle) {
classifier = 'bundle-full'
from sourceSets.main.output.classesDirs, sourceSets.main.output.resourcesDir
manifest {
// classesDir = new File(buildDir, 'classes/java/main') // sourceSets.main.output.classesDir deprecated
// classpath = sourceSets.main.runtimeClasspath
def manifestClasspath = configurations.runtime.collect { "lib/" + it.getName() }.join(' ')
def manifestClasspath = configurations.runtimeClasspath.collect { "lib/" + it.getName() }.join(' ')
attributes 'Implementation-Title': 'jPOS',
'Implementation-Version': version,
'Implementation-Version': project.version,
'Automatic-Module-Name': moduleName,
'Main-Class': 'org.jpos.q2.Q2',
'Class-Path': manifestClasspath
Expand All @@ -171,10 +166,10 @@ task bundleFull (type: Bundle) {
'Bundle-Activator': bundleActivator,
'Import-Package': bundleImportPackage,
'Export-Package': bundleExportPackage,
'Include-Resource': configurations.runtime.collect { '-lib/' + it.getName() }.join(' ')
'Include-Resource': configurations.runtimeClasspath.collect { '-lib/' + it.getName() }.join(' ')
)
into ('lib') {
from configurations.runtime {
from configurations.runtimeClasspath {
exclude 'org.osgi.core*.jar'
}
}
Expand All @@ -200,31 +195,34 @@ task dist (type: Tar) {
compression = Compression.GZIP
includeEmptyDirs true
with jposCopySpec
into "jpos-$version"
extension "tar.gz"
into "jpos-$project.version"
archiveExtension="tar.gz"
}

task zip (type: Zip) {
dependsOn 'q2jar', 'assemble', 'sourceJar'
includeEmptyDirs true
includeEmptyDirs true
with jposCopySpec
into "jpos-$version"
into "jpos-$project.version"
}

task version (type: JavaExec, dependsOn: classes) {
description = "Display jPOS Version"
main = 'org.jpos.q2.Q2'
args = "--version".split().toList()
classpath sourceSets.main.runtimeClasspath, configurations.runtime
classpath sourceSets.main.runtimeClasspath
}

class GitRevisionTask extends DefaultTask
{
@InputFile @Optional
File gitHead

@Input
boolean gotHead

@InputFile
File getRefFile()
{
return new File(gitHead.parent,gitHead.text.replace('ref: ', '').trim())
Expand Down Expand Up @@ -255,7 +253,7 @@ class GitRevisionTask extends DefaultTask
}

class BuildTimestampTask extends DefaultTask {
// We don't want to declare @OutputFile, we need a fresh timestamp on every run
@OutputFile
File outputFile

@TaskAction
Expand Down
12 changes: 6 additions & 6 deletions qnode/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies {
compile "commons-cli:commons-cli:1.2"
compile 'org.apache.felix:org.apache.felix.framework:5.4.0'
implementation "commons-cli:commons-cli:1.2"
implementation 'org.apache.felix:org.apache.felix.framework:5.4.0'
// compile( "org.osgi:org.osgi.core:4.3.1" )
}

Expand Down Expand Up @@ -30,7 +30,7 @@ def jposCopySpec = copySpec {
rename archiveJarName, "${cfg.jarname}"
}
into("lib") {
from(configurations.runtime)
from(configurations.runtimeClasspath)
}
}

Expand All @@ -42,9 +42,9 @@ task listJars {

jar () {
manifest {
def manifestClasspath = configurations.runtime.collect { "lib/" + it.getName() }.join(' ')
def manifestClasspath = configurations.runtimeClasspath.collect { "lib/" + it.getName() }.join(' ')
attributes 'Implementation-Title': 'jPOS',
'Implementation-Version': version,
'Implementation-Version': project.version,
'Main-Class': 'org.jpos.qnode.QNode',
'Class-Path': manifestClasspath
}
Expand All @@ -69,7 +69,7 @@ task dist (type: Tar) {
compression = Compression.GZIP
includeEmptyDirs true
with jposCopySpec
into "jpos-$version"
into "jpos-$project.version"
}

task version (type: JavaExec, dependsOn: classes) {
Expand Down
3 changes: 1 addition & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
include 'jpos',
'qnode'
include 'jpos'

rootProject.name = 'jpos'

0 comments on commit 27634a2

Please sign in to comment.