Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
* upstream/master:
  New Crowdin translations (#6028)
  Squashed 'src/main/resources/csl-locales/' changes from 4fa753374e..d73af4a3fe
  Squashed 'src/main/resources/csl-styles/' changes from 9e81857..f03dece
  Add deep link to uni Basel
  Refine information on codacy
  New Crowdin translations (#6020)
  Fix l10n
  New Crowdin translations (#6016)
  Update CleanupUrlFormatter.java
  Update URLUtil.java
  Fix modernizer warnings
  Remove unused error prone
  Use Java version class
  Remove commented out code
  Upgrade deprecated gradle API
  Add plugin scope
  New menu "Lookup"
  Fix casing of "LaTeX" --> either "Latex" (code) or "LaTeX" (code comments, user-facing)
  • Loading branch information
Siedlerchr committed Feb 27, 2020
2 parents be7d2e2 + 1d4efaa commit 30146a3
Show file tree
Hide file tree
Showing 108 changed files with 4,634 additions and 371 deletions.
147 changes: 64 additions & 83 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ plugins {
id 'application'
id "com.simonharrer.modernizer" version '1.8.0-1'
id 'me.champeau.gradle.jmh' version '0.5.0'
//id 'net.ltgt.errorprone' version '0.8.1'
id 'com.github.ben-manes.versions' version '0.28.0'
id 'org.javamodularity.moduleplugin' version '1.5.0'
id 'org.openjfx.javafxplugin' version '0.0.8'
Expand All @@ -46,10 +45,14 @@ apply from: 'eclipse.gradle'
group = "org.jabref"
version = project.findProperty('projVersion') ?: '100.0.0'

sourceCompatibility = 13
targetCompatibility = 13
java {
sourceCompatibility = JavaVersion.VERSION_13
targetCompatibility = JavaVersion.VERSION_13
}

mainClassName = "$moduleName/org.jabref.JabRefLauncher"
application {
mainClassName = "$moduleName/org.jabref.JabRefLauncher"
}

// TODO: Ugly workaround to temporarily ignore build errors to dependencies of latex2unicode
// These should be removed, as well as the files in the lib folder, as soon as they have valid module names
Expand Down Expand Up @@ -91,7 +94,6 @@ repositories {
}

configurations {
//errorprone
libreoffice

// TODO: Remove the following workaround for split error messages such as
Expand All @@ -108,121 +110,108 @@ javafx {

dependencies {
// Include all jar-files in the 'lib' folder as dependencies
compile fileTree(dir: 'lib', includes: ['*.jar'])
implementation fileTree(dir: 'lib', includes: ['*.jar'])

compile 'org.apache.pdfbox:pdfbox:2.0.18'
compile 'org.apache.pdfbox:fontbox:2.0.18'
compile 'org.apache.pdfbox:xmpbox:2.0.18'
implementation 'org.apache.pdfbox:pdfbox:2.0.18'
implementation 'org.apache.pdfbox:fontbox:2.0.18'
implementation 'org.apache.pdfbox:xmpbox:2.0.18'

compile group: 'org.apache.commons', name: 'commons-csv', version: '1.8'
implementation group: 'org.apache.commons', name: 'commons-csv', version: '1.8'

compile group: 'org.apache.tika', name: 'tika-core', version: '1.23'
implementation group: 'org.apache.tika', name: 'tika-core', version: '1.23'

// required for reading write-protected PDFs - see https://github.com/JabRef/jabref/pull/942#issuecomment-209252635
compile 'org.bouncycastle:bcprov-jdk15on:1.64'
implementation 'org.bouncycastle:bcprov-jdk15on:1.64'

compile 'commons-cli:commons-cli:1.4'
implementation 'commons-cli:commons-cli:1.4'

// For Java 9+ compatibility, we include a bundled version of the libreoffice libraries
// See https://bugs.documentfoundation.org/show_bug.cgi?id=117331#c8 for background information
// Use the task bundleLibreOffice to update the bundled jar
//compile "org.libreoffice:juh:6.2.3"
//compile "org.libreoffice:jurt:6.2.3"
//compile "org.libreoffice:ridl:6.2.3"
//compile "org.libreoffice:unoil:6.2.3"
//implementation "org.libreoffice:juh:6.2.3"
//implementation "org.libreoffice:jurt:6.2.3"
//implementation "org.libreoffice:ridl:6.2.3"
//implementation "org.libreoffice:unoil:6.2.3"

compile 'io.github.java-diff-utils:java-diff-utils:4.5'
compile 'info.debatty:java-string-similarity:1.2.1'
implementation 'io.github.java-diff-utils:java-diff-utils:4.5'
implementation 'info.debatty:java-string-similarity:1.2.1'

antlr3 'org.antlr:antlr:3.5.2'
compile 'org.antlr:antlr-runtime:3.5.2'
implementation 'org.antlr:antlr-runtime:3.5.2'

antlr4 'org.antlr:antlr4:4.8-1'
compile 'org.antlr:antlr4-runtime:4.8-1'
implementation 'org.antlr:antlr4-runtime:4.8-1'

compile group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '2.5.4'
implementation group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '2.5.4'

compile 'org.postgresql:postgresql:42.2.10'
implementation 'org.postgresql:postgresql:42.2.10'

compile ('com.oracle.ojdbc:ojdbc10:19.3.0.0') {
implementation ('com.oracle.ojdbc:ojdbc10:19.3.0.0') {
// causing module issues
exclude module: 'oraclepki'
}

compile ('com.google.guava:guava:28.2-jre') {
implementation ('com.google.guava:guava:28.2-jre') {
// TODO: Remove this as soon as https://github.com/google/guava/issues/2960 is fixed
exclude module: "jsr305"
}

compile group: 'jakarta.annotation', name: 'jakarta.annotation-api', version: '1.3.5'
implementation group: 'jakarta.annotation', name: 'jakarta.annotation-api', version: '1.3.5'

// JavaFX stuff
compile 'de.jensd:fontawesomefx-commons:11.0'
compile 'de.jensd:fontawesomefx-materialdesignfont:1.7.22-11'
compile 'de.saxsys:mvvmfx-validation:1.9.0-SNAPSHOT'
compile 'de.saxsys:mvvmfx:1.8.0'
compile 'org.fxmisc.easybind:easybind:1.0.3'
compile 'org.fxmisc.flowless:flowless:0.6.1'
compile 'org.fxmisc.richtext:richtextfx:0.10.4'
compile group: 'org.glassfish.hk2.external', name: 'jakarta.inject', version: '2.6.1'
compile 'com.jfoenix:jfoenix:9.0.9'
compile 'org.controlsfx:controlsfx:11.0.1'

compile 'org.jsoup:jsoup:1.12.2'
compile 'com.konghq:unirest-java:3.6.00'

compile 'org.slf4j:slf4j-api:2.0.0-alpha1'
compile group: 'org.apache.logging.log4j', name: 'log4j-jcl', version: '3.0.0-SNAPSHOT'
compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j18-impl', version: '3.0.0-SNAPSHOT'
compile group: 'org.apache.logging.log4j', name: 'log4j-plugins', version: '3.0.0-SNAPSHOT'
implementation 'de.jensd:fontawesomefx-commons:11.0'
implementation 'de.jensd:fontawesomefx-materialdesignfont:1.7.22-11'
implementation 'de.saxsys:mvvmfx-validation:1.9.0-SNAPSHOT'
implementation 'de.saxsys:mvvmfx:1.8.0'
implementation 'org.fxmisc.easybind:easybind:1.0.3'
implementation 'org.fxmisc.flowless:flowless:0.6.1'
implementation 'org.fxmisc.richtext:richtextfx:0.10.4'
implementation group: 'org.glassfish.hk2.external', name: 'jakarta.inject', version: '2.6.1'
implementation 'com.jfoenix:jfoenix:9.0.9'
implementation 'org.controlsfx:controlsfx:11.0.1'

implementation 'org.jsoup:jsoup:1.12.2'
implementation 'com.konghq:unirest-java:3.6.00'

implementation 'org.slf4j:slf4j-api:2.0.0-alpha1'
implementation group: 'org.apache.logging.log4j', name: 'log4j-jcl', version: '3.0.0-SNAPSHOT'
implementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j18-impl', version: '3.0.0-SNAPSHOT'
implementation group: 'org.apache.logging.log4j', name: 'log4j-plugins', version: '3.0.0-SNAPSHOT'
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '3.0.0-SNAPSHOT'
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '3.0.0-SNAPSHOT'
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '3.0.0-SNAPSHOT'
annotationProcessor group: 'org.apache.logging.log4j', name: 'log4j-core', version: '3.0.0-SNAPSHOT'

compile 'de.undercouch:citeproc-java:2.0.0'
implementation 'de.undercouch:citeproc-java:2.0.0'

compile group: 'jakarta.activation', name: 'jakarta.activation-api', version: '1.2.1'
compile group: 'jakarta.xml.bind', name: 'jakarta.xml.bind-api', version: '2.3.2'
compile group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '2.3.2'
implementation group: 'jakarta.activation', name: 'jakarta.activation-api', version: '1.2.1'
implementation group: 'jakarta.xml.bind', name: 'jakarta.xml.bind-api', version: '2.3.2'
implementation group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '2.3.2'

compile ('com.github.tomtung:latex2unicode_2.12:0.2.6') {
implementation ('com.github.tomtung:latex2unicode_2.12:0.2.6') {
exclude module: 'fastparse_2.12'
}

/*
TODO: Reenable error prone as soon as https://github.com/google/error-prone/issues/1210 is fixed
errorprone ('com.google.errorprone:error_prone_core:2.3.2') {
exclude module: "jsr305"
exclude group: 'org.checkerframework', module: 'checker-qual'
exclude group: 'com.google.errorprone', module: 'error_prone_annotation'
exclude group: 'com.google.errorprone', module: 'error_prone_annotations'
exclude group: 'com.google.errorprone', module: 'error_prone_check_api'
}
*/

compile group: 'com.microsoft.azure', name: 'applicationinsights-core', version: '2.4.1'
compile (group: 'com.microsoft.azure', name: 'applicationinsights-logging-log4j2', version: '2.4.1') {
implementation group: 'com.microsoft.azure', name: 'applicationinsights-core', version: '2.4.1'
implementation (group: 'com.microsoft.azure', name: 'applicationinsights-logging-log4j2', version: '2.4.1') {
exclude module: "log4j-core"
}


testCompile 'io.github.classgraph:classgraph:4.8.65'
testImplementation 'io.github.classgraph:classgraph:4.8.65'
testImplementation 'org.junit.jupiter:junit-jupiter:5.6.0'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.6.0'
testCompile 'org.junit.platform:junit-platform-launcher:1.6.0'
testImplementation 'org.junit.platform:junit-platform-launcher:1.6.0'

testCompile 'net.bytebuddy:byte-buddy-parent:1.10.8'
testImplementation 'net.bytebuddy:byte-buddy-parent:1.10.8'
testRuntime group: 'org.apache.logging.log4j', name: 'log4j-core', version: '3.0.0-SNAPSHOT'
testRuntime group: 'org.apache.logging.log4j', name: 'log4j-jul', version: '3.0.0-SNAPSHOT'
testCompile 'org.mockito:mockito-core:3.3.0'
//testCompile 'com.github.tomakehurst:wiremock:2.24.1'
testCompile 'org.xmlunit:xmlunit-core:2.6.3'
testCompile 'org.xmlunit:xmlunit-matchers:2.6.3'
testCompile 'com.tngtech.archunit:archunit-junit5-api:0.13.1'
//testRuntime 'com.tngtech.archunit:archunit-junit5-engine:0.13.0'
testCompile "org.testfx:testfx-core:4.0.17-alpha-SNAPSHOT"
testCompile "org.testfx:testfx-junit5:4.0.17-alpha-SNAPSHOT"
testCompile "org.hamcrest:hamcrest-library:2.2"
testImplementation 'org.mockito:mockito-core:3.3.0'
testImplementation 'org.xmlunit:xmlunit-core:2.6.3'
testImplementation 'org.xmlunit:xmlunit-matchers:2.6.3'
testImplementation 'com.tngtech.archunit:archunit-junit5-api:0.13.1'
testImplementation "org.testfx:testfx-core:4.0.17-alpha-SNAPSHOT"
testImplementation "org.testfx:testfx-junit5:4.0.17-alpha-SNAPSHOT"
testImplementation "org.hamcrest:hamcrest-library:2.2"

checkstyle 'com.puppycrawl.tools:checkstyle:8.29'
xjc group: 'org.glassfish.jaxb', name: 'jaxb-xjc', version: '2.3.2'
Expand Down Expand Up @@ -310,7 +299,6 @@ processResources {
}
}


task generateSource(dependsOn: ["generateBstGrammarSource",
"generateSearchGrammarSource",
"generateMedlineSource",
Expand Down Expand Up @@ -379,7 +367,6 @@ task generateModsSource(type: XjcTask) {
}

tasks.withType(JavaCompile) {
// use UTF-8
options.encoding = 'UTF-8'
}

Expand Down Expand Up @@ -552,12 +539,6 @@ checkstyle {
sourceSets = []
}

modernizer {
// We have more than 20 issues, which are not fixed yet. Nevertheless, we produce the modernizer output.
// See https://github.com/andrewgaul/modernizer-maven-plugin for more information on modernizer
failOnViolations = false
}

// Release tasks
task deleteInstallerTemp(type: Delete) {
delete "$buildDir/installer"
Expand Down
8 changes: 7 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@

This page presents all development informatation around JabRef. For users documentation see <https://docs.jabref.org>.

## Excersises

Uni Basel offers a German (🇩🇪) Software Engineering course which uses JabRef as one example.
Look at [Exercise 5](https://github.com/unibas-marcelluethi/software-engineering/blob/master/docs/week5/exercises/practical-exercises.md) for an exercise where some important points of JabRef are touched.

## How tos

- [Sync your fork with the JabRef repository](https://help.github.com/articles/syncing-a-fork/)
- External: [Sync your fork with the JabRef repository](https://help.github.com/articles/syncing-a-fork/)
- External (🇩🇪): Branches and pull requests: <https://github.com/unibas-marcelluethi/software-engineering/blob/master/docs/week2/exercises/practical-exercises.md>

## Command Line

Expand Down
2 changes: 1 addition & 1 deletion docs/code-quality.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

We monitor the general source code quality at three places:

* [codacy](https://www.codacy.com/) is a hosted service to monitor code quality. The code quality analysis for JabRef is available at <https://app.codacy.com/gh/JabRef/jabref/dashboard>, especially the [list of open issues](https://app.codacy.com/gh/JabRef/jabref/issues/index).
* [codacy](https://www.codacy.com/) is a hosted service to monitor code quality. It thereby combines the results of available open source code quality checkers such as [Checkstyle](https://checkstyle.sourceforge.io/) or [PMD](https://pmd.github.io/). The code quality analysis for JabRef is available at <https://app.codacy.com/gh/JabRef/jabref/dashboard>, especially the [list of open issues](https://app.codacy.com/gh/JabRef/jabref/issues/index). In case a rule feels wrong, it is most likely a PMD rule. The JabRef team can change the configuration at <https://app.codacy.com/p/306789/patterns/list?engine=9ed24812-b6ee-4a58-9004-0ed183c45b8f>.
* [codecov](https://codecov.io/) is a solution to check code coverage of test cases. The code coverage metrics for JabRef are available at <https://codecov.io/github/JabRef/jabref>.
* [Teamscale](https://www.cqse.eu/de/produkte/teamscale/landing/) is a popular German product analyzing code quality. The analysis results are available at <https://demo.teamscale.com/findings.html#/jabref/?>.

Expand Down
5 changes: 5 additions & 0 deletions src/main/java/org/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,7 @@ private MenuBar createMenu() {
Menu edit = new Menu(Localization.lang("Edit"));
Menu library = new Menu(Localization.lang("Library"));
Menu quality = new Menu(Localization.lang("Quality"));
Menu lookup = new Menu(Localization.lang("Lookup"));
Menu view = new Menu(Localization.lang("View"));
Menu tools = new Menu(Localization.lang("Tools"));
Menu options = new Menu(Localization.lang("Options"));
Expand Down Expand Up @@ -764,6 +765,10 @@ private MenuBar createMenu() {
factory.createMenuItem(StandardActions.SET_FILE_LINKS, new AutoLinkFilesAction(this, prefs, stateManager, undoManager, Globals.TASK_EXECUTOR))
);

lookup.getItems().addAll(
factory.createMenuItem(StandardActions.FIND_DUPLICATES, new DuplicateSearch(this, dialogService, stateManager))
);

// PushToApplication
final PushToApplicationAction pushToApplicationAction = pushToApplicationsManager.getPushToApplicationAction();
final MenuItem pushToApplicationMenuItem = factory.createMenuItem(pushToApplicationAction.getActionInformation(), pushToApplicationAction);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public LatexCitationsTabViewModel(BibDatabaseContext databaseContext, Preference
this.preferencesService = preferencesService;
this.taskExecutor = taskExecutor;
this.dialogService = dialogService;
this.directory = new SimpleObjectProperty<>(databaseContext.getMetaData().getLaTexFileDirectory(preferencesService.getUser())
this.directory = new SimpleObjectProperty<>(databaseContext.getMetaData().getLatexFileDirectory(preferencesService.getUser())
.orElseGet(preferencesService::getWorkingDir));
this.citationList = FXCollections.observableArrayList();
this.status = new SimpleObjectProperty<>(Status.IN_PROGRESS);
Expand Down Expand Up @@ -126,7 +126,7 @@ private void cancelSearch() {
}

private Collection<Citation> searchAndParse(String citeKey) throws IOException {
Path newDirectory = databaseContext.getMetaData().getLaTexFileDirectory(preferencesService.getUser())
Path newDirectory = databaseContext.getMetaData().getLatexFileDirectory(preferencesService.getUser())
.orElseGet(preferencesService::getWorkingDir);

if (texParserResult == null || !newDirectory.equals(directory.get())) {
Expand Down Expand Up @@ -168,7 +168,7 @@ public void setLatexDirectory() {
.withInitialDirectory(directory.get()).build();

dialogService.showDirectorySelectionDialog(directoryDialogConfiguration).ifPresent(selectedDirectory ->
databaseContext.getMetaData().setLaTexFileDirectory(preferencesService.getUser(), selectedDirectory.toAbsolutePath()));
databaseContext.getMetaData().setLatexFileDirectory(preferencesService.getUser(), selectedDirectory.toAbsolutePath()));

init(currentEntry);
}
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/org/jabref/gui/fieldeditors/URLUtil.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.jabref.gui.fieldeditors;

import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLDecoder;
Expand Down Expand Up @@ -53,15 +52,15 @@ public static String cleanGoogleSearchURL(String url) {
if (pair.startsWith("url=")) {
String value = pair.substring(pair.indexOf('=') + 1);

String decode = URLDecoder.decode(value, StandardCharsets.UTF_8.name());
String decode = URLDecoder.decode(value, StandardCharsets.UTF_8);
// url?
if (decode.matches(URL_EXP)) {
return decode;
}
}
}
return url;
} catch (UnsupportedEncodingException | MalformedURLException e) {
} catch (MalformedURLException e) {
return url;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ public void openHelpPage() {
private List<Path> getFileDirectoriesAsPaths() {
List<Path> fileDirs = new ArrayList<>();
MetaData metaData = currentDatabase.getMetaData();
metaData.getLaTexFileDirectory(preferencesService.getFilePreferences().getUser()).ifPresent(fileDirs::add);
metaData.getLatexFileDirectory(preferencesService.getFilePreferences().getUser()).ifPresent(fileDirs::add);

return fileDirs;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@
<Button text="%Browse" GridPane.columnIndex="2" GridPane.rowIndex="5"
onAction="#browseUserSpecificFileDirectory"/>

<Label text="%LaTex file directory" GridPane.columnIndex="0" GridPane.rowIndex="6"/>
<Label text="%LaTeX file directory" GridPane.columnIndex="0" GridPane.rowIndex="6"/>
<TextField fx:id="laTexFileDirectory" GridPane.columnIndex="1" GridPane.rowIndex="6"/>
<Button text="%Browse" onAction="#browseLaTexFileDirectory" GridPane.columnIndex="2"
<Button text="%Browse" onAction="#browseLatexFileDirectory" GridPane.columnIndex="2"
GridPane.rowIndex="6"/>
</GridPane>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ public void browseUserSpecificFileDirectory(ActionEvent event) {
}

@FXML
void browseLaTexFileDirectory(ActionEvent event) {
viewModel.browseLaTexDir();
void browseLatexFileDirectory(ActionEvent event) {
viewModel.browseLatexDir();
}

private void storeSettings() {
Expand Down Expand Up @@ -143,9 +143,9 @@ private void storeSettings() {

text = viewModel.laTexFileDirectoryProperty().getValue();
if (text.isEmpty()) {
metaData.clearLaTexFileDirectory(preferencesService.getUser());
metaData.clearLatexFileDirectory(preferencesService.getUser());
} else {
metaData.setLaTexFileDirectory(preferencesService.getUser(), Paths.get(text));
metaData.setLatexFileDirectory(preferencesService.getUser(), Paths.get(text));
}

if (viewModel.libraryProtectedProperty().getValue()) {
Expand Down
Loading

0 comments on commit 30146a3

Please sign in to comment.