Skip to content

Commit

Permalink
Remove [temporary?] OSGi support - Upgrade Gradle to 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ar committed Jul 9, 2023
1 parent 9e9c110 commit dba1e0c
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 72 deletions.
4 changes: 2 additions & 2 deletions .sdkmanrc
@@ -1,2 +1,2 @@
java=20-amzn
gradle=8.1.1
java=20.0.1-zulu
gradle=8.2
6 changes: 4 additions & 2 deletions build.gradle
Expand Up @@ -24,8 +24,10 @@ subprojects {
configurations.implementation.transitive = true
javadoc.failOnError = false

sourceCompatibility = 20
targetCompatibility = 20
java {
sourceCompatibility = JavaVersion.VERSION_20
targetCompatibility = JavaVersion.VERSION_20
}

tasks.withType(JavaCompile) {
options.compilerArgs += '--enable-preview'
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
5 changes: 4 additions & 1 deletion gradlew
Expand Up @@ -130,10 +130,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
Expand Down
73 changes: 7 additions & 66 deletions jpos/build.gradle
@@ -1,20 +1,8 @@
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:5.3.0'
classpath 'org.owasp:dependency-check-gradle:7.2.1'
}
}
plugins {
id "org.gradlex.extra-java-module-info" version "1.1"
id "org.owasp.dependencycheck" version "8.3.1"
// id 'checkstyle'
}
apply plugin: 'biz.aQute.bnd.builder'
apply plugin: 'org.owasp.dependencycheck'

import aQute.bnd.gradle.Bundle

extraJavaModuleInfo {
automaticModule ('jdom2-2.0.6.jar', 'org.jdom2')
Expand Down Expand Up @@ -117,8 +105,7 @@ def jposCopySpec = copySpec {
include 'cfg/authorized_keys'
fileMode 0400
}
from(file("${project.buildDir}/${project.libsDirName}/${q2ArchiveJarName}"))

from(file("${project.buildDir}/libs/${q2ArchiveJarName}"))
into("lib") {
from(configurations.runtimeClasspath)
}
Expand All @@ -142,27 +129,18 @@ task listJars {
}
}

jar () {
jar {
manifest {
attributes 'Implementation-Title': 'jPOS',
'Implementation-Version': project.version
}
bnd (
'Bundle-Vendor': bundleVendor,
'Bundle-License': bundleLicense,
'Bundle-DocURL': bundleDocURL,
'Bundle-Description': bundleDescription,
'Bundle-Activator': bundleActivator,
'Import-Package': bundleImportPackage,
'Export-Package': bundleExportPackage
)
}

java {
withSourcesJar()
}

task q2jar (type: Bundle) {
task q2jar (type: Jar) {
dependsOn jar
archiveClassifier.set('q2')
from sourceSets.main.output.classesDirs, sourceSets.main.output.resourcesDir
Expand All @@ -173,62 +151,24 @@ task q2jar (type: Bundle) {
'Main-Class': 'org.jpos.q2.Q2',
'Class-Path': manifestClasspath
}
bnd (
'Bundle-Vendor': bundleVendor,
'Bundle-License': bundleLicense,
'Bundle-DocURL': bundleDocURL,
'Bundle-Description': bundleDescription,
'Bundle-Activator': bundleActivator,
'Import-Package': bundleImportPackage,
'Export-Package': bundleExportPackage,
'Include-Resource': configurations.runtimeClasspath.collect { '-lib/' + it.getName() }.join(' ')
)
}

//checkstyle {
// ignoreFailures = true
// configFile file("${rootProject.projectDir}/.github/linters/sun_checks.xml")
//}

task bundleFull (type: Bundle) {
dependsOn jar
archiveClassifier.set('bundle-full')
from sourceSets.main.output.classesDirs, sourceSets.main.output.resourcesDir
manifest {
def manifestClasspath = configurations.runtimeClasspath.collect { "lib/" + it.getName() }.join(' ')
attributes 'Implementation-Title': 'jPOS',
'Implementation-Version': project.version,
'Main-Class': 'org.jpos.q2.Q2',
'Class-Path': manifestClasspath
}
bnd (
'Bundle-Vendor': bundleVendor,
'Bundle-License': bundleLicense,
'Bundle-DocURL': bundleDocURL,
'Bundle-Description': bundleDescription,
'Bundle-Activator': bundleActivator,
'Import-Package': bundleImportPackage,
'Export-Package': bundleExportPackage,
'Include-Resource': configurations.runtimeClasspath.collect { '-lib/' + it.getName() }.join(' ')
)
into ('lib') {
from configurations.runtimeClasspath {
exclude 'org.osgi.core*.jar'
}
}
}

task sourceJar( type: Jar ) {
archiveClassifier.set("sources")
from sourceSets.main.allSource
}

artifacts {
archives sourceJar, javadocJar, bundleFull
archives sourceJar, javadocJar
}

task dist (type: Tar) {
dependsOn 'q2jar', 'assemble', 'sourceJar'
dependsOn 'jar', 'assemble', 'sourceJar'
compression = Compression.GZIP
includeEmptyDirs true
with jposCopySpec
Expand Down Expand Up @@ -338,6 +278,7 @@ task viewTests (description: 'Open Test Reports') {
}
}


test {
minHeapSize = "4G"
maxHeapSize = "8G"
Expand Down

0 comments on commit dba1e0c

Please sign in to comment.