Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ updates:
schedule:
interval: weekly
day: sunday
labels:
- "dependencies"
ignore:
- dependency-name: com.microsoft.azure:applicationinsights-core
versions:
Expand All @@ -23,10 +21,14 @@ updates:
schedule:
interval: weekly
day: sunday
labels:
- "dependencies"
- package-ecosystem: "gitsubmodule"
directory: "/"
schedule:
interval: weekly
day: sunday
- package-ecosystem: "maven"
directories:
- "jablib-examples/maven3/doi-to-bibtex"
schedule:
interval: weekly
day: sunday
64 changes: 59 additions & 5 deletions .github/workflows/tests-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ jobs:
KOPPOR_MAVENCENTRALUSERNAME: ${{ secrets.KOPPOR_MAVENCENTRALUSERNAME }}
KOPPOR_MAVENCENTRALPASSWORD: ${{ secrets.KOPPOR_MAVENCENTRALPASSWORD }}

jbang:
jbang-main:
name: JBang (main)
runs-on: ubuntu-latest
needs: publish
Expand All @@ -452,7 +452,7 @@ jobs:
files: |
.jbang/*.java
jablib/src/main/java/**/*.java
jablib-examples/**/*.java
jablib-examples/jbang/**/*.java
files_ignore: |
jablib/src/main/java/**/*-*.java
- name: Set up JDK
Expand Down Expand Up @@ -488,7 +488,7 @@ jobs:
done
if: steps.changed-jablib-files.outputs.any_changed != 'true'
- run: |
for f in jablib-examples/*.java; do
for f in jablib-examples/jbang/*.java; do
echo "Building $f..."
jbang build --fresh "$f"
done
Expand All @@ -510,7 +510,7 @@ jobs:
strategy:
fail-fast: false
matrix:
script: [.jbang/JabKitLauncher.java, .jbang/JabLsLauncher.java, .jbang/JabSrvLauncher.java, jablib-examples/ieee_pdf_references_to_bibtex.java]
script: [.jbang/JabKitLauncher.java, .jbang/JabLsLauncher.java, .jbang/JabSrvLauncher.java, jablib-examples/jbang/doi_to_bibtex.java, jablib-examples/jbang/ieee_pdf_references_to_bibtex.java]
steps:
- name: Checkout source
uses: actions/checkout@v5
Expand All @@ -525,7 +525,7 @@ jobs:
.jbang/*.java
jabkit/src/main/java/**/*.java
jablib/src/main/java/**/*.java
jablib-examples/**/*.java
jablib-examples/jbang/**/*.java
files_ignore: |
jablib/src/main/java/**/*-*.java
- name: Set up JDK
Expand Down Expand Up @@ -578,6 +578,60 @@ jobs:
if: ${{ contains(matrix.script, 'Launcher.java') }}
shell: bash

maven-examples:
name: Maven examples (main)
runs-on: ubuntu-latest
needs: publish
if: github.ref == 'refs/heads/main'
strategy:
fail-fast: false
matrix:
project: [jablib-examples/maven3/doi-to-bibtex]
steps:
- name: Checkout source
uses: actions/checkout@v5
with:
submodules: 'false'
show-progress: 'false'
- name: Set up JDK
uses: actions/setup-java@v5
with:
java-version: 24
distribution: 'corretto'
cache: maven
check-latest: true
- run: |
cd ${{ matrix.project }}
mvn --batch-mode --update-snapshots verify
shell: bash

maven-pr:
name: Maven examples (PR)
runs-on: ubuntu-latest
# does not need publish, because there is no publishing on non-main
if: github.ref != 'refs/heads/main'
strategy:
fail-fast: false
matrix:
project: [jablib-examples/maven3/doi-to-bibtex]
steps:
- name: Checkout source
uses: actions/checkout@v5
with:
submodules: 'false'
show-progress: 'false'
- name: Set up JDK
uses: actions/setup-java@v5
with:
java-version: 24
distribution: 'corretto'
cache: maven
check-latest: true
- run: |
cd ${{ matrix.project }}
mvn --batch-mode --update-snapshots verify
shell: bash

