Skip to content

Commit

Permalink
Ziggy release 0.4.0 (2023-10-23)
Browse files Browse the repository at this point in the history
  • Loading branch information
wohler committed Nov 3, 2023
1 parent a418148 commit 59aca2a
Show file tree
Hide file tree
Showing 1,004 changed files with 40,659 additions and 47,238 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
*.mexmaci64
.classpath
.cproject
.factorypath
.project
.pydevproject
.settings
dist
doc/pdf
outside
src/main/resources/ziggy-build.properties
src/test/cpp/ExternalProcess/testprog.o
src/test/cpp/testmi/inputs-0.bin
1 change: 1 addition & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ authors:
affiliation: "SETI Institute/NASA Ames Research Center"
email: [email protected]
orcid: "https://orcid.org/0000-0002-5402-9613"
doi: 10.5281/zenodo.7859503
license-url: "https://github.com/nasa/ziggy/blob/main/LICENSE.pdf"
url: "https://github.com/nasa/ziggy"
repository-code: "https://github.com/nasa/ziggy"
Expand Down
146 changes: 98 additions & 48 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,101 +7,143 @@
// To view a dependency graph using the taskinfo plugin, run "./gradlew tiTree build"

plugins {
id 'com.github.spotbugs' version '5.0.+'
id 'com.github.spotbugs' version '5.1.+'
id 'eclipse'
id 'jacoco'
id 'java'
id 'maven-publish'
id 'org.barfuin.gradle.taskinfo' version '2.1.+'
id 'signing'
}

defaultTasks 'assemble', 'test'
defaultTasks 'assemble', 'publish', 'test'

ext {
// See comment for ziggyDependencies in gradle.properties.
ziggyDependencies = "$rootDir/$ziggyDependencies"
// Location of third-party sources.
outsideDir = "$rootDir/outside"

// The dependency group used for libraries from outside is called "outside".
// This variable contains the directory that contains the libraries from
// outside. Without the dependency group and the outside subdirectory,
// consumers of the published module will get "null" errors.
outsideGroupDir = "$buildDir/libs/outside"

// Name of the outside group, used in publishing artifacts.
outsideGroup = "outside"
}

repositories {
mavenCentral()
flatDir {
dirs "$ziggyDependencies/lib"
dirs "$outsideDir/lib"
}
}

