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
6 changes: 4 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@ jobs:
jbang:
name: JBang
runs-on: ubuntu-latest
# JBang scripts depend on main-SNAPSHOT; thus, we can only test fully when main is updated
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout source
uses: actions/checkout@v4
Expand Down Expand Up @@ -404,8 +406,8 @@ jobs:
ref: fix-params
- run: jbang build .jbang/CheckoutPR.java
- run: jbang build .jbang/CloneJabRef.java
- run: jbang build .jbang/JabKitLauncher.java
- run: jbang build .jbang/JabSrvLauncher.java
- run: jbang build --fresh .jbang/JabKitLauncher.java
- run: jbang build --fresh .jbang/JabSrvLauncher.java

codecoverage:
if: false
Expand Down
10 changes: 8 additions & 2 deletions .jbang/JabKitLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,15 @@
//SOURCES ../jabkit/src/main/java/org/jabref/JabKit.java
//FILES tinylog.properties=../jabkit/src/main/resources/tinylog.properties

//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,jitpack=https://jitpack.io

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

// disabled due to maven central issues
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented code with explanation should be removed. Version control history should be used to track these changes instead of keeping commented code in the source.

// DEPS org.jabref:jablib:6.+
//DEPS com.github.jabref.jabref:jablib:main-SNAPSHOT

//DEPS org.jabref:jablib:6.+
//DEPS info.picocli:picocli:4.7.7

import org.jabref.JabKit;
Expand Down
16 changes: 14 additions & 2 deletions .jbang/JabSrvLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
//SOURCES ../jabsrv/src/main/java/org/jabref/http/dto/GsonFactory.java
//SOURCES ../jabsrv/src/main/java/org/jabref/http/JabrefMediaType.java
//SOURCES ../jabsrv/src/main/java/org/jabref/http/JabRefResourceLocator.java
//SOURCES ../jabsrv/src/main/java/org/jabref/http/server/cayw/CAYWResource.java
//SOURCES ../jabsrv/src/main/java/org/jabref/http/server/cayw/gui/CAYWEntry.java
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GUI components are being sourced directly in the server package, violating the layered architecture principle. GUI code should be a gateway to logic code in org.jabref.logic.

//SOURCES ../jabsrv/src/main/java/org/jabref/http/server/cayw/gui/SearchDialog.java
//SOURCES ../jabsrv/src/main/java/org/jabref/http/server/cayw/gui/SearchField.java
//SOURCES ../jabsrv/src/main/java/org/jabref/http/server/cayw/gui/SearchResultContainer.java
//SOURCES ../jabsrv/src/main/java/org/jabref/http/server/cayw/gui/SelectedItemsContainer.java
Comment on lines +18 to +21
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Including GUI-related code in server components violates layered architecture principles. GUI code should only be a gateway, and complex operations should be in org.jabref.logic.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @subhramit :)

//SOURCES ../jabsrv/src/main/java/org/jabref/http/server/CORSFilter.java
//SOURCES ../jabsrv/src/main/java/org/jabref/http/server/LibrariesResource.java
//SOURCES ../jabsrv/src/main/java/org/jabref/http/server/LibraryResource.java
Expand All @@ -21,9 +27,15 @@
//SOURCES ../jabsrv/src/main/java/org/jabref/http/server/Server.java
//SOURCES ../jabsrv/src/main/java/org/jabref/http/server/services/FilesToServe.java

//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,jitpack=https://jitpack.io

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

// disabled due to maven central issues
// DEPS org.jabref:jablib:6.+
Comment on lines +35 to +36
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented code should be removed as it serves no functional purpose. Git history should be used to track these changes instead of keeping commented code.

//DEPS com.github.jabref.jabref:jablib:main-SNAPSHOT