codecoverage:
if: false
name: Code coverage
Expand Down
14 changes: 3 additions & 11 deletions .jbang/JabKitLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,11 @@
//SOURCES ../jabkit/src/main/java/org/jabref/toolkit/JabKit.java
//FILES tinylog.properties=../jabkit/src/main/resources/tinylog.properties

// REPOS mavencentral,snapshots=https://central.sonatype.com/repository/maven-snapshots/
// REPOS mavencentral,mavencentralsnapshots=https://central.sonatype.com/repository/maven-snapshots/,s01oss=https://s01.oss.sonatype.org/content/repositories/snapshots/,oss=https://oss.sonatype.org/content/repositories,jitpack=https://jitpack.io,oss2=https://oss.sonatype.org/content/groups/public,ossrh=https://oss.sonatype.org/content/repositories/snapshots
//REPOS mavencentral,mavencentralsnapshots=https://central.sonatype.com/repository/maven-snapshots/,s01oss=https://s01.oss.sonatype.org/content/repositories/snapshots/,oss=https://oss.sonatype.org/content/repositories,jitpack=https://jitpack.io,oss2=https://oss.sonatype.org/content/groups/public,ossrh=https://oss.sonatype.org/content/repositories/snapshots,raw=https://raw.githubusercontent.com/JabRef/jabref/refs/heads/main/jablib/lib/
// REPOS mavencentral,jitpack=https://jitpack.io
// raw is for https://github.com/unicode-org/icu/pull/2127
//REPOS mavencentral,mavencentralsnapshots=https://central.sonatype.com/repository/maven-snapshots/,raw=https://raw.githubusercontent.com/JabRef/jabref/refs/heads/main/jablib/lib/

// TODO: ASCII things won't work, but we accept for now to keep things going
//DEPS com.ibm.icu:icu4j:78.1

// Choose one - both should work
// https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/org/jabref/jablib/
//DEPS org.jabref:jablib:6.0-SNAPSHOT
// https://jitpack.io/#jabref/jabref/main-SNAPSHOT
// DEPS com.github.jabref:jabref:main-SNAPSHOT

//DEPS io.github.darvil82:terminal-text-formatter:2.2.0
//DEPS info.picocli:picocli:4.7.7
//DEPS com.github.ben-manes.caffeine:caffeine:3.2.3
Expand Down
12 changes: 3 additions & 9 deletions .jbang/JabLsLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,20 @@
//SOURCES ../jabls/src/main/java/org/jabref/languageserver/util/definition/LatexDefinitionProvider.java
//SOURCES ../jabls/src/main/java/org/jabref/languageserver/util/definition/MarkdownDefinitionProvider.java

// REPOS mavencentral,snapshots=https://central.sonatype.com/repository/maven-snapshots/
// REPOS mavencentral,mavencentralsnapshots=https://central.sonatype.com/repository/maven-snapshots/,s01oss=https://s01.oss.sonatype.org/content/repositories/snapshots/,oss=https://oss.sonatype.org/content/repositories,jitpack=https://jitpack.io,oss2=https://oss.sonatype.org/content/groups/public,ossrh=https://oss.sonatype.org/content/repositories/snapshots
//REPOS mavencentral,mavencentralsnapshots=https://central.sonatype.com/repository/maven-snapshots/,s01oss=https://s01.oss.sonatype.org/content/repositories/snapshots/,oss=https://oss.sonatype.org/content/repositories,jitpack=https://jitpack.io,oss2=https://oss.sonatype.org/content/groups/public,ossrh=https://oss.sonatype.org/content/repositories/snapshots,raw=https://raw.githubusercontent.com/JabRef/jabref/refs/heads/main/jablib/lib/
// REPOS mavencentral,jitpack=https://jitpack.io
// raw is for https://github.com/unicode-org/icu/pull/2127
//REPOS mavencentral,mavencentralsnapshots=https://central.sonatype.com/repository/maven-snapshots/,raw=https://raw.githubusercontent.com/JabRef/jabref/refs/heads/main/jablib/lib/

// Choose one - both should work
// https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/org/jabref/jablib/
//DEPS org.jabref:jablib:6.0-SNAPSHOT
// https://jitpack.io/#jabref/jabref/main-SNAPSHOT
// DEPS com.github.jabref:jabref:main-SNAPSHOT