dependencies {
// Needed to compile ziggy.
implementation files("$rootDir/buildSrc/build/libs/buildSrc-${version}.jar")

implementation 'com.github.librepdf:openpdf:1.3.+'
implementation 'com.github.testdriven.guice:commons-configuration:1.+'
implementation 'com.github.spotbugs:spotbugs-annotations:4.7.+'
implementation 'com.google.guava:guava:23.+'
implementation 'com.jgoodies:jgoodies-forms:1.9.+'
implementation 'com.jgoodies:jgoodies-looks:2.7.+'
implementation 'com.sun.xml.bind:jaxb-impl:3.0+'
implementation 'commons-cli:commons-cli:1.5.+'
implementation 'commons-codec:commons-codec:1.+'
implementation 'commons-io:commons-io:2.11.+'
implementation 'jakarta.xml.bind:jakarta.xml.bind-api:3.0+'
implementation 'org.apache.commons:commons-collections4:4.+'
implementation 'org.apache.commons:commons-compress:1.+'
implementation 'org.apache.commons:commons-configuration2:2.9.+'
implementation 'org.apache.commons:commons-csv:1.9.+'
implementation 'org.apache.commons:commons-exec:1.+'
implementation 'org.apache.commons:commons-lang3:3.12.+'
implementation 'org.apache.commons:commons-math3:3.6.+'
implementation 'org.apache.commons:commons-text:1.+'
implementation 'org.apache.logging.log4j:log4j-api:2.17.+'
implementation 'org.apache.logging.log4j:log4j-core:2.17.+'
implementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.17.+'
implementation 'org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.+'
implementation 'org.hibernate:hibernate-core:4.2.+'
implementation 'org.apache.logging.log4j:log4j-core:2.20.+'
implementation 'org.apache.logging.log4j:log4j-slf4j2-impl:2.20.+'
implementation 'org.hibernate.orm:hibernate-ant:6.2.+'
implementation 'org.hibernate:hibernate-core:6.2.+'
implementation 'org.javassist:javassist:3.29.2-GA'
implementation 'org.jfree:jfreechart:1.0.+'
implementation 'org.jsoup:jsoup:1.16.+'
implementation 'org.netbeans.api:org-netbeans-swing-outline:+'
implementation 'org.slf4j:slf4j-api:2.0.+'
implementation 'org.tros:l2fprod-properties-editor:1.3.+'
implementation 'tanukisoft:wrapper:3.2.+'
runtimeOnly 'jakarta.xml.bind:jakarta.xml.bind-api:3.0+'

// Libraries built in buildSrc.
implementation ':jarhdf5:1.12.+'
implementation ':wrapper:'
// Configuration2 declares the following as optional [1]. It's not, so it's added here.
// Occasionally, comment out this line--if the tests pass, delete it.
// 1. https://github.com/apache/commons-configuration/blob/master/pom.xml
implementation 'commons-beanutils:commons-beanutils:1.9.+'

// Needed to compile unit tests.
implementation 'com.github.spotbugs:spotbugs-annotations:4.7.+'
implementation 'junit:junit:4.13.+'
implementation 'org.hamcrest:hamcrest:2.+'
implementation 'org.mockito:mockito-core:3.12.+'
// Libraries built outside.
implementation 'outside:jarhdf5:1.12.+'
implementation 'outside:wrapper:3.5.+'

// Needed to run unit tests and at runtime.
implementation 'org.hsqldb:hsqldb:2.7.+'

// Needed to run unit tests.
// hsqldb version 2.3.4 causes PipelineInstanceTaskCrudTest to
// fail with HsqlException: data exception: datetime field
// overflow. This can be fixed by replacing Long.MAX_VALUE with a
// smaller date. Other problems ensue with version 2.6.
implementation 'org.hsqldb:hsqldb:2.3.2'
// Needed to compile unit tests.
testImplementation 'junit:junit:4.13.+'
testImplementation 'org.hamcrest:hamcrest:2.+'
testImplementation 'org.mockito:mockito-core:3.12.+'

// Needed at runtime.
implementation 'org.postgresql:postgresql:9.4-1201-jdbc4'
runtimeOnly 'jakarta.xml.bind:jakarta.xml.bind-api:3.0+'
runtimeOnly 'org.hibernate.orm:hibernate-hikaricp:6.2.+'
runtimeOnly 'org.postgresql:postgresql:42.6.+'

// Astonishingly, for some reason configuration2 doesn't work when
// called by MATLAB, but configuration does. Ziggy doesn't use MATLAB
// in its build but provides MATLAB utilities that pipelines can call,
// so I think that makes this a runtime dependency for Ziggy.
runtimeOnly 'commons-configuration:commons-configuration:1.10'

// The following plugin reveals some bugs in our code, but until
// the "The following classes needed for analysis were missing" bug
// is fixed, it is commented out for daily use.
// spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.12.+'

annotationProcessor 'org.hibernate.orm:hibernate-jpamodelgen:6.2.+'
}

tasks.withType(JavaCompile) {
options.deprecation = true
}

// Add additional artifacts for publishing (see script-utils/publish.gradle).
java {
// This runs the javadoc task, which currently fails due to
// Javadoc errors. Enable after errors fixed, or ignored.
// withJavadocJar()

withSourcesJar()
}

