Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
7 changes: 3 additions & 4 deletions .jbang/JabLsLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
//DEPS info.picocli:picocli:4.7.7

// from jabls
//DEPS com.fasterxml.jackson.core:jackson-annotations:2.20
//DEPS tools.jackson.core:jackson-core:3.0.2
//DEPS tools.jackson.core:jackson-databind:3.0.2
//DEPS tools.jackson.dataformat:jackson-dataformat-yaml:3.0.2
//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
Expand All @@ -28,6 +24,9 @@
//DEPS org.tinylog:tinylog-impl:2.7.0
//DEPS com.github.ben-manes.caffeine:caffeine:3.2.3
//DEPS org.apache.commons:commons-lang3:3.20.0
//DEPS tools.jackson.core:jackson-core:3.0.2
Copy link
Member

Choose a reason for hiding this comment

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

You need the annotations for stuff like @JSON...

Copy link
Member Author

Choose a reason for hiding this comment

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

I not really get why, but I needed to re-add.

But I could remove other dependencies as they should come in via jablib transitive dependencies.

//DEPS tools.jackson.core:jackson-databind:3.0.2
//DEPS tools.jackson.dataformat:jackson-dataformat-yaml:3.0.2

//SOURCES ../jabls/src/main/java/org/jabref/languageserver/BibtexTextDocumentService.java
//SOURCES ../jabls/src/main/java/org/jabref/languageserver/BibtexWorkspaceService.java
Expand Down
1 change: 0 additions & 1 deletion jablib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,6 @@ javaModuleTesting.whitebox(testing.suites["test"]) {
requires.add("org.xmlunit")
requires.add("org.xmlunit.matchers")


requires.add("com.tngtech.archunit")
requires.add("com.tngtech.archunit.junit5.api")
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
import com.tngtech.archunit.lang.syntax.ArchRuleDefinition;
import com.tngtech.archunit.library.GeneralCodingRules;

import static com.tngtech.archunit.base.DescribedPredicate.not;
import static com.tngtech.archunit.core.domain.JavaClass.Predicates.resideInAnyPackage;

/**
* This class checks JabRef's shipped classes for architecture quality.
* Does not analyze test classes. Hint from <a href="https://stackoverflow.com/a/44681895/873282">StackOverflow</a>
Expand Down Expand Up @@ -57,6 +60,19 @@ public void doNotUseSwing(JavaClasses classes) {
.check(classes);
}

@ArchTest
public void doNotUseJackson2(JavaClasses classes) {
// annotations still reside in com.fasterxml package:
ArchRuleDefinition.noClasses()
.should()
.dependOnClassesThat(
resideInAnyPackage("com.fasterxml..")
// https://github.com/FasterXML/jackson-databind/blob/37b593e4836af62a267f09d2193414078df36eb0/src/test/java/tools/jackson/databind/deser/AnySetterTest.java#L7C8-L7C42
.and(not(resideInAnyPackage("com.fasterxml.jackson.annotation..")))
)
.check(classes);
}

@ArchTest
public void doNotUseAssertJ(JavaClasses classes) {
ArchRuleDefinition.noClasses().should().accessClassesThat().resideInAPackage("org.assertj..")
Expand All @@ -66,7 +82,7 @@ public void doNotUseAssertJ(JavaClasses classes) {
@ArchTest
public void doNotUseJavaAWT(JavaClasses classes) {
ArchRuleDefinition.noClasses().that().areNotAnnotatedWith(AllowedToUseAwt.class)
.should().accessClassesThat().resideInAPackage(PACKAGE_JAVA_AWT)
.should().dependOnClassesThat().resideInAPackage(PACKAGE_JAVA_AWT)
.check(classes);
}

Expand Down
Loading