//DEPS io.github.darvil82:terminal-text-formatter:2.2.0
//DEPS info.picocli:picocli:4.7.7
//DEPS org.jspecify:jspecify:1.0.0

// from jabls
//DEPS com.fasterxml.jackson.core:jackson-databind:2.20.1
//DEPS com.github.eclipse:lsp4j:0.24.0
//DEPS info.picocli:picocli:4.7.7
//DEPS org.apache.logging.log4j:log4j-to-slf4j:2.25.2
//DEPS org.eclipse.lsp4j:org.eclipse.lsp4j:0.24.0
//DEPS org.jabref:afterburner.fx:2.0.0
//DEPS org.slf4j:jul-to-slf4j:2.0.17
//DEPS org.slf4j:slf4j-api:2.0.17
Expand Down
13 changes: 2 additions & 11 deletions .jbang/JabSrvLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,10 @@
//SOURCES ../jabsrv/src/main/java/org/jabref/http/server/PreferencesFactory.java
//SOURCES ../jabsrv/src/main/java/org/jabref/http/server/Server.java

// REPOS mavencentral,snapshots=https://central.sonatype.com/repository/maven-snapshots/
// REPOS mavencentral,mavencentralsnapshots=https://central.sonatype.com/repository/maven-snapshots/,s01oss=https://s01.oss.sonatype.org/content/repositories/snapshots/,oss=https://oss.sonatype.org/content/repositories,jitpack=https://jitpack.io,oss2=https://oss.sonatype.org/content/groups/public,ossrh=https://oss.sonatype.org/content/repositories/snapshots
//REPOS mavencentral,mavencentralsnapshots=https://central.sonatype.com/repository/maven-snapshots/,s01oss=https://s01.oss.sonatype.org/content/repositories/snapshots/,oss=https://oss.sonatype.org/content/repositories,jitpack=https://jitpack.io,oss2=https://oss.sonatype.org/content/groups/public,ossrh=https://oss.sonatype.org/content/repositories/snapshots,raw=https://raw.githubusercontent.com/JabRef/jabref/refs/heads/main/jablib/lib/
// REPOS mavencentral,jitpack=https://jitpack.io
// raw is for https://github.com/unicode-org/icu/pull/2127
//REPOS mavencentral,mavencentralsnapshots=https://central.sonatype.com/repository/maven-snapshots/,raw=https://raw.githubusercontent.com/JabRef/jabref/refs/heads/main/jablib/lib/

// TODO: ASCII things won't work, but we accept for now to keep things going
//DEPS com.ibm.icu:icu4j:78.1

// Choose one - both should work
// https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/org/jabref/jablib/
//DEPS org.jabref:jablib:6.0-SNAPSHOT
// https://jitpack.io/#jabref/jabref/main-SNAPSHOT
// DEPS com.github.jabref:jabref:main-SNAPSHOT

//DEPS io.github.darvil82:terminal-text-formatter:2.2.0
//DEPS info.picocli:picocli:4.7.7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ java {
// If this is updated, also update
// - build.gradle -> jacoco -> toolVersion (because JaCoCo does not support newest JDK out of the box. Check versions at https://www.jacoco.org/jacoco/trunk/doc/changes.html)
// - jitpack.yml
// - .sdkmanrc
// - .devcontainer/devcontainer.json#L34 - there, also check if the gradleVersion matches the one of gradle/wrapper/gradle-wrapper.properties
// - .moderne/moderne.yml
// - .github/workflows/binaries*.yml
// - .github/workflows/publish.yml
// - .github/workflows/tests*.yml
// - .github/workflows/update-gradle-wrapper.yml
// - .jbang/Jab*.java
// - docs/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/intellij-12-build.md
// - .sdkmanrc
// - jablib-examples/jbang/*.java
// - jablib-examples/maven3/*/pom.xml
languageVersion = JavaLanguageVersion.of(24)
// See https://docs.gradle.org/current/javadoc/org/gradle/jvm/toolchain/JvmVendorSpec.html for a full list
// Temurin does not ship jmods, thus we need to use another JDK -- see https://github.com/actions/setup-java/issues/804
Expand Down
19 changes: 2 additions & 17 deletions jablib-examples/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
# `jablib` examples

