diff --git a/.editorconfig b/.editorconfig index 78f4eb4b0..61dca52fd 100644 --- a/.editorconfig +++ b/.editorconfig @@ -28,7 +28,7 @@ trim_trailing_whitespace = true end_of_line = crlf trim_trailing_whitespace = false -[*.{gradle,yml}] +[*.{g,gradle,json,xml,xsd,yml}] indent_size = 2 [metafacture-io/src/test/resources/org/metafacture/io/compressed.txt] diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5d637a7fb..24551cef0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,7 +12,7 @@ jobs: with: java-version: 1.8 - name: Publish package - run: ./gradlew publish + run: ./gradlew publishAllPublicationsToGitHubPackagesRepository env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 828e6a7b7..a3d6f2425 100644 --- a/.gitignore +++ b/.gitignore @@ -32,7 +32,6 @@ tmp .classpath .project .settings/ -bin/ # Ignore IntelliJ project files: *.ipr diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3122987cf..2676b1423 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -180,43 +180,43 @@ We use semantic versioning in release numbers `A`.`B`.`C`, i.e. increase `A` whe The following commands trigger a release build. 1. Create a signed tag: - ``` - git tag -s metafacture-core-A.B.C - ``` + ``` + git tag -s metafacture-core-A.B.C + ``` 1. When prompted, add a sensible commit message. For instance, something like: - ``` - Publish first release of the Metafacture A line - ``` + ``` + Publish first release of the Metafacture A line + ``` 1. You can now test the build locally by invoking: - ``` - ./gradlew assemble - ``` + ``` + ./gradlew assemble + ``` 1. Finally, push the new tag to GitHub to trigger the actual release build: - ``` - git push --follow-tags metafacture-core-A.B.C - ``` + ``` + git push --follow-tags metafacture-core-A.B.C + ``` #### Publish to Maven Central Upload archives to sonatype (where they can be released to Maven Central) 1. Make sure to have a clean directory (otherwise only a SNAPSHOT will be built): - ``` - git status - ``` + ``` + git status + ``` 1. You need a `gradle.properties` in the root directory that looks like this: - ``` - signing.gnupg.executable=gpg - signing.gnupg.useLegacyGpg=true - signing.gnupg.homeDir=$e.g."~/.gnupg" - signing.gnupg.keyName=$yourKeyName - signing.gnupg.passphrase=$keysPassphrase - releaseRepositoryUrl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ - releaseRepositoryUser=$yourSonatypeUsername - releaseRepositoryPassword=$yourSonatypePassword - ``` + ``` + signing.gnupg.executable=gpg + signing.gnupg.useLegacyGpg=true + signing.gnupg.homeDir=$e.g."~/.gnupg" + signing.gnupg.keyName=$yourKeyName + signing.gnupg.passphrase=$keysPassphrase + releaseRepositoryUrl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ + releaseRepositoryUser=$yourSonatypeUsername + releaseRepositoryPassword=$yourSonatypePassword + ``` 1. Let the release be built, signed and uploaded: - ``` - ./gradlew uploadArchives - ``` + ``` + ./gradlew publishAllPublicationsToMavenRepository + ``` 1. Finally, go to oss.sonatype.org , check the `Staging Repositories` when it's finished, and release it by clicking `close` diff --git a/README.md b/README.md index e60455136..68ed9c645 100644 --- a/README.md +++ b/README.md @@ -17,23 +17,32 @@ You can either use Metafacture as a stand-alone application or include it as a J ## Metafacture as a stand-alone application If you are only interested in running Flux scripts without doing any Java programming this is the way to go. The instructions assume that you are using a \*nix-like shell. [See more information in the wiki page about Flux](https://github.com/metafacture/metafacture-core/wiki/Flux-user-guide). +You can `build` the stand-alone application yourself or `download` it. -1. Download the latest distribution package from the [release page](https://github.com/metafacture/metafacture-core/releases). Make sure that you do download a distribution package and *not* a source code package (the file name should include `*-dist*`). - -2. Extract the downloaded archive: - ```bash - $ tar xzf metafacture-core-$VERSION-dist.tar.gz - ``` - This will create a new directory containing a ready-to-use Metafacture distribution. -3. Change into the newly created directory: - ```bash - $ cd metafacture-core-$VERSION - ``` -4. Run one of the example scripts: - ```bash - $ ./flux.sh examples/read/marc21/read-marc21.flux - ``` - This example will print a number of MARC 21 records on standard output. +a) Build + +Proceed as described in [Building metafacture-core from source](#build_from_source). + +b) Download + +Download the latest distribution package from the [release page](https://github.com/metafacture/metafacture-core/releases). Make sure that you do download a distribution package and *not* a source code package (the file name should include `*-dist*`). + +Regardless if you've built or downloaded, go on with: + +1. Extract the archive: + ```bash + $ tar xzf metafacture-core-$VERSION-dist.tar.gz + ``` + This will create a new directory containing a ready-to-use Metafacture distribution. +2. Change into the newly created directory: + ```bash + $ cd metafacture-core-$VERSION + ``` +3. Run one of the example scripts: + ```bash + $ ./flux.sh examples/read/marc21/read-marc21.flux + ``` + This example will print a number of MARC 21 records on standard output. The `examples` folder contains many more examples which provide a good starting point for learning Metafacture. If you have any questions please join our [mailing list](http://lists.dnb.de/mailman/listinfo/metafacture) or use our issue-based discussion forum over at [metafacture-documentation](https://github.com/metafacture/metafacture-documentation). @@ -66,25 +75,27 @@ Occasionally, we publish snapshot builds on [Sonatype OSS Repository](https://os TODO: Link to getting started tutorial --> + + # Building metafacture-core from source Building metafacture-core from source is easy. All you need is git and JDK 8: 1. Clone the metafacture-core repository and change into the directory: - -```bash -$ git clone https://github.com/metafacture/metafacture-core.git -$ cd metafacture-core -``` - -2. Invoke the Gradle wrapper to download Gradle and build metafacture-core (on Windows call `gradlew.bat install` instead): - -```bash -$ ./gradlew install -``` - -Besides the resulting distribution in `metafacture-core/metafacture-runner/build/distributions/` this also provides builds in your local maven repository. - + ```bash + $ git clone https://github.com/metafacture/metafacture-core.git + $ cd metafacture-core + ``` + +2. Invoke the Gradle wrapper to download Gradle and build metafacture-core (on Windows call `gradlew.bat publishToMavenLocal` instead) and publish these to your local Maven repository: + ```bash + $ ./gradlew publishToMavenLocal + ``` + +3. Create a distribution if you need one. The resulting distribution can be found in `metafacture-core/metafacture-runner/build/distributions/`: + ```bash + $ ./gradlew assembleDist + ``` See [Code Quality and Style](https://github.com/metafacture/metafacture-core/wiki/Code-Quality-and-Style) on the wiki for further information on the sources. diff --git a/build.gradle b/build.gradle index 3974979bd..8a2230835 100644 --- a/build.gradle +++ b/build.gradle @@ -18,9 +18,9 @@ import java.util.regex.Matcher plugins { id 'org.ajoberstar.grgit' version '2.3.0' - id 'org.ec4j.editorconfig' version '0.0.3' + //id 'org.ec4j.editorconfig' version '0.0.3' id 'org.sonarqube' version '2.6.2' - id 'io.codearte.nexus-staging' version '0.11.0' + id 'io.github.gradle-nexus.publish-plugin' version '1.3.0' } subprojects { @@ -30,6 +30,7 @@ subprojects { 'commons_compress': '1.21', 'guava': '29.0-jre', 'jackson_databind': '2.15.1', + 'jdk': '8', 'junit': '4.12', 'mockito': '2.27.0', 'slf4j': '1.7.36', @@ -54,92 +55,45 @@ project(':metafacture-runner') { apply plugin: 'java' } -editorconfig { - excludes = [ - '**/*.beacon', - '**/*.bgzf', - '**/*.bz2', - '**/*.bzip2', - '**/*.gzip', - '**/*.xz', - '**/.*', - '**/bin', - 'gradlew*' - ] -} - -def mavenProjectDescription = { proj -> - { it -> - name = proj.mavenName ?: proj.name - if (proj.description) { - description = proj.description - } - url = 'https://github.com/metafacture/metafacture-core' - inceptionYear = '2011' - developers { - developer { - id = 'mgeipel' - name = 'Markus M. Geipel' - email = 'm.geipel@dnb.de' - url = 'https://github.com/mgeipel' - roles = ['architect', 'developer'] - } - developer { - id = 'cboehme' - name = 'Christoph Böhme' - email = 'c.boehme@dnb.de' - url = 'https://github.com/cboehme' - roles = ['architect', 'developer'] - } - } - organization { - name = 'Metafacture' - url = 'https://github.com/metafacture' - } - licenses { - license { - name = 'The Apache License, Version 2.0' - url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' - } - } - mailingLists { - mailingList { - name = 'Metafacture Mailing List' - post = 'metafacture@lists.dnb.de' - subscribe = 'metafacture-subscribe@lists.dnb.de' - unsubscribe = 'metafacture-unsubscribe@lists.dnb.de' - archive = 'http://lists.dnb.de/pipermail/metafacture/' - } - } - scm { - connection = 'scm:git:https://github.com/metafacture/metafacture-core.git' - developerConnection = 'scm:git:https://github.com/metafacture/metafacture-core.git' - url = 'https://github.com/metafacture/metafacture-core' - tag = rootProject.scmInfo.tag ?: 'HEAD' - } - issueManagement { - system = 'Github' - url = 'https://github.com/metafacture/metafacture-core/issues' - } - ciManagement { - system = 'Github Actions' - url = 'https://github.com/metafacture/metafacture-core/actions' - } - } +//editorconfig { +// excludes = [ +// '**/*.beacon', +// '**/*.bgzf', +// '**/*.bz2', +// '**/*.bzip2', +// '**/*.gzip', +// '**/*.xz', +// '**/.*', +// '**/bin', +// 'gradlew*' +// ] +//} + +task editorconfigChecker(type: Exec, group: 'Verification') { + executable 'misc/bin/editorconfig-checker' + args('-exclude', '/\\.|/bin/|\\.beacon$|\\.txt\\.|^LICENSE$|^\\.project$|^gradlew.*') } subprojects { apply plugin: 'signing' - apply plugin: 'maven' apply plugin: 'jacoco' apply plugin: 'checkstyle' apply plugin: 'maven-publish' - check.dependsOn(editorconfigCheck) + check.dependsOn(editorconfigChecker) check.dependsOn(javadoc) - sourceCompatibility = 1.8 - targetCompatibility = 1.8 + java { + toolchain { + languageVersion = JavaLanguageVersion.of(versions.jdk) + } + } + + tasks.withType(JavaExec) { + javaLauncher = javaToolchains.launcherFor { + languageVersion = java.toolchain.languageVersion + } + } tasks.withType(JavaCompile) { 'all -processing -rawtypes -serial'.split().each { @@ -153,7 +107,7 @@ subprojects { task sourceJar(type: Jar) { dependsOn tasks.classes from sourceSets.main.allJava - classifier 'sources' + archiveClassifier = 'sources' description 'Creates a jar containing the source files of this project.' group 'build' } @@ -161,7 +115,7 @@ subprojects { task javadocJar(type: Jar) { dependsOn tasks.javadoc from tasks.javadoc - classifier 'javadoc' + archiveClassifier = 'javadoc' description 'Creates a jar containing the javadoc of this project.' group 'build' } @@ -174,11 +128,6 @@ subprojects { } } - artifacts { - archives sourceJar - archives javadocJar - } - checkstyle { toolVersion '8.30' checkstyleTest.enabled = false @@ -193,13 +142,6 @@ subprojects { } } - signing { - required { - scmInfo.isRelease() && gradle.taskGraph.hasTask(tasks.uploadArchives) - } - sign configurations.archives - } - repositories { mavenLocal() mavenCentral() @@ -209,21 +151,72 @@ subprojects { publications { mavenArtifacts(MavenPublication) { from components.java + afterEvaluate { - pom mavenProjectDescription(project) groupId = project.group artifactId = project.name + + pom { + name = project.mavenName ?: project.name + description = project.description ?: project.name + url = 'https://github.com/metafacture/metafacture-core' + inceptionYear = '2011' + developers { + developer { + id = 'mgeipel' + name = 'Markus M. Geipel' + email = 'm.geipel@dnb.de' + url = 'https://github.com/mgeipel' + roles = ['architect', 'developer'] + } + developer { + id = 'cboehme' + name = 'Christoph Böhme' + email = 'c.boehme@dnb.de' + url = 'https://github.com/cboehme' + roles = ['architect', 'developer'] + } + } + organization { + name = 'Metafacture' + url = 'https://github.com/metafacture' + } + licenses { + license { + name = 'The Apache License, Version 2.0' + url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' + } + } + mailingLists { + mailingList { + name = 'Metafacture Mailing List' + post = 'metafacture@lists.dnb.de' + subscribe = 'metafacture-subscribe@lists.dnb.de' + unsubscribe = 'metafacture-unsubscribe@lists.dnb.de' + archive = 'http://lists.dnb.de/pipermail/metafacture/' + } + } + scm { + connection = 'scm:git:https://github.com/metafacture/metafacture-core.git' + developerConnection = 'scm:git:https://github.com/metafacture/metafacture-core.git' + url = 'https://github.com/metafacture/metafacture-core' + tag = rootProject.scmInfo.tag ?: 'HEAD' + } + issueManagement { + system = 'Github' + url = 'https://github.com/metafacture/metafacture-core/issues' + } + ciManagement { + system = 'Github Actions' + url = 'https://github.com/metafacture/metafacture-core/actions' + } + } + artifact(sourceJar) + artifact(javadocJar) } } } repositories { - maven { - name = 'localEmbedded' - // run generated gradle task `./gradlew - // publishMavenArtifactsPublicationToLocalEmbeddedRepository` - // to publish all subprojects into the same local embedded repo: - url = "file://${rootDir}/build/repo" - } maven { name = "GitHubPackages" url = "https://maven.pkg.github.com/metafacture/metafacture-core" @@ -232,58 +225,28 @@ subprojects { password = System.getenv("GITHUB_TOKEN") } } - } - } -} - -gradle.projectsEvaluated { - subprojects { - configurations { - mavenDeploySupport - } - - dependencies { - mavenDeploySupport "org.apache.maven.wagon:wagon-http:2.2" - } - - install { - repositories { - mavenInstaller { - pom.project mavenProjectDescription(project) - beforeDeployment { - MavenDeployment deployment -> signing.signPom(deployment) + if (scmInfo.isRelease() && project.hasProperty('releaseRepositoryUrl')) { + maven { + url = releaseRepositoryUrl + credentials { + username = releaseRepositoryUser + password = releaseRepositoryPassword } } } } + } - uploadArchives { - repositories { - mavenDeployer { - configuration = configurations.mavenDeploySupport - if (project.hasProperty('releaseRepositoryUrl')) { - repository(url: releaseRepositoryUrl) { - if (project.hasProperty('releaseRepositoryUser')) { - authentication(userName: releaseRepositoryUser, - password: releaseRepositoryPassword) - } - } - } - if (project.hasProperty('snapshotRepositoryUrl')) { - snapshotRepository(url: snapshotRepositoryUrl) { - if (project.hasProperty('snapshotRepositoryUser')) { - authentication(userName: snapshotRepositoryUser, - password: snapshotRepositoryPassword) - } - } - } - pom.project mavenProjectDescription(project) - beforeDeployment { - MavenDeployment deployment -> signing.signPom(deployment) - } - } - } + signing { + required { + scmInfo.isRelease() } + sign publishing.publications.mavenArtifacts + } + + task install(dependsOn: publishToMavenLocal, + description: "Installs the 'archives' artifacts into the local Maven repository. [deprecated]") { + doFirst { println "This task is deprecated; use 'publishToMavenLocal' instead." } } } @@ -293,24 +256,12 @@ sonarqube { } } -nexusStaging { - if (project.hasProperty('stagingServerUrl')) { - serverUrl = stagingServerUrl - } - if (project.hasProperty('releaseRepositoryUser')) { - username = releaseRepositoryUser - password = releaseRepositoryPassword +nexusPublishing { + repositories { + sonatype () } } -tasks.closeRepository.onlyIf { - rootProject.scmInfo.isRelease() -} - -tasks.releaseRepository.onlyIf { - rootProject.scmInfo.isRelease() -} - class ScmInfo { def version def tag diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 08f193ea6..afba10928 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 095a39421..f7c42a51b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ -#Sun Jul 30 20:26:57 CEST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionSha256Sum=9631d53cf3e74bfa726893aee1f8994fee4e060c401335946dba2156f440f24c +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip +networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-all.zip diff --git a/gradlew b/gradlew index cccdd3d51..65dcd68d6 100755 --- a/gradlew +++ b/gradlew @@ -1,78 +1,129 @@ -#!/usr/bin/env sh +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# 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. +# ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -81,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" + 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. Please set the JAVA_HOME variable in your environment to match the @@ -89,84 +140,105 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=$((i+1)) + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg 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" ;; - esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -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")" +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" fi +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index f9553162f..93e3f59f1 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,4 +1,20 @@ -@if "%DEBUG%" == "" @echo off +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -9,19 +25,23 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -35,7 +55,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -45,38 +65,26 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaMultiscriptRemodeler.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaMultiscriptRemodeler.java index 3551105f0..9aa4a411f 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaMultiscriptRemodeler.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaMultiscriptRemodeler.java @@ -226,8 +226,7 @@ private void emitAsSingleMultiscriptFields(final Map fields) { private String mapScriptToEntityName(final String script) { return LATIN_SCRIPT.equals(script) ? ENTITY_NAME_FOR_LATIN : - (ARABIC_SCRIPT.equals(script) || HEBREW_SCRIPT.equals(script)) ? ENTITY_NAME_FOR_NON_LATIN_RL : - ENTITY_NAME_FOR_NON_LATIN_LR; + (ARABIC_SCRIPT.equals(script) || HEBREW_SCRIPT.equals(script)) ? ENTITY_NAME_FOR_NON_LATIN_RL : ENTITY_NAME_FOR_NON_LATIN_LR; } private static class BufferedField { diff --git a/metafacture-csv/src/main/java/org/metafacture/csv/CsvEncoder.java b/metafacture-csv/src/main/java/org/metafacture/csv/CsvEncoder.java index 3723493db..6bf8f3c34 100644 --- a/metafacture-csv/src/main/java/org/metafacture/csv/CsvEncoder.java +++ b/metafacture-csv/src/main/java/org/metafacture/csv/CsvEncoder.java @@ -138,9 +138,7 @@ public void setNoQuotes(final boolean noQuotes) { private void initialize() { writer = new StringWriter(); final String emptyLineEnd = ""; - csvWriter = new CSVWriter(writer, separator, - noQuotes ? CSVWriter.NO_QUOTE_CHARACTER : CSVWriter.DEFAULT_QUOTE_CHARACTER, - CSVWriter.DEFAULT_ESCAPE_CHARACTER, emptyLineEnd); + csvWriter = new CSVWriter(writer, separator, noQuotes ? CSVWriter.NO_QUOTE_CHARACTER : CSVWriter.DEFAULT_QUOTE_CHARACTER, CSVWriter.DEFAULT_ESCAPE_CHARACTER, emptyLineEnd); } private String[] arrayOf(final List list) { diff --git a/metafacture-flowcontrol/src/test/java/org/metafacture/flowcontrol/ObjectThreaderTest.java b/metafacture-flowcontrol/src/test/java/org/metafacture/flowcontrol/ObjectThreaderTest.java index ae88b18a1..fc7c32b4f 100644 --- a/metafacture-flowcontrol/src/test/java/org/metafacture/flowcontrol/ObjectThreaderTest.java +++ b/metafacture-flowcontrol/src/test/java/org/metafacture/flowcontrol/ObjectThreaderTest.java @@ -39,39 +39,39 @@ */ public final class ObjectThreaderTest { - @Mock - private ObjectReceiver receiverThread1; - @Mock - private ObjectReceiver receiverThread2; + @Mock + private ObjectReceiver receiverThread1; + @Mock + private ObjectReceiver receiverThread2; - private final ObjectThreader objectThreader = new ObjectThreader<>(); - private static final int ACTIVE_THREADS_AT_BEGINNING = Thread.getAllStackTraces().keySet().size(); + private final ObjectThreader objectThreader = new ObjectThreader<>(); + private static final int ACTIVE_THREADS_AT_BEGINNING = Thread.getAllStackTraces().keySet().size(); - @Before - public void setup() { - MockitoAnnotations.initMocks(this); - objectThreader// - .addReceiver(receiverThread1)// - .addReceiver(receiverThread2); - } + @Before + public void setup() { + MockitoAnnotations.initMocks(this); + objectThreader// + .addReceiver(receiverThread1)// + .addReceiver(receiverThread2); + } - @Test - public void shouldSplitAllObjectsToAllThreadedDownStreamReceivers() throws InterruptedException { - objectThreader.process("a"); - objectThreader.process("b"); - objectThreader.process("a"); - objectThreader.process("c"); - // check if two more threads were indeed created - assertThat(Thread.getAllStackTraces().keySet().size() - ACTIVE_THREADS_AT_BEGINNING).isEqualTo(2); - objectThreader.closeStream(); - // verify thread 1 - verify(receiverThread1, atLeast(2)).process("a"); - verify(receiverThread1, atMost(0)).process("b"); - verify(receiverThread1, atMost(0)).process("c"); - // verify thread 2 - verify(receiverThread2, atMost(0)).process("a"); - verify(receiverThread2, atLeast(1)).process("b"); - verify(receiverThread2, atLeast(1)).process("c"); - } + @Test + public void shouldSplitAllObjectsToAllThreadedDownStreamReceivers() throws InterruptedException { + objectThreader.process("a"); + objectThreader.process("b"); + objectThreader.process("a"); + objectThreader.process("c"); + // check if two more threads were indeed created + assertThat(Thread.getAllStackTraces().keySet().size() - ACTIVE_THREADS_AT_BEGINNING).isEqualTo(2); + objectThreader.closeStream(); + // verify thread 1 + verify(receiverThread1, atLeast(2)).process("a"); + verify(receiverThread1, atMost(0)).process("b"); + verify(receiverThread1, atMost(0)).process("c"); + // verify thread 2 + verify(receiverThread2, atMost(0)).process("a"); + verify(receiverThread2, atLeast(1)).process("b"); + verify(receiverThread2, atLeast(1)).process("c"); + } } diff --git a/metafacture-flux/build.gradle b/metafacture-flux/build.gradle index ca94bff8c..436f47a78 100644 --- a/metafacture-flux/build.gradle +++ b/metafacture-flux/build.gradle @@ -23,7 +23,7 @@ dependencies { api project(':metafacture-framework') implementation project(':metafacture-commons') implementation project(':metafacture-io') - testRuntime project(':metafacture-plumbing') + testRuntimeOnly project(':metafacture-plumbing') antlr 'org.antlr:antlr:3.5.2' testImplementation "junit:junit:${versions.junit}" } diff --git a/metafacture-flux/src/main/antlr/org/metafacture/flux/parser/FlowBuilder.g b/metafacture-flux/src/main/antlr/org/metafacture/flux/parser/FlowBuilder.g index 3cd54b429..cfad0d2a6 100644 --- a/metafacture-flux/src/main/antlr/org/metafacture/flux/parser/FlowBuilder.g +++ b/metafacture-flux/src/main/antlr/org/metafacture/flux/parser/FlowBuilder.g @@ -48,12 +48,12 @@ flux returns [FluxProgramm retValue = flux] ( flow { - flux.nextFlow(); + flux.nextFlow(); } )* { - flux.compile(); + flux.compile(); } ; @@ -61,24 +61,24 @@ flow : ( StdIn - { - flux.setStdInStart(); - } + { + flux.setStdInStart(); + } | e=exp - { + { flux.setStringStart($e.value); - } + } | ws=Wormhole - { - flux.setWormholeStart($ws.text); - } + { + flux.setWormholeStart($ws.text); + } ) flowtail ( we=Wormhole - { - flux.setWormholeEnd($we.text); - } + { + flux.setWormholeEnd($we.text); + } )? ; @@ -92,15 +92,15 @@ varDef ^(ASSIGN name=Identifier e=exp?) { - vars.put($name.text, $e.value); + vars.put($name.text, $e.value); } | ^(DEFAULT name=Identifier e=exp?) { - if (!vars.containsKey($name.text)) { - vars.put($name.text, $e.value); - } + if (!vars.containsKey($name.text)) { + vars.put($name.text, $e.value); + } } ; @@ -108,23 +108,23 @@ tee : ^( TEE - { + { flux.startTee(); //System.out.println("start tee"); - } + } ( ^(SUBFLOW flowtail) { - flux.endSubFlow(); - // System.out.println("end subflow"); + flux.endSubFlow(); + // System.out.println("end subflow"); } )+ - ) + ) { - flux.endTee(); - //System.out.println("end tee"); + flux.endTee(); + //System.out.println("end tee"); } ; @@ -139,21 +139,21 @@ flowtail exp returns [String value] : s=StringLiteral - { + { $value = $s.text; - } + } | id=Identifier - { + { $value = vars.get($id.text); if ($value == null) { throw new FluxParseException("Variable " + $id.text + " not assigned."); } - } + } | ^('+' e1=exp e2=exp) { - $value = $e1.value + $e2.value; + $value = $e1.value + $e2.value; } ; @@ -167,26 +167,26 @@ final List cArgs = new ArrayList(); name=QualifiedName ( e=exp - { + { cArgs.add($e.value); - } + } )? ( VarRef - { - cArgs.add(Collections.unmodifiableMap(vars)); - } + { + cArgs.add(Collections.unmodifiableMap(vars)); + } )? ( a=arg - { + { namedArgs.put($a.key, $a.value); - } + } )* - ) + ) { - flux.addElement($name.text, namedArgs, cArgs); + flux.addElement($name.text, namedArgs, cArgs); } ; @@ -195,7 +195,7 @@ arg returns [String key, String value] ^(ARG k=Identifier e=exp) { - $key = $k.text; - $value = $e.value; + $key = $k.text; + $value = $e.value; } ; diff --git a/metafacture-flux/src/main/antlr/org/metafacture/flux/parser/Flux.g b/metafacture-flux/src/main/antlr/org/metafacture/flux/parser/Flux.g index 643a70090..0ef93d629 100644 --- a/metafacture-flux/src/main/antlr/org/metafacture/flux/parser/Flux.g +++ b/metafacture-flux/src/main/antlr/org/metafacture/flux/parser/Flux.g @@ -114,7 +114,7 @@ tee ^( TEE ^(SUBFLOW flowtail)+ - ) + ) ; catch [RecognitionException re] { throw re; @@ -207,9 +207,9 @@ Identifier Wormhole : '@' id=Identifier - { + { setText(id.getText()); - } + } ; StringLiteral @@ -255,9 +255,9 @@ OctalEscape[StringBuilder stringBuilder] | digit3=OctalDigit ) { String octalString = - ( digit1 != null ? digit1.getText() : "") + - ( digit2 != null ? digit2.getText() : "") + - digit3.getText(); + ( digit1 != null ? digit1.getText() : "") + + ( digit2 != null ? digit2.getText() : "") + + digit3.getText(); stringBuilder.appendCodePoint(Integer.valueOf(octalString, 8)); } ; @@ -320,7 +320,7 @@ LINE_COMMENT ~( '\n' | '\r' - )* + )* ( '\r'? '\n' | EOF @@ -342,6 +342,6 @@ WS ) { - $channel = HIDDEN; + $channel = HIDDEN; } ; diff --git a/metafacture-flux/src/test/java/org/metafacture/flux/FluxGrammarTest.java b/metafacture-flux/src/test/java/org/metafacture/flux/FluxGrammarTest.java index 297e79653..58713cf1a 100644 --- a/metafacture-flux/src/test/java/org/metafacture/flux/FluxGrammarTest.java +++ b/metafacture-flux/src/test/java/org/metafacture/flux/FluxGrammarTest.java @@ -121,7 +121,7 @@ public void issue421_shouldThrowReflectionExceptionWhenCommandIsNotFound() try { FluxCompiler.compile(createInputStream(script), emptyMap()); } catch (ReflectionException re) { - assertEquals("Class not found: prin", re.getMessage()); + assertEquals("Class not found: prin", re.getMessage()); throw re; } } diff --git a/metafacture-formeta/src/test/java/org/metafacture/formeta/parser/FormetaParserTest.java b/metafacture-formeta/src/test/java/org/metafacture/formeta/parser/FormetaParserTest.java index 6bf5cf3b8..290b5ca09 100644 --- a/metafacture-formeta/src/test/java/org/metafacture/formeta/parser/FormetaParserTest.java +++ b/metafacture-formeta/src/test/java/org/metafacture/formeta/parser/FormetaParserTest.java @@ -64,10 +64,10 @@ public final class FormetaParserTest { "}"; private static final String PARTIAL_RECORD = - "lit1: 'value 1', ' ent1'{ lit2: 'value {x}', 'lit\\\\3': 'value 2 ' }, lit4: 'value \\'3\\'' "; + "lit1: 'value 1', ' ent1'{ lit2: 'value {x}', 'lit\\\\3': 'value 2 ' }, lit4: 'value \\'3\\'' "; private static final String BROKEN_PARTIAL_RECORD = - "lit1: 'value 1', ' ent1'{ lit2: 'value {x}'"; + "lit1: 'value 1', ' ent1'{ lit2: 'value {x}'"; private FormetaParser parser; diff --git a/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordPathFilter.java b/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordPathFilter.java index b1881def1..5d1db73cd 100644 --- a/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordPathFilter.java +++ b/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordPathFilter.java @@ -24,7 +24,7 @@ import org.metafacture.framework.helpers.DefaultStreamPipe; /** - Splits a stream into records based on entity path. + * Splits a stream into records based on entity path. */ @Description("Splits a stream into records based on entity path") @In(StreamReceiver.class) diff --git a/metafacture-runner/build.gradle b/metafacture-runner/build.gradle index a3b1efc83..7925b5ff3 100644 --- a/metafacture-runner/build.gradle +++ b/metafacture-runner/build.gradle @@ -19,6 +19,7 @@ ext.mavenName = 'Metafacture Runner' description = 'CLI application for data processing with Flux and Metamorph' apply plugin: 'distribution' +apply plugin: 'signing' configurations { plugins { @@ -27,6 +28,9 @@ configurations { provided { description = 'provided libraries' } + + // The plugins configuration needs to be on the runtime classpath: + runtimeClasspath.extendsFrom plugins } dependencies { @@ -58,9 +62,6 @@ dependencies { plugins project(':metafacture-yaml') plugins project(':metamorph') - // The plugins configuration needs to be on the runtime classpath: - runtime configurations.plugins - // In a perfect world the slf4j binding would be a provided dependency so that // the user can replace it easily with a different binding. However, slf4j // does not use the context class loader for loading its binding but the same @@ -117,7 +118,7 @@ distributions { from configurations.provided } from('src/main/scripts') { - filter(ReplaceTokens, tokens: [jarfile: 'lib/' + jar.archiveName ]) + filter(ReplaceTokens, tokens: [jarfile: 'lib/' + jar.archiveFileName.get() ]) filteringCharset = 'UTF-8' fileMode = 0755 } @@ -140,26 +141,19 @@ def metamorph() { distTar { compression = Compression.GZIP - classifier = 'dist' + archiveClassifier = 'dist' archiveExtension = 'tar.gz' } -distZip { - classifier = 'dist' +signing { + sign configurations.archives } -// Fix for incomplete extensions on the signature file for the tar.gz archive. -// The signature file contains only the last file extension (gz). The tar-part -// is missing. This doLast action fixes this: -tasks.signArchives { - doLast { - signatures.matching({ it.type == 'gz.asc' }).all { - it.type = 'tar.gz.asc' - } - } +distZip { + archiveClassifier = 'dist' } task('fluxCommands', type: JavaExec, description: 'Print available Flux commands') { classpath = sourceSets.main.runtimeClasspath - main = 'org.metafacture.flux.HelpPrinter' + mainClass = 'org.metafacture.flux.HelpPrinter' } diff --git a/metafacture-runner/src/main/dist/examples/morph/pica-to-marcxml/morph-pica-to-marcxml.xml b/metafacture-runner/src/main/dist/examples/morph/pica-to-marcxml/morph-pica-to-marcxml.xml index 2d4e44025..31fb6bdc1 100644 --- a/metafacture-runner/src/main/dist/examples/morph/pica-to-marcxml/morph-pica-to-marcxml.xml +++ b/metafacture-runner/src/main/dist/examples/morph/pica-to-marcxml/morph-pica-to-marcxml.xml @@ -1,6 +1,5 @@ - + @@ -17,8 +16,7 @@ - + diff --git a/metafacture-runner/src/main/scripts/flux.sh b/metafacture-runner/src/main/scripts/flux.sh index 71d4f6cad..9555b1a00 100755 --- a/metafacture-runner/src/main/scripts/flux.sh +++ b/metafacture-runner/src/main/scripts/flux.sh @@ -95,14 +95,14 @@ fi # script terminates at the first line which appears not to be # a variable definition: vars_to_script=$( cat <<'EOF' - s/^[^=]*$//g ; # is this not a variable definition? - # then jump to quit + s/^[^=]*$//g ; # is this not a variable definition? + # then jump to quit t quit - s/\\/\\\\/g ; # otherwise escape backslashes, - s/!/\\!/g ; # escape exclamation marks, - s/='(.*)'$/=\1/ ; # remove quotes, - s/^([^=]+)=(.*)$/s!\\$\1!\2!g ; /g ; # convert to sed regexp command - # and continue with next line + s/\\/\\\\/g ; # otherwise escape backslashes, + s/!/\\!/g ; # escape exclamation marks, + s/='(.*)'$/=\1/ ; # remove quotes, + s/^([^=]+)=(.*)$/s!\\$\1!\2!g ; /g ; # convert to sed regexp command + # and continue with next line b : quit q diff --git a/metafacture-strings/src/main/java/org/metafacture/strings/StreamUnicodeNormalizer.java b/metafacture-strings/src/main/java/org/metafacture/strings/StreamUnicodeNormalizer.java index b015fb071..f129013be 100644 --- a/metafacture-strings/src/main/java/org/metafacture/strings/StreamUnicodeNormalizer.java +++ b/metafacture-strings/src/main/java/org/metafacture/strings/StreamUnicodeNormalizer.java @@ -31,7 +31,7 @@ * characters and composed characters. There are four different forms of * conversion which can be selected using * {@link #setNormalizationForm(Normalizer.Form)}. -

