Skip to content

Commit 49d97ef

Browse files
committed
Merge branch 'master' into oersi
2 parents 6613de9 + 6b14ffd commit 49d97ef

File tree

575 files changed

+17077
-7902
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

575 files changed

+17077
-7902
lines changed

.editorconfig

+18-17
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,28 @@
1414
# limitations under the License.
1515
#
1616

17-
root=true
17+
root = true
1818

1919
[*]
20-
charset=utf-8
21-
end_of_line=lf
22-
insert_final_newline=true
23-
trim_trailing_whitespace=true
24-
indent_style=space
25-
indent_size=4
26-
continuation_indent_size=8
20+
charset = utf-8
21+
end_of_line = lf
22+
indent_size = 4
23+
indent_style = space
24+
insert_final_newline = true
25+
trim_trailing_whitespace = true
2726

28-
[{*.yml,*.yaml}]
29-
indent_style=space
30-
indent_size=2
27+
[*.bat]
28+
end_of_line = crlf
29+
trim_trailing_whitespace = false
3130

32-
[*.gradle]
33-
indent_style=space
34-
indent_size=2
31+
[*.{gradle,yml}]
32+
indent_size = 2
3533

36-
[*.bat]
37-
end_of_line=crlf
34+
[metafacture-io/src/test/resources/org/metafacture/io/compressed.txt]
35+
insert_final_newline = false
36+
37+
[metamorph/src/test/resources/org/metafacture/metamorph/maps/file-map-test.txt]
38+
trim_trailing_whitespace = false
3839

3940
[metafacture-runner/src/main/dist/config/java-options.conf]
40-
end_of_line=crlf
41+
end_of_line = crlf

.gitattributes

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*.js text
2929
*.fom text
3030

31-
# Platform-specific scripts should always use
31+
# Platform-specific scripts should always use
3232
# their native end-of-line markers:
3333
*.bat text eol=crlf
3434
*.sh text eol=lf

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ target/
2222
.gradletasknamecache
2323
build
2424

25+
# Ignore tmp directory
26+
tmp
27+
2528
# Ignore Eclipse project files:
2629
.checkstyle
2730
.pmd
@@ -44,3 +47,10 @@ atlassian-ide-plugin.xml
4447

4548
# Ignore files generated by CI:
4649
buildbot.keyring
50+
51+
# Ignore VS code/codium config files
52+
.vscode
53+
54+
# Ignore files with sensitive data
55+
gradle.properties
56+
secring.gpg

CONTRIBUTING.md

+222
Large diffs are not rendered by default.

README.md

+19-18
Original file line numberDiff line numberDiff line change
@@ -2,65 +2,65 @@
22