test {
systemProperty "log4j2.configurationFile","$projectDir/test/data/logging/log4j2.xml"
systemProperty "java.library.path", "$ziggyDependencies/lib"

systemProperty "java.library.path", "$outsideDir/lib"

testLogging {
events "failed", "skipped"
}
useJUnit {
// If a code coverage report that incudes the integration tests is desired, then comment
// out the IntegrationTestCategory line and uncomment the RunByNameTestCategory line. When
// the JaCoCo issue described below is resolved, then delete this comment.
// excludeCategories 'gov.nasa.ziggy.RunByNameTestCategory'
excludeCategories 'gov.nasa.ziggy.IntegrationTestCategory'
}
}

// Execute tests marked with @Category(IntegrationTestCategory.class).
task integrationTest(type: Test) {
systemProperty "log4j2.configurationFile", "$rootDir/etc/log4j2.xml"
systemProperty "ziggy.logfile", "$buildDir/build.log"
systemProperty "java.library.path", "$outsideDir/lib"

testLogging {
events "failed", "skipped"
}
useJUnit {
includeCategories 'gov.nasa.ziggy.IntegrationTestCategory'
excludeCategories 'gov.nasa.ziggy.RunByNameTestCategory'
Expand All @@ -113,6 +155,10 @@ task integrationTest(type: Test) {
// since they don't play well with others. For example:
// gradle runByNameTests --tests *RmiInterProcessCommunicationTest
task runByNameTest(type: Test) {
systemProperty "log4j2.configurationFile", "$rootDir/etc/log4j2.xml"
systemProperty "ziggy.logfile", "$buildDir/build.log"
systemProperty "java.library.path", "$outsideDir/lib"

useJUnit {
includeCategories 'gov.nasa.ziggy.RunByNameTestCategory'
}
Expand All @@ -122,12 +168,19 @@ task runByNameTest(type: Test) {
task testAll

testAll.dependsOn test, integrationTest
check.dependsOn testAll

// To view code coverage, run the jacocoTestReport task and view the output in:
// build/reports/jacoco/test/html/index.html.
check.dependsOn jacocoTestReport

jacocoTestReport {
// TODO Switch dependency to testAll to ensure that the integration tests are counted
// Depending on anything other than test results in this task
// getting SKIPPED, perhaps due to missing execution data. If code
// coverage of integration tests is desired, see comment in the test
// configuration.
// Switching to a recent version of JUnit 5+ was shown to work in one post
dependsOn test

// Since GUI code doesn't have unit tests, exclude it from the
Expand All @@ -153,31 +206,28 @@ spotbugs {
reportLevel = 'high'
}

// The following should work to provide a single closure instead of
// separate closures for the spotbugsMain and spotbugsTest tasks, but
// it generates a "Could not get unknown property 'com'" error.
// tasks.withType(com.github.spotbugs.SpotBugsTask) {
// The following more verbose code accomplishes the same thing.
// Note that the following more verbose code also triggers a Gradle
// deprecation warning, specifically a warning that ConfigureUtil
// is going away. The specific line that generates the message appears
// to be the "html" line.
tasks.matching {task -> task.name.startsWith('spotbugs')}.forEach {
it.reports {
html {
stylesheet = 'fancy-hist.xsl'
}
tasks.withType(com.github.spotbugs.snom.SpotBugsTask) {
reports {
html.stylesheet = "fancy-hist.xsl"
}
}

// Outside build files should copy their jars to $outsideGroupDir and
// then make copyOutsideLibs depend on the task that performs that copy.
// This is used to publish the outside jars.
task copyOutsideLibs
compileJava.dependsOn copyOutsideLibs

// Apply Ziggy Gradle script plugins.
apply from: "script-plugins/copy.gradle"
apply from: "script-plugins/copy-hdf5.gradle"
apply from: "script-plugins/database-schemas.gradle"
apply from: "script-plugins/eclipse.gradle"
apply from: "script-plugins/gcc.gradle"
apply from: "script-plugins/hdf5.gradle"
apply from: "script-plugins/misc.gradle"
apply from: "script-plugins/test.gradle"
apply from: "script-plugins/wrapper.gradle"
apply from: "script-plugins/xml-schemas.gradle"
apply from: "script-plugins/ziggy-libraries.gradle"

// Depends on versions set in hdf5.gradle and wrapper.gradle and copyBuildSrc from copy.gradle.
apply from: "script-plugins/publish.gradle"
85 changes: 70 additions & 15 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
* This is the buildSrc/build.gradle file. This should contain a minimal
* amount of dependencies as this is used by the build system itself.
*/
apply plugin: 'eclipse'
apply plugin: 'java'
plugins {
id 'eclipse'
id 'java'
id 'maven-publish'
}

defaultTasks 'assemble'

Expand All @@ -15,23 +18,29 @@ dependencies {
// Needed to compile buildSrc.
implementation 'com.google.guava:guava:23.+'
implementation 'commons-io:commons-io:2.11.+'
implementation 'jakarta.xml.bind:jakarta.xml.bind-api:3.0.+'
implementation 'org.apache.commons:commons-exec:1.+'
implementation 'org.freemarker:freemarker:2.3.+'
implementation 'com.sun.xml.bind:jaxb-impl:3.0+'
runtimeOnly 'jakarta.xml.bind:jakarta.xml.bind-api:3.0+'
implementation 'org.apache.commons:commons-lang3:3.12.+'
runtimeOnly 'com.sun.xml.bind:jaxb-impl:3.0.+'

// Needed to compile unit tests.
implementation 'junit:junit:4.+'
implementation 'org.mockito:mockito-core:4.8.+'
testImplementation 'junit:junit:4.+'
testImplementation 'org.mockito:mockito-core:4.8.+'

// The following stuff is needed in order to build custom gradle tasks and plugins.
implementation gradleApi()
implementation localGroovy()
}

test {
testLogging {
showStandardStreams = true
}
}

eclipse {
classpath {
defaultOutputDir = file("$buildDir/eclipse")
defaultOutputDir = file("$buildDir/eclipse/default")
// outputBaseDir = file("$buildDir/eclipse")
downloadSources = false
downloadJavadoc = false
Expand All @@ -45,19 +54,65 @@ eclipse {
entries.each { entry ->
if (entry.kind == "src" && entry.hasProperty("output")) {
// The use of $buildDir does not return build.
entry.output = "build/eclipse"
entry.output = entry.output.replace("bin/", "build/eclipse/")
}
}
}
}
}

test {
testLogging {
showStandardStreams = true
// Avoid duplicate classpath entries.
tasks.eclipse.dependsOn(cleanEclipse)

// Publish ziggy-buildSrc.jar. See also $rootDir/script-utils/publish.gradle.
publishing {
publications {
ziggyBuildSrc(MavenPublication) {
groupId group
from components.java
artifactId "ziggy-buildSrc"
version version

// Maven doesn't understand 2.17.+ notation.
suppressPomMetadataWarningsFor('runtimeElements')

pom {
name = 'Ziggy BuildSrc'
description = 'Ziggy Gradle build library'
url = 'https://github.com/nasa/ziggy'
licenses {
license {
name = 'NASA Open Source Agreement Version 1.3'
url = 'https://github.com/nasa/ziggy/blob/main/LICENSE.pdf'
}
}
developers {
developer {
id = 'quarkpt'
name = 'Peter Tenenbaum'
email = '[email protected]'
}
developer {
id = 'wohler'
name = 'Bill Wohler'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:https://github.com/nasa/ziggy.git'
developerConnection = 'scm:git:[email protected]:nasa/ziggy.git'
url = 'https://github.com/nasa/ziggy'
}
}
}
}
}

apply from: "script-plugins/hdf5.gradle"
apply from: "script-plugins/wrapper.gradle"
repositories {
maven {
name = 'ziggyBuildSrc'
url = layout.buildDirectory.dir("repository")
}
}
}

build.dependsOn publish
1 change: 1 addition & 0 deletions buildSrc/gradle.properties
Loading

0 comments on commit 59aca2a

Please sign in to comment.