//DEPS org.jabref:jablib:6.+
//DEPS info.picocli:picocli:4.7.7
//DEPS org.jspecify:jspecify:1.0.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ jvmDependencyConflicts.patch {
module("com.konghq:unirest-modules-gson") {
addApiDependency("com.konghq:unirest-java-core")
}
module("com.github.tomtung:latex2unicode_2.13") {
removeDependency("com.lihaoyi:fastparse_2.13")
addApiDependency("com.lihaoyi:fastparse:2.3.3")
}
module("de.rototor.jeuclid:jeuclid-core") {
removeDependency("org.apache.xmlgraphics:batik-svg-dom")
removeDependency("org.apache.xmlgraphics:batik-ext")
Expand Down Expand Up @@ -112,7 +108,27 @@ extraJavaModuleInfo {
}
module("at.favre.lib:hkdf", "at.favre.lib.hkdf")
module("com.github.javakeyring:java-keyring", "com.github.java.keyring")
module("com.github.tomtung:latex2unicode_2.13", "com.github.tomtung.latex2unicode")

module("com.github.tomtung:latex2unicode_2.13", "com.github.tomtung.latex2unicode") {
exportAllPackages()
requireAllDefinedDependencies()
}
module("com.lihaoyi:fastparse_2.13", "com.lihaoyi.fastparse") {
exportAllPackages()
requireAllDefinedDependencies()
requires("scala.library")
}
module("com.lihaoyi:sourcecode_2.13", "com.lihaoyi.sourcecode") {
exportAllPackages()
requireAllDefinedDependencies()
requires("scala.library")
}
module("com.lihaoyi:geny_2.13", "com.lihaoyi.geny") {
exportAllPackages()
requireAllDefinedDependencies()
requires("scala.library")
}

module("com.googlecode.plist:dd-plist", "com.googlecode.dd.plist")
module("com.h2database:h2-mvstore", "com.h2database.mvstore")
module("com.ibm.icu:icu4j", "com.ibm.icu")
Expand All @@ -123,9 +139,6 @@ extraJavaModuleInfo {
uses("kong.unirest.core.json.JsonEngine")
}
module("com.konghq:unirest-modules-gson", "com.konghq.unirest.modules.gson")
module("com.lihaoyi:fastparse", "com.lihaoyi.fastparse")
module("com.lihaoyi:geny", "com.lihaoyi.geny")
module("com.lihaoyi:sourcecode", "com.lihaoyi.sourcecode")
module("com.squareup.okhttp3:okhttp", "okhttp3")
module("com.squareup.okhttp3:okhttp-sse", "okhttp3.sse")
module("com.squareup.okio:okio", "okio")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ java {
toolchain {
// 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
// - .devcontainer/devcontainer.json#L34 and
// - .moderne/moderne.yml
// - .github/workflows/binaries*.yml
Expand Down
15 changes: 12 additions & 3 deletions jablib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ tasks.withType<com.autonomousapps.tasks.CodeSourceExploderTask>().configureEach
val mockitoAgent = configurations.create("mockitoAgent")

dependencies {
implementation(enforcedPlatform(project(":versions")))
// api(platform(project(":versions")))

implementation("org.openjfx:javafx-base")

Expand Down Expand Up @@ -526,6 +526,10 @@ mavenPublishing {
}
}

tasks.withType<GenerateModuleMetadata> {
suppressedValidationErrors.add("dependencies-without-versions")
}

tasks.named<Jar>("sourcesJar") {
dependsOn(
tasks.named("generateGrammarSource"),
Expand All @@ -537,8 +541,13 @@ tasks.named<Jar>("sourcesJar") {
)
}

tasks.withType<GenerateModuleMetadata> {
suppressedValidationErrors.add("enforced-platform")

// Include the BOM in the generated POM ("inline" / "inlining")
// Source: https://github.com/gradle/gradle/issues/10861#issuecomment-3027387345
publishing.publications.withType<MavenPublication>().configureEach {
versionMapping {
allVariants { fromResolutionResult() }
}
}

javaModuleTesting.whitebox(testing.suites["test"]) {
Expand Down
Binary file not shown.
23 changes: 0 additions & 23 deletions jablib/lib/com/lihaoyi/fastparse/2.3.3/fastparse-2.3.3.pom

This file was deleted.

Binary file removed jablib/lib/com/lihaoyi/geny/0.6.10/geny-0.6.10.jar
Binary file not shown.
6 changes: 0 additions & 6 deletions jablib/lib/com/lihaoyi/geny/0.6.10/geny-0.6.10.pom

This file was deleted.

Binary file not shown.
6 changes: 0 additions & 6 deletions jablib/lib/com/lihaoyi/sourcecode/0.2.3/sourcecode-0.2.3.pom

This file was deleted.

9 changes: 9 additions & 0 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
jdk:
- openjdk24
before_install:
- cd build-logic
- git clone https://github.com/koppor/java-module-packaging.git
- cd ..
install:
- ./gradlew :versions:publishToMavenLocal
- ./gradlew :jablib:publishToMavenLocal