This directory contains [`JBang`](https://www.jbang.dev/) examples to show how to use some `jablib` features.

## Development

In case you need to modify `jablib`, you can do it while working on your script.

You need then to add each modified file following this pattern:

```java
//SOURCES ../jablib/src/main/java/org/jabref/logic/citation/repository/BibEntrySerializer.java
```

The list of modified files can be generated using git and some Linux command line tools as follows:

```bash
git diff --name-status --diff-filter=AMCR --find-renames=50% --find-copies=50% main | awk -F '\t' '($1=="A"||$1=="M"){print $2} ($1 ~ /^C/ || $1 ~ /^R/){print $3}' | grep 'jablib/src/main' | grep -v 'module-info' | grep -v '\.properties$' | sed 's#\(.*\)#//SOURCES ../\1#'
```
The subdirectory [`jbang`](jbang/) contains rather minimal `.java` files showing how `jablib` can be used in Java projects.
The code is intended as code-snippets to be used and modified as required.
19 changes: 19 additions & 0 deletions jablib-examples/jbang/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# `jablib` examples

This directory contains [`JBang`](https://www.jbang.dev/) examples to show how to use some `jablib` features.

## Development

In case you need to modify `jablib`, you can do it while working on your script.

You need then to add each modified file following this pattern:

```java
//SOURCES ../jablib/src/main/java/org/jabref/logic/citation/repository/BibEntrySerializer.java
```

The list of modified files can be generated using git and some Linux command line tools as follows:

```bash
git diff --name-status --diff-filter=AMCR --find-renames=50% --find-copies=50% main | awk -F '\t' '($1=="A"||$1=="M"){print $2} ($1 ~ /^C/ || $1 ~ /^R/){print $3}' | grep 'jablib/src/main' | grep -v 'module-info' | grep -v '\.properties$' | sed 's#\(.*\)#//SOURCES ../\1#'
```
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
//RUNTIME_OPTIONS --enable-native-access=ALL-UNNAMED
//FILES tinylog.properties=tinylog.properties

//REPOS mavencentral,mavencentralsnapshots=https://central.sonatype.com/repository/maven-snapshots/
//DEPS org.jabref:jablib:6.0-SNAPSHOT
//REPOS mavencentral,mavencentralsnapshots=https://central.sonatype.com/repository/maven-snapshots/,s01oss=https://s01.oss.sonatype.org/content/repositories/snapshots/,oss=https://oss.sonatype.org/content/repositories,jitpack=https://jitpack.io,oss2=https://oss.sonatype.org/content/groups/public,ossrh=https://oss.sonatype.org/content/repositories/snapshots,raw=https://raw.githubusercontent.com/JabRef/jabref/refs/heads/main/jablib/lib/
// JabRef relies on PR https://github.com/unicode-org/icu/pull/2127; for experiments the release version is OK.
//DEPS com.ibm.icu:icu4j:78.1

void main() throws Exception {
var preferences = JabRefCliPreferences.getInstance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
//RUNTIME_OPTIONS --enable-native-access=ALL-UNNAMED
//FILES tinylog.properties=tinylog.properties

//REPOS mavencentral,mavencentralsnapshots=https://central.sonatype.com/repository/maven-snapshots/
//DEPS org.jabref:jablib:6.0-SNAPSHOT
//REPOS mavencentral,mavencentralsnapshots=https://central.sonatype.com/repository/maven-snapshots/,s01oss=https://s01.oss.sonatype.org/content/repositories/snapshots/,oss=https://oss.sonatype.org/content/repositories,jitpack=https://jitpack.io,oss2=https://oss.sonatype.org/content/groups/public,ossrh=https://oss.sonatype.org/content/repositories/snapshots,raw=https://raw.githubusercontent.com/JabRef/jabref/refs/heads/main/jablib/lib/
// JabRef relies on PR https://github.com/unicode-org/icu/pull/2127; for experiments the release version is OK.
//DEPS com.ibm.icu:icu4j:78.1

void main() throws Exception {
var preferences = JabRefCliPreferences.getInstance();
Expand Down
Loading
Loading