33
[![Build](https://github.com/metafacture/metafacture-core/workflows/Build/badge.svg?branch=master)](https://github.com/metafacture/metafacture-core/actions?query=workflow%3ABuild) [![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=org.metafacture:metafacture-core&metric=alert_status)](https://sonarcloud.io/dashboard/index/org.metafacture:metafacture-core)
44

5-
Metafacture is a toolkit for processing semi-structured data with a focus on library metadata. It provides a versatile set of tools for reading, writing and transforming data. Metafacture can be used as a stand-alone application or as a Java library in other applications. The name Metafacture is a portmanteau of the words *meta* data and manu*facture*.
5+
Metafacture is a toolkit for processing semi-structured data with a focus on library metadata. It provides a versatile set of tools for reading, writing and transforming data. Metafacture can be used as a stand-alone application or as a Java library in other applications. The name Metafacture is a portmanteau of the words *meta*data and manu*facture*.
66

7-
Metafacture includes a [large number of modules](https://github.com/metafacture/metafacture-documentation/blob/master/flux-commands.md) for operating on semi-structured data. These modules can be combined to build pipelines to perform complex metadata processing tasks. The pipelines can be constructed either in Java code or with the domain-specific language **Flux**. One of the core features of Metafacture is the **Metamorph** module. Metamorph is an xml-based language for specifying transformations of semi-structured data. It can be seamlessly integrated into Java code.
7+
Metafacture includes a [large number of modules](https://github.com/metafacture/metafacture-documentation/blob/master/flux-commands.md) for operating on semi-structured data. These modules can be combined to build pipelines to perform complex metadata processing tasks. The pipelines can be constructed either in Java code or with the domain-specific language **Flux**. One of the core features of Metafacture is the **Metamorph** module. Metamorph is an XML-based language for specifying transformations of semi-structured data. It can be seamlessly integrated into Java code.
88

99
At its heart Metafacture is a framework for implementing modules for metadata processing. This makes Metafacture easily extendable with additional modules. The [plugins and tools page](https://github.com/metafacture/metafacture-core/wiki/Plugins-and-Tools) on the wiki shows supplementary packages and projects which extend Metafacture.
1010

11-
Originally, Metafacture was developed as part of the [Culturegraph](http://culturegraph.org) platform but it is developed independently now and used by others, too: [see who uses Metafacture](https://github.com/metafacture/metafacture-core/wiki/Who-uses-Metafacture).
11+
Originally, Metafacture was developed as part of the [Culturegraph](http://www.culturegraph.org) platform but it is developed independently now and used by others, too: [see who uses Metafacture](https://github.com/metafacture/metafacture-core/wiki/Who-uses-Metafacture).
1212

1313
# Getting started
1414

1515
You can either use Metafacture as a stand-alone application or include it as a Java library in your own projects.
1616

1717
## Metafacture as a stand-alone application
18-
19-
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.
2018

21-
1. Download the latest distribution package from the [metafacture-core/releases](https://github.com/metafacture/metafacture-core/releases) page. Make sure that you do download a distribution package and _not_ a source code package (the file name should include *-dist*).
19+
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).
20+
21+
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*`).
2222

2323
2. Extract the downloaded archive:
2424
```bash
25-
$ tar xzf metafacture-core-VERSION-dist.tar.gz
25+
$ tar xzf metafacture-core-$VERSION-dist.tar.gz
2626
```
27-
This will create a new directory containing a ready-to-use metafacture distribution.
27+
This will create a new directory containing a ready-to-use Metafacture distribution.
2828
3. Change into the newly created directory:
2929
```bash
30-
$ cd metafacture-core-VERSION
30+
$ cd metafacture-core-$VERSION
3131
```
3232
4. Run one of the example scripts:
3333
```bash
3434
$ ./flux.sh examples/read/marc21/read-marc21.flux
3535
```
36-
This example will print a number of marc21 records on standard out.
36+
This example will print a number of MARC 21 records on standard output.
3737

38-
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).
38+
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).
3939

4040

41-
## Using Metafacture as a Java libary
41+
## Using Metafacture as a Java library
4242

43-
If you want use Metafacture in your own Java projects all you need to add some dependencies to your project. As of Metafacture 5 the single metafacture-core package has been replaced with a number of domain-specific packages. You can find the list of packages on [Maven Central](https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.metafacture%22).
43+
If you want to use Metafacture in your own Java projects all you need is to add some dependencies to your project. As of Metafacture 5, the single metafacture-core package has been replaced with a number of domain-specific packages. You can find the list of packages on [Maven Central](https://search.maven.org/search?q=g:org.metafacture).
4444

4545
Alternatively, you can simply guess the package names from the top-level folders in the source code repository -- they are the same. For instance, if you want to use Metamorph in your project, simply add the following dependency to your `pom.xml`:
4646

4747
```xml
4848
<dependency>
4949
<groupId>org.metafacture</groupId>
5050
<artifactId>metamorph</artifactId>
51-
<version>VERSION</version>
51+
<version>$VERSION</version>
5252
</dependency>
5353
```
5454

5555
or if Gradle is your build tool of choice use:
5656

5757
```groovy
5858
dependencies {
59-
implementation 'org.metafacture:metamorph:VERSION'
59+
implementation 'org.metafacture:metamorph:$VERSION'
6060
}
6161
```
6262

63-
Our integration server automatically publishes successful builds of all branches as snapshot versions on [Sonatype OSS Repository](https://oss.sonatype.org/index.html#nexus-search;quick~metafacture). The version number is derived from the branch name. Snapshot builds from the master branch always have the version "master-SNAPSHOT".
63+
Occasionally, we publish snapshot builds on [Sonatype OSS Repository](https://oss.sonatype.org/index.html#nexus-search;gav~org.metafacture~~~~). The version number is derived from the branch name. Snapshot builds from the master branch always have the version `master-SNAPSHOT`.
6464

6565
<!--
6666
TODO: Link to getting started tutorial
@@ -77,13 +77,14 @@ $ git clone https://github.com/metafacture/metafacture-core.git
7777
$ cd metafacture-core
7878
```
7979

80-
2. Invoke the gradle-wrapper to download Gradle and build metafacture-core (on Windows call `gradlew.bat install`):
80+
2. Invoke the Gradle wrapper to download Gradle and build metafacture-core (on Windows call `gradlew.bat install` instead):
8181

8282
```bash
8383
$ ./gradlew install
8484
```
8585

86-
The resulting distribution can be found in `metafacture-core/metafacture-runner/build/distributions/`.
86+
Besides the resulting distribution in `metafacture-core/metafacture-runner/build/distributions/` this also provides builds in your local maven repository.
87+
8788

8889
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.
8990

build.gradle

+57-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 Christoph Böhme
2+
* Copyright 2017, 2021 Christoph Böhme et al.
33
*
44
* Licensed under the Apache License, Version 2.0 the "License";
55
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@ import java.util.regex.Matcher
1818

1919
plugins {
2020
id 'org.ajoberstar.grgit' version '2.3.0'
21+
id 'org.ec4j.editorconfig' version '0.0.3'
2122
id 'org.sonarqube' version '2.6.2'
2223
id 'io.codearte.nexus-staging' version '0.11.0'
2324
}
@@ -38,16 +39,37 @@ project(':metafacture-runner') {
3839
apply plugin: 'java'
3940
}
4041

42+
editorconfig {
43+
excludes = [
44+
'**/*.beacon',
45+
'**/*.bgzf',
46+
'**/*.bz2',
47+
'**/*.bzip2',
48+
'**/*.gzip',
49+
'**/*.xz',
50+
'gradlew*'
51+
]
52+
}
53+
4154
subprojects {
4255
apply plugin: 'signing'
4356
apply plugin: 'maven'
4457
apply plugin: 'jacoco'
58+
apply plugin: 'checkstyle'
4559
apply plugin: 'maven-publish'
4660

61+
check.dependsOn(editorconfigCheck)
62+
check.dependsOn(javadoc)
63+
4764
sourceCompatibility = 1.8
4865
targetCompatibility = 1.8
4966

5067
tasks.withType(JavaCompile) {
68+
'all -processing -rawtypes -serial'.split().each {
69+
options.compilerArgs << "-Xlint:${it}".toString()
70+
}
71+
72+
options.compilerArgs << '-Werror'
5173
options.encoding = 'UTF-8'
5274
}
5375

@@ -67,11 +89,33 @@ subprojects {
6789
group 'build'
6890
}
6991

92+
task allDeps(type: DependencyReportTask) {}
93+
94+
javadoc {
95+
options {
96+
addBooleanOption 'Xwerror', true
97+
}
98+
}
99+
70100
artifacts {
71101
archives sourceJar
72102
archives javadocJar
73103
}
74104

105+
checkstyle {
106+
toolVersion '8.30'
107+
checkstyleTest.enabled = false
108+
}
109+
110+
test {
111+
systemProperties['org.slf4j.simpleLogger.defaultLogLevel'] = 'warn'
112+
113+
testLogging {
114+
showStandardStreams = true
115+
exceptionFormat = 'full'
116+
}
117+
}
118+
75119
signing {
76120
required {
77121
scmInfo.isRelease() && gradle.taskGraph.hasTask(tasks.uploadArchives)
@@ -96,16 +140,16 @@ gradle.projectsEvaluated {
96140
}
97141

98142
def mavenProjectDescription = {
99-
name project.mavenName ?: project.name
143+
name = project.mavenName ?: project.name
100144
if (project.description) {
101145
description project.description
102146
}
103-
url 'https://github.com/culturegraph/metafacture-core'
147+
url 'https://github.com/metafacture/metafacture-core'
104148
inceptionYear '2011'
105149
developers {
106150
developer {
107151
id 'mgeipel'
108-
name 'Markus M. Geipel'
152+
name = 'Markus M. Geipel'
109153
110154
url 'https://github.com/mgeipel'
111155
roles {
@@ -115,7 +159,7 @@ gradle.projectsEvaluated {
115159
}
116160
developer {
117161
id 'cboehme'
118-
name 'Christoph Böhme'
162+
name = 'Christoph Böhme'
119163
120164
url 'https://github.com/cboehme'
121165
roles {
@@ -125,18 +169,18 @@ gradle.projectsEvaluated {
125169
}
126170
}
127171
organization {
128-
name 'Deutsche Nationalbibliothek'
129-
url 'http://dnb.de/'
172+
name = 'Metafacture'
173+
url 'https://github.com/metafacture'
130174
}
131175
licenses {
132176
license {
133-
name 'The Apache License, Version 2.0'
177+
name = 'The Apache License, Version 2.0'
134178
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
135179
}
136180
}
137181
mailingLists {
138182
mailingList {
139-
name 'Metafacture Mailing List'
183+
name = 'Metafacture Mailing List'
140184
141185
subscribe '[email protected]'
142186
unsubscribe '[email protected]'
@@ -154,8 +198,8 @@ gradle.projectsEvaluated {
154198
url 'https://github.com/metafacture/metafacture-core/issues'
155199
}
156200
ciManagement {
157-
system 'Travis CI'
158-
url 'https://travis-ci.org/metafacture/metafacture-core'
201+
system 'Github Actions'
202+
url 'https://github.com/metafacture/metafacture-core/actions'
159203
}
160204
}
161205

@@ -277,7 +321,6 @@ class ScmInfo {
277321
}
278322

279323
def getScmInfo() {
280-
def version = null
281324
def tag = getGitTag()
282325
if (tag != null) {
283326
logger.lifecycle('SCM tag found. Making a release build')
@@ -295,11 +338,11 @@ def getSnapshotVersion() {
295338
logger.warn('No Git repository found')
296339
return 'non-scm-build-SNAPSHOT'
297340
}
298-
if (grgit.branch.current().fullName.equals('HEAD')) {
341+
if (grgit.branch.current().fullName == 'HEAD') {
299342
logger.lifecycle('Detached HEAD found')
300343
return "commit-${grgit.head().id}-SNAPSHOT"
301344
}
302-
if (grgit.branch.current().name.equals('master')) {
345+
if (grgit.branch.current().name == 'master') {
303346
logger.lifecycle('On master branch')
304347
return 'master-SNAPSHOT'
305348
}

0 commit comments

Comments
 (0)