+ *

* In the default configuration only literal values are * converted. The {@link #setNormalizeIds(boolean)}, * {@link #setNormalizeKeys(boolean)} and {@link #setNormalizeValues(boolean)} diff --git a/metafacture-triples/src/main/java/org/metafacture/triples/StreamToTriples.java b/metafacture-triples/src/main/java/org/metafacture/triples/StreamToTriples.java index 6eee82a98..671a07716 100644 --- a/metafacture-triples/src/main/java/org/metafacture/triples/StreamToTriples.java +++ b/metafacture-triples/src/main/java/org/metafacture/triples/StreamToTriples.java @@ -53,16 +53,16 @@ * */ @Description("Emits the literals which are received as triples such " + - "that the name and value become the predicate and the object " + - "of the triple. The record id containing the literal becomes " + - "the subject. " + - "If 'redirect' is true, the value of the subject is determined " + - "by using either the value of a literal named '_id', or for " + - "individual literals by prefixing their name with '{to:ID}'. " + - "Set 'recordPredicate' to encode a complete record in one triple. " + - "The value of 'recordPredicate' is used as the predicate of the " + - "triple. If 'recordPredicate' is set, no {to:ID}NAME-style " + - "redirects are possible.") + "that the name and value become the predicate and the object " + + "of the triple. The record id containing the literal becomes " + + "the subject. " + + "If 'redirect' is true, the value of the subject is determined " + + "by using either the value of a literal named '_id', or for " + + "individual literals by prefixing their name with '{to:ID}'. " + + "Set 'recordPredicate' to encode a complete record in one triple. " + + "The value of 'recordPredicate' is used as the predicate of the " + + "triple. If 'recordPredicate' is set, no {to:ID}NAME-style " + + "redirects are possible.") @In(StreamReceiver.class) @Out(Triple.class) @FluxCommand("stream-to-triples") diff --git a/metafacture-triples/src/test/java/org/metafacture/triples/AbstractTripleSortTest.java b/metafacture-triples/src/test/java/org/metafacture/triples/AbstractTripleSortTest.java index f361b326a..df815e546 100644 --- a/metafacture-triples/src/test/java/org/metafacture/triples/AbstractTripleSortTest.java +++ b/metafacture-triples/src/test/java/org/metafacture/triples/AbstractTripleSortTest.java @@ -30,7 +30,7 @@ * * @author Christoph Böhme */ - public final class AbstractTripleSortTest { +public final class AbstractTripleSortTest { private static final Triple T1 = new Triple("s", "p", "o"); diff --git a/metamorph-test/src/main/resources/schemata/XInclude.xsd b/metamorph-test/src/main/resources/schemata/XInclude.xsd index d9f3bb0b7..949c5f906 100644 --- a/metamorph-test/src/main/resources/schemata/XInclude.xsd +++ b/metamorph-test/src/main/resources/schemata/XInclude.xsd @@ -1,10 +1,10 @@ - + Not normative, but may be useful. See the REC http://www.w3.org/TR/XInclude for definitive information about this namespace. - + diff --git a/metamorph-test/src/main/resources/schemata/xml.xsd b/metamorph-test/src/main/resources/schemata/xml.xsd index 3cd228d83..3ba1bb873 100644 --- a/metamorph-test/src/main/resources/schemata/xml.xsd +++ b/metamorph-test/src/main/resources/schemata/xml.xsd @@ -1,10 +1,10 @@ - + - See http://www.w3.org/XML/1998/namespace.html and - http://www.w3.org/TR/REC-xml for information about this namespace. + See http://www.w3.org/XML/1998/namespace.html and + http://www.w3.org/TR/REC-xml for information about this namespace. This schema document describes the XML namespace, in a form suitable for import by other schema documents. @@ -15,43 +15,43 @@ not be used with conflicting semantics by any Working Group, specification, or document instance: - base (as an attribute name): denotes an attribute whose value - provides a URI to be used as the base for interpreting any - relative URIs in the scope of the element on which it - appears; its value is inherited. This name is reserved - by virtue of its definition in the XML Base specification. + base (as an attribute name): denotes an attribute whose value + provides a URI to be used as the base for interpreting any + relative URIs in the scope of the element on which it + appears; its value is inherited. This name is reserved + by virtue of its definition in the XML Base specification. - id (as an attribute name): denotes an attribute whose value - should be interpreted as if declared to be of type ID. - The xml:id specification is not yet a W3C Recommendation, - but this attribute is included here to facilitate experimentation - with the mechanisms it proposes. Note that it is _not_ included - in the specialAttrs attribute group. + id (as an attribute name): denotes an attribute whose value + should be interpreted as if declared to be of type ID. + The xml:id specification is not yet a W3C Recommendation, + but this attribute is included here to facilitate experimentation + with the mechanisms it proposes. Note that it is _not_ included + in the specialAttrs attribute group. - lang (as an attribute name): denotes an attribute whose value - is a language code for the natural language of the content of - any element; its value is inherited. This name is reserved - by virtue of its definition in the XML specification. + lang (as an attribute name): denotes an attribute whose value + is a language code for the natural language of the content of + any element; its value is inherited. This name is reserved + by virtue of its definition in the XML specification. space (as an attribute name): denotes an attribute whose - value is a keyword indicating what whitespace processing - discipline is intended for the content of the element; its - value is inherited. This name is reserved by virtue of its - definition in the XML specification. + value is a keyword indicating what whitespace processing + discipline is intended for the content of the element; its + value is inherited. This name is reserved by virtue of its + definition in the XML specification. Father (in any context at all): denotes Jon Bosak, the chair of - the original XML Working Group. This name is reserved by - the following decision of the W3C XML Plenary and - XML Coordination groups: - - In appreciation for his vision, leadership and dedication - the W3C XML Plenary on this 10th day of February, 2000 - reserves for Jon Bosak in perpetuity the XML name - xml:Father + the original XML Working Group. This name is reserved by + the following decision of the W3C XML Plenary and + XML Coordination groups: + + In appreciation for his vision, leadership and dedication + the W3C XML Plenary on this 10th day of February, 2000 + reserves for Jon Bosak in perpetuity the XML name + xml:Father - + - + This schema defines attributes and an attribute group suitable for use by schemas wishing to allow xml:base, xml:lang, xml:space or xml:id @@ -60,87 +60,87 @@ To enable this, such a schema must import this schema for the XML namespace, e.g. as follows: <schema . . .> - . . . - <import namespace="http://www.w3.org/XML/1998/namespace" + . . . + <import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2005/08/xml.xsd"/> Subsequently, qualified reference to any of the attributes or the group defined below will have the desired effect, e.g. <type . . .> - . . . - <attributeGroup ref="xml:specialAttrs"/> + . . . + <attributeGroup ref="xml:specialAttrs"/> - will define a type which will schema-validate an instance - element with any of those attributes - + will define a type which will schema-validate an instance + element with any of those attributes + - + In keeping with the XML Schema WG's standard versioning - policy, this schema document will persist at - http://www.w3.org/2005/08/xml.xsd. - At the date of issue it can also be found at - http://www.w3.org/2001/xml.xsd. - The schema document at that URI may however change in the future, - in order to remain compatible with the latest version of XML Schema - itself, or with the XML namespace itself. In other words, if the XML - Schema or XML namespaces change, the version of this document at - http://www.w3.org/2001/xml.xsd will change - accordingly; the version at - http://www.w3.org/2005/08/xml.xsd will not change. + policy, this schema document will persist at + http://www.w3.org/2005/08/xml.xsd. + At the date of issue it can also be found at + http://www.w3.org/2001/xml.xsd. + The schema document at that URI may however change in the future, + in order to remain compatible with the latest version of XML Schema + itself, or with the XML namespace itself. In other words, if the XML + Schema or XML namespaces change, the version of this document at + http://www.w3.org/2001/xml.xsd will change + accordingly; the version at + http://www.w3.org/2005/08/xml.xsd will not change. - + - + - Attempting to install the relevant ISO 2- and 3-letter - codes as the enumerated possible values is probably never - going to be a realistic possibility. See - RFC 3066 at http://www.ietf.org/rfc/rfc3066.txt and the IANA registry - at http://www.iana.org/assignments/lang-tag-apps.htm for - further information. - - The union allows for the 'un-declaration' of xml:lang with - the empty string. + Attempting to install the relevant ISO 2- and 3-letter + codes as the enumerated possible values is probably never + going to be a realistic possibility. See + RFC 3066 at http://www.ietf.org/rfc/rfc3066.txt and the IANA registry + at http://www.iana.org/assignments/lang-tag-apps.htm for + further information. + + The union allows for the 'un-declaration' of xml:lang with + the empty string. - - - - - - - + + + + + + + - + - + - - - - + + + + - + - + - See http://www.w3.org/TR/xmlbase/ for - information about this attribute. + See http://www.w3.org/TR/xmlbase/ for + information about this attribute. - + - + - See http://www.w3.org/TR/xml-id/ for - information about this attribute. + See http://www.w3.org/TR/xml-id/ for + information about this attribute. - + - + - + diff --git a/metamorph/build.gradle b/metamorph/build.gradle index 3a3e329bc..a49ce00c2 100644 --- a/metamorph/build.gradle +++ b/metamorph/build.gradle @@ -38,6 +38,6 @@ sourceSets { // for test TestMetamorphMacros#issue227_shouldSupportXincludeForMacros() // to work properly. A better solution would be to enable xinclude to load // resources from the classpath. - output.resourcesDir = sourceSets.test.java.outputDir + output.resourcesDir = sourceSets.test.java.classesDirectory } } diff --git a/metamorph/src/main/resources/schemata/XInclude.xsd b/metamorph/src/main/resources/schemata/XInclude.xsd index d9f3bb0b7..9b66d1f17 100644 --- a/metamorph/src/main/resources/schemata/XInclude.xsd +++ b/metamorph/src/main/resources/schemata/XInclude.xsd @@ -1,10 +1,10 @@ - - Not normative, but may be useful. - See the REC http://www.w3.org/TR/XInclude for definitive - information about this namespace. - + + Not normative, but may be useful. + See the REC http://www.w3.org/TR/XInclude for definitive + information about this namespace. + diff --git a/metamorph/src/main/resources/schemata/metamorph.xsd b/metamorph/src/main/resources/schemata/metamorph.xsd index e6b00b5c4..26dcdefc0 100644 --- a/metamorph/src/main/resources/schemata/metamorph.xsd +++ b/metamorph/src/main/resources/schemata/metamorph.xsd @@ -303,12 +303,9 @@ - - - + + + @@ -323,10 +320,8 @@ - - + + diff --git a/metamorph/src/main/resources/schemata/xml.xsd b/metamorph/src/main/resources/schemata/xml.xsd index 3cd228d83..ff54474c1 100644 --- a/metamorph/src/main/resources/schemata/xml.xsd +++ b/metamorph/src/main/resources/schemata/xml.xsd @@ -1,10 +1,10 @@ - + - See http://www.w3.org/XML/1998/namespace.html and - http://www.w3.org/TR/REC-xml for information about this namespace. + See http://www.w3.org/XML/1998/namespace.html and + http://www.w3.org/TR/REC-xml for information about this namespace. This schema document describes the XML namespace, in a form suitable for import by other schema documents. @@ -15,43 +15,43 @@ not be used with conflicting semantics by any Working Group, specification, or document instance: - base (as an attribute name): denotes an attribute whose value - provides a URI to be used as the base for interpreting any - relative URIs in the scope of the element on which it - appears; its value is inherited. This name is reserved - by virtue of its definition in the XML Base specification. + base (as an attribute name): denotes an attribute whose value + provides a URI to be used as the base for interpreting any + relative URIs in the scope of the element on which it + appears; its value is inherited. This name is reserved + by virtue of its definition in the XML Base specification. - id (as an attribute name): denotes an attribute whose value - should be interpreted as if declared to be of type ID. - The xml:id specification is not yet a W3C Recommendation, - but this attribute is included here to facilitate experimentation - with the mechanisms it proposes. Note that it is _not_ included - in the specialAttrs attribute group. + id (as an attribute name): denotes an attribute whose value + should be interpreted as if declared to be of type ID. + The xml:id specification is not yet a W3C Recommendation, + but this attribute is included here to facilitate experimentation + with the mechanisms it proposes. Note that it is _not_ included + in the specialAttrs attribute group. - lang (as an attribute name): denotes an attribute whose value - is a language code for the natural language of the content of - any element; its value is inherited. This name is reserved - by virtue of its definition in the XML specification. + lang (as an attribute name): denotes an attribute whose value + is a language code for the natural language of the content of + any element; its value is inherited. This name is reserved + by virtue of its definition in the XML specification. space (as an attribute name): denotes an attribute whose - value is a keyword indicating what whitespace processing - discipline is intended for the content of the element; its - value is inherited. This name is reserved by virtue of its - definition in the XML specification. + value is a keyword indicating what whitespace processing + discipline is intended for the content of the element; its + value is inherited. This name is reserved by virtue of its + definition in the XML specification. Father (in any context at all): denotes Jon Bosak, the chair of - the original XML Working Group. This name is reserved by - the following decision of the W3C XML Plenary and - XML Coordination groups: - - In appreciation for his vision, leadership and dedication - the W3C XML Plenary on this 10th day of February, 2000 - reserves for Jon Bosak in perpetuity the XML name - xml:Father + the original XML Working Group. This name is reserved by + the following decision of the W3C XML Plenary and + XML Coordination groups: + + In appreciation for his vision, leadership and dedication + the W3C XML Plenary on this 10th day of February, 2000 + reserves for Jon Bosak in perpetuity the XML name + xml:Father - + - + This schema defines attributes and an attribute group suitable for use by schemas wishing to allow xml:base, xml:lang, xml:space or xml:id @@ -60,87 +60,87 @@ To enable this, such a schema must import this schema for the XML namespace, e.g. as follows: <schema . . .> - . . . - <import namespace="http://www.w3.org/XML/1998/namespace" + . . . + <import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2005/08/xml.xsd"/> Subsequently, qualified reference to any of the attributes or the group defined below will have the desired effect, e.g. <type . . .> - . . . - <attributeGroup ref="xml:specialAttrs"/> + . . . + <attributeGroup ref="xml:specialAttrs"/> - will define a type which will schema-validate an instance - element with any of those attributes - + will define a type which will schema-validate an instance + element with any of those attributes + - + In keeping with the XML Schema WG's standard versioning - policy, this schema document will persist at - http://www.w3.org/2005/08/xml.xsd. - At the date of issue it can also be found at - http://www.w3.org/2001/xml.xsd. - The schema document at that URI may however change in the future, - in order to remain compatible with the latest version of XML Schema - itself, or with the XML namespace itself. In other words, if the XML - Schema or XML namespaces change, the version of this document at - http://www.w3.org/2001/xml.xsd will change - accordingly; the version at - http://www.w3.org/2005/08/xml.xsd will not change. + policy, this schema document will persist at + http://www.w3.org/2005/08/xml.xsd. + At the date of issue it can also be found at + http://www.w3.org/2001/xml.xsd. + The schema document at that URI may however change in the future, + in order to remain compatible with the latest version of XML Schema + itself, or with the XML namespace itself. In other words, if the XML + Schema or XML namespaces change, the version of this document at + http://www.w3.org/2001/xml.xsd will change + accordingly; the version at + http://www.w3.org/2005/08/xml.xsd will not change. - + - + - Attempting to install the relevant ISO 2- and 3-letter - codes as the enumerated possible values is probably never - going to be a realistic possibility. See - RFC 3066 at http://www.ietf.org/rfc/rfc3066.txt and the IANA registry - at http://www.iana.org/assignments/lang-tag-apps.htm for - further information. - - The union allows for the 'un-declaration' of xml:lang with - the empty string. + Attempting to install the relevant ISO 2- and 3-letter + codes as the enumerated possible values is probably never + going to be a realistic possibility. See + RFC 3066 at http://www.ietf.org/rfc/rfc3066.txt and the IANA registry + at http://www.iana.org/assignments/lang-tag-apps.htm for + further information. + + The union allows for the 'un-declaration' of xml:lang with + the empty string. - - - - - - - + + + + + + + - + - + - - - - + + + + - + - + - See http://www.w3.org/TR/xmlbase/ for - information about this attribute. + See http://www.w3.org/TR/xmlbase/ for + information about this attribute. - + - + - See http://www.w3.org/TR/xml-id/ for - information about this attribute. + See http://www.w3.org/TR/xml-id/ for + information about this attribute. - + - + - + diff --git a/metamorph/src/test/java/org/metafacture/metamorph/TestMetamorphBasics.java b/metamorph/src/test/java/org/metafacture/metamorph/TestMetamorphBasics.java index e8aee5836..6e631f3b2 100644 --- a/metamorph/src/test/java/org/metafacture/metamorph/TestMetamorphBasics.java +++ b/metamorph/src/test/java/org/metafacture/metamorph/TestMetamorphBasics.java @@ -655,33 +655,33 @@ public void shouldNotHandleDataByElseNestedSourceIfDataBelongingToEntityIsRuledB public void shouldHandleUseCaseSandboxElseNestedEntities() { assertMorph(receiver, "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + "", i -> { i.startRecord("ID1687931"); diff --git a/metamorph/src/test/resources/org/metafacture/metamorph/xml/dom-loader/XInclude.xsd b/metamorph/src/test/resources/org/metafacture/metamorph/xml/dom-loader/XInclude.xsd index d9f3bb0b7..949c5f906 100644 --- a/metamorph/src/test/resources/org/metafacture/metamorph/xml/dom-loader/XInclude.xsd +++ b/metamorph/src/test/resources/org/metafacture/metamorph/xml/dom-loader/XInclude.xsd @@ -1,10 +1,10 @@ - + Not normative, but may be useful. See the REC http://www.w3.org/TR/XInclude for definitive information about this namespace. - + diff --git a/metamorph/src/test/resources/org/metafacture/metamorph/xml/dom-loader/xml.xsd b/metamorph/src/test/resources/org/metafacture/metamorph/xml/dom-loader/xml.xsd index 3cd228d83..ff54474c1 100644 --- a/metamorph/src/test/resources/org/metafacture/metamorph/xml/dom-loader/xml.xsd +++ b/metamorph/src/test/resources/org/metafacture/metamorph/xml/dom-loader/xml.xsd @@ -1,10 +1,10 @@ - + - See http://www.w3.org/XML/1998/namespace.html and - http://www.w3.org/TR/REC-xml for information about this namespace. + See http://www.w3.org/XML/1998/namespace.html and + http://www.w3.org/TR/REC-xml for information about this namespace. This schema document describes the XML namespace, in a form suitable for import by other schema documents. @@ -15,43 +15,43 @@ not be used with conflicting semantics by any Working Group, specification, or document instance: - base (as an attribute name): denotes an attribute whose value - provides a URI to be used as the base for interpreting any - relative URIs in the scope of the element on which it - appears; its value is inherited. This name is reserved - by virtue of its definition in the XML Base specification. + base (as an attribute name): denotes an attribute whose value + provides a URI to be used as the base for interpreting any + relative URIs in the scope of the element on which it + appears; its value is inherited. This name is reserved + by virtue of its definition in the XML Base specification. - id (as an attribute name): denotes an attribute whose value - should be interpreted as if declared to be of type ID. - The xml:id specification is not yet a W3C Recommendation, - but this attribute is included here to facilitate experimentation - with the mechanisms it proposes. Note that it is _not_ included - in the specialAttrs attribute group. + id (as an attribute name): denotes an attribute whose value + should be interpreted as if declared to be of type ID. + The xml:id specification is not yet a W3C Recommendation, + but this attribute is included here to facilitate experimentation + with the mechanisms it proposes. Note that it is _not_ included + in the specialAttrs attribute group. - lang (as an attribute name): denotes an attribute whose value - is a language code for the natural language of the content of - any element; its value is inherited. This name is reserved - by virtue of its definition in the XML specification. + lang (as an attribute name): denotes an attribute whose value + is a language code for the natural language of the content of + any element; its value is inherited. This name is reserved + by virtue of its definition in the XML specification. space (as an attribute name): denotes an attribute whose - value is a keyword indicating what whitespace processing - discipline is intended for the content of the element; its - value is inherited. This name is reserved by virtue of its - definition in the XML specification. + value is a keyword indicating what whitespace processing + discipline is intended for the content of the element; its + value is inherited. This name is reserved by virtue of its + definition in the XML specification. Father (in any context at all): denotes Jon Bosak, the chair of - the original XML Working Group. This name is reserved by - the following decision of the W3C XML Plenary and - XML Coordination groups: - - In appreciation for his vision, leadership and dedication - the W3C XML Plenary on this 10th day of February, 2000 - reserves for Jon Bosak in perpetuity the XML name - xml:Father + the original XML Working Group. This name is reserved by + the following decision of the W3C XML Plenary and + XML Coordination groups: + + In appreciation for his vision, leadership and dedication + the W3C XML Plenary on this 10th day of February, 2000 + reserves for Jon Bosak in perpetuity the XML name + xml:Father - + - + This schema defines attributes and an attribute group suitable for use by schemas wishing to allow xml:base, xml:lang, xml:space or xml:id @@ -60,87 +60,87 @@ To enable this, such a schema must import this schema for the XML namespace, e.g. as follows: <schema . . .> - . . . - <import namespace="http://www.w3.org/XML/1998/namespace" + . . . + <import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2005/08/xml.xsd"/> Subsequently, qualified reference to any of the attributes or the group defined below will have the desired effect, e.g. <type . . .> - . . . - <attributeGroup ref="xml:specialAttrs"/> + . . . + <attributeGroup ref="xml:specialAttrs"/> - will define a type which will schema-validate an instance - element with any of those attributes - + will define a type which will schema-validate an instance + element with any of those attributes + - + In keeping with the XML Schema WG's standard versioning - policy, this schema document will persist at - http://www.w3.org/2005/08/xml.xsd. - At the date of issue it can also be found at - http://www.w3.org/2001/xml.xsd. - The schema document at that URI may however change in the future, - in order to remain compatible with the latest version of XML Schema - itself, or with the XML namespace itself. In other words, if the XML - Schema or XML namespaces change, the version of this document at - http://www.w3.org/2001/xml.xsd will change - accordingly; the version at - http://www.w3.org/2005/08/xml.xsd will not change. + policy, this schema document will persist at + http://www.w3.org/2005/08/xml.xsd. + At the date of issue it can also be found at + http://www.w3.org/2001/xml.xsd. + The schema document at that URI may however change in the future, + in order to remain compatible with the latest version of XML Schema + itself, or with the XML namespace itself. In other words, if the XML + Schema or XML namespaces change, the version of this document at + http://www.w3.org/2001/xml.xsd will change + accordingly; the version at + http://www.w3.org/2005/08/xml.xsd will not change. - + - + - Attempting to install the relevant ISO 2- and 3-letter - codes as the enumerated possible values is probably never - going to be a realistic possibility. See - RFC 3066 at http://www.ietf.org/rfc/rfc3066.txt and the IANA registry - at http://www.iana.org/assignments/lang-tag-apps.htm for - further information. - - The union allows for the 'un-declaration' of xml:lang with - the empty string. + Attempting to install the relevant ISO 2- and 3-letter + codes as the enumerated possible values is probably never + going to be a realistic possibility. See + RFC 3066 at http://www.ietf.org/rfc/rfc3066.txt and the IANA registry + at http://www.iana.org/assignments/lang-tag-apps.htm for + further information. + + The union allows for the 'un-declaration' of xml:lang with + the empty string. - - - - - - - + + + + + + + - + - + - - - - + + + + - + - + - See http://www.w3.org/TR/xmlbase/ for - information about this attribute. + See http://www.w3.org/TR/xmlbase/ for + information about this attribute. - + - + - See http://www.w3.org/TR/xml-id/ for - information about this attribute. + See http://www.w3.org/TR/xml-id/ for + information about this attribute. - + - + - + diff --git a/misc/bin/editorconfig-checker b/misc/bin/editorconfig-checker new file mode 100755 index 000000000..badbdd999 Binary files /dev/null and b/misc/bin/editorconfig-checker differ diff --git a/settings.gradle b/settings.gradle index b6fcc2c7f..0eb4448f1 100644 --- a/settings.gradle +++ b/settings.gradle @@ -14,6 +14,10 @@ * limitations under the License. */ +plugins { + id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' +} + rootProject.name = 'metafacture-core' include ':metafacture-commons'