Skip to content

Commit

Permalink
Merge branch 'main' into Ignore-initial-unprotected-uppercase
Browse files Browse the repository at this point in the history
  • Loading branch information
michalfarago committed Oct 13, 2023
2 parents 4cf4119 + 44864fc commit 3697ced
Show file tree
Hide file tree
Showing 54 changed files with 253 additions and 5,608 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
run: gh pr merge --auto "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{secrets.GH_TOKEN_UPDATE_GRADLE_WRAPPER}}
2 changes: 1 addition & 1 deletion .github/workflows/cleanup_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Cancel deployment run
uses: styfle/cancel-workflow-action@0.11.0
uses: styfle/cancel-workflow-action@0.12.0
with:
ignore_sha: true
workflow_id: 9813 # workflow "Deployment"
Expand Down
21 changes: 4 additions & 17 deletions .github/workflows/refresh-csl-subtrees.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,23 @@ jobs:
- uses: actions/checkout@v4
with:
persist-credentials: true
fetch-depth: 0
submodules: 'true'
show-progress: 'false'
- name: Initialize git
run: |
git config --local core.editor /usr/bin/cat
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Update buildres/csl/csl-styles
- name: Update src/main/resources/csl-styles
run: |
cd buildres/csl/csl-styles
cd src/main/resources/csl-styles
git checkout master
git pull
cd ..
cd ..
cd ..
cp buildres/csl/csl-styles/acm-siggraph.csl src/main/resources/csl-styles/
cp buildres/csl/csl-styles/apa.csl src/main/resources/csl-styles/
cp buildres/csl/csl-styles/ieee.csl src/main/resources/csl-styles/
cp buildres/csl/csl-styles/turabian-author-date.csl src/main/resources/csl-styles/
- name: Update buildres/csl/csl-locales
- name: Update src/main/resources/csl-locales
run: |
cd buildres/csl/csl-locales
cd src/main/resources/csl-locales
git checkout master
git pull
cd ..
cd ..
cd ..
cp buildres/csl/csl-locales/locales.json src/main/resources/csl-locales/
cp buildres/csl/csl-locales/locales-en-US.xml src/main/resources/csl-locales/
- uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GH_TOKEN_UPDATE_GRADLE_WRAPPER }}
Expand Down
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
path = buildres/abbrv.jabref.org
url = https://github.com/JabRef/abbrv.jabref.org.git
[submodule "buildres/csl-styles"]
path = buildres/csl/csl-styles
path = src/main/resources/csl-styles
url = https://github.com/citation-style-language/styles.git
[submodule "buildres/csl-locales"]
path = buildres/csl/csl-locales
path = src/main/resources/csl-locales
url = https://github.com/citation-style-language/locales.git
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- When searching for an identifier in the "Web search", the title of the search window is now "Identifier-based Web Search". [#10391](https://github.com/JabRef/jabref/pull/10391)
- The ampersand checker now skips verbatim fields (`file`, `url`, ...). [#10419](https://github.com/JabRef/jabref/pull/10419)
- If no existing document is selected for exporting "XMP annotated pdf" JabRef will now create a new PDF file with a sample text and the metadata. [#10102](https://github.com/JabRef/jabref/issues/10102)
- We modified the DOI cleanup to infer the DOI from an ArXiV ID if it's present. [10426](https://github.com/JabRef/jabref/issues/10426)
- We modified the DOI cleanup to infer the DOI from an ArXiV ID if it's present. [#10426](https://github.com/JabRef/jabref/issues/10426)
- The ISI importer uses the field `comment` for notes (instead of `review). [#10478](https://github.com/JabRef/jabref/pull/10478)
- If no existing document is selected for exporting "Embedded BibTeX pdf" JabRef will now create a new PDF file with a sample text and the metadata. [#10101](https://github.com/JabRef/jabref/issues/10101)

### Fixed

- We fixed an issue where "Move URL in note field to url field" in the cleanup dialog caused an exception if no note field was present [forum#3999](https://discourse.jabref.org/t/cleanup-entries-cant-get-it-to-work/3999)
- It is possible again to use "current table sort order" for the order of entries when saving. [#9869](https://github.com/JabRef/jabref/issues/9869)
- Passwords can be stored in GNOME key ring. [#10274](https://github.com/JabRef/jabref/issues/10274)
- We fixed an issue where groups based on an aux file could not be created due to an exception [#10350](https://github.com/JabRef/jabref/issues/10350)
Expand All @@ -42,6 +45,10 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- JabRef does not hang anymore when exporting via CLI. [#10380](https://github.com/JabRef/jabref/issues/10380)
- We fixed an issue where it was not possible to save a library on a network share under macOS due to an exception when acquiring a file lock [#10452](https://github.com/JabRef/jabref/issues/10452)
- We fixed an issue where exporting "XMP annotated pdf" without selecting an existing document would produce an exception. [#10102](https://github.com/JabRef/jabref/issues/10102)
- We fixed an issue where the "Enabled" column in the "Protected terms files" tab in the preferences could not be resized [#10285](https://github.com/JabRef/jabref/issues/10285)
- We fixed an issue where after creation of a new library, the new library was not focused. [koppor#592](https://github.com/koppor/jabref/issues/592)
- We fixed an issue where double clicking on an url in the file field would trigger an exception instead of opening the browser [#10480](https://github.com/JabRef/jabref/pull/10480)
- We fixed an issue where exporting "Embedded BibTeX pdf" without selecting an existing document would produce an exception. [#10101](https://github.com/JabRef/jabref/issues/10101)

### Removed

Expand Down Expand Up @@ -83,7 +90,6 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We added a privacy policy. [#10064](https://github.com/JabRef/jabref/issues/10064)
- We added a tooltip to show the number of entries in a group [#10208](https://github.com/JabRef/jabref/issues/10208)
- We fixed an issue where it was no longer possible to add or remove selected entries to groups via context menu [#10404](https://github.com/JabRef/jabref/issues/10404), [#10317](https://github.com/JabRef/jabref/issues/10317) [#10374](https://github.com/JabRef/jabref/issues/10374)
- We fixed an issue where "Move URL in note field to url field" in the cleanup dialog caused an exception if no note field was present [forum#3999](https://discourse.jabref.org/t/cleanup-entries-cant-get-it-to-work/3999)

### Changed

Expand Down
16 changes: 4 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ plugins {

id 'idea'

id 'org.openrewrite.rewrite' version '6.3.16'
id 'org.openrewrite.rewrite' version '6.3.18'
}

// Enable following for debugging
Expand Down Expand Up @@ -237,7 +237,7 @@ dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.0'
testImplementation 'org.junit.platform:junit-platform-launcher:1.10.0'

testImplementation 'org.mockito:mockito-core:5.5.0'
testImplementation 'org.mockito:mockito-core:5.6.0'
testImplementation 'org.xmlunit:xmlunit-core:2.9.1'
testImplementation 'org.xmlunit:xmlunit-matchers:2.9.1'
testRuntimeOnly 'com.tngtech.archunit:archunit-junit5-engine:1.1.0'
Expand All @@ -246,12 +246,12 @@ dependencies {
testImplementation "org.testfx:testfx-junit5:4.0.16-alpha"
testImplementation "org.hamcrest:hamcrest-library:2.2"

checkstyle 'com.puppycrawl.tools:checkstyle:10.12.3'
checkstyle 'com.puppycrawl.tools:checkstyle:10.12.4'
// xjc needs the runtime as well for the ant task, otherwise it fails
xjc group: 'org.glassfish.jaxb', name: 'jaxb-xjc', version: '3.0.2'
xjc group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '3.0.2'

rewrite(platform("org.openrewrite.recipe:rewrite-recipe-bom:2.3.0"))
rewrite(platform("org.openrewrite.recipe:rewrite-recipe-bom:2.3.1"))
rewrite("org.openrewrite.recipe:rewrite-static-analysis")
rewrite("org.openrewrite.recipe:rewrite-logging-frameworks")
rewrite("org.openrewrite.recipe:rewrite-testing-frameworks")
Expand All @@ -264,14 +264,6 @@ clean {
}

processResources {
gradle.taskGraph.whenReady {
if (gradle.taskGraph.hasTask(":jpackage")) {
logger.info('Adding buildres/csl to resources')
from("buildres/csl")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
}

filteringCharset = 'UTF-8'

filesMatching("build.properties") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,18 @@ In the following, we will use `c:\git-repositories` as base folder:
cd \
mkdir git-repositories
cd git-repositories
git clone --depth=10 https://github.com/JabRef/jabref.git JabRef
cd jabref
git clone --recurse-submodules https://github.com/JabRef/jabref.git JabRef
cd JabRef
git remote rename origin upstream
git remote add origin https://github.com/YOUR_USERNAME/jabref.git
git fetch --all
git branch --set-upstream-to=origin/main main
```

{: .important }
> Note that putting the repo JabRef directly on `C:\` or any other drive letter on Windows causes compile errors (**negative example**: `C:\jabref`).
> `--recurse-submodules` is necessary to have the required files available to JabRef. (Background: It concerns the files from [citation-style-language/styles](https://github.com/citation-style-language/styles) and more).
>
> Further, if you are building on Windows, make sure that the absolute path to the location of the clone does not contain folders starting with '`u`' (**negative example**: `C:\university\jabref`) as this may currently also cause [compile errors](https://github.com/JabRef/jabref/issues/9783).
> Note that putting the repo JabRef directly on `C:\` or any other drive letter on Windows causes compile errors (**negative example**: `C:\jabref`).
>
> Please really ensure that you pass `JabRef` as parameter. Otherwise, you will get `java.lang.IllegalStateException: Module entity with name: jabref should be available`. See [IDEA-317606](https://youtrack.jetbrains.com/issue/IDEA-317606/Changing-only-the-case-of-the-Gradle-root-project-name-causes-exception-while-importing-project-java.lang.IllegalStateException) for details.
Expand All @@ -47,9 +48,6 @@ git branch --set-upstream-to=origin/main main
> To prevent this, first the `upstream` repository is cloned.
> This repository seems to live in the caches of GitHub.
>
> The `--depth--10` is used to limit the download to \~20 MB instead of downloading the complete history (\~800 MB).
> If you want to dig in our commit history, feel free to download everything.
>
> Now, you have two remote repositories, where `origin` is yours and `upstream` is the one of the JabRef organization.
>
> You can see it with `git remote -v`:
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=591855b517fc635b9e04de1d05d5e76ada3f89f5fc76f87978d1b245b4f69225
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionSha256Sum=3e1af3ae886920c3ac87f7a91f816c0c7c436f276a6eefdb3da152100fef72ae
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
14 changes: 7 additions & 7 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -202,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,7 @@ public void addTab(LibraryTab libraryTab, boolean raisePanel) {
tabbedPane.getTabs().add(libraryTab);
if (raisePanel) {
tabbedPane.getSelectionModel().select(libraryTab);
tabbedPane.requestFocus();
}

libraryTab.setOnCloseRequest(event -> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.jabref.gui.auximport;

import java.util.stream.Collectors;

import org.jabref.logic.auxparser.AuxParserResult;
import org.jabref.logic.l10n.Localization;

Expand All @@ -13,22 +15,22 @@ public AuxParserResultViewModel(AuxParserResult auxParserResult) {

/**
* Prints parsing statistics
*
* @param includeMissingEntries shows the missing entries as text (the GUI renderes them at another place)
*/
public String getInformation(boolean includeMissingEntries) {
StringBuilder result = new StringBuilder();
String missingEntries = "";
if (includeMissingEntries && (this.auxParserResult.getUnresolvedKeysCount() > 0)) {
missingEntries = this.auxParserResult.getUnresolvedKeys().stream().collect(Collectors.joining(", ", " (", ")"));
}

StringBuilder result = new StringBuilder();
result.append(Localization.lang("keys in library")).append(' ').append(this.auxParserResult.getMasterDatabase().getEntryCount()).append('\n')
.append(Localization.lang("found in AUX file")).append(' ').append(this.auxParserResult.getFoundKeysInAux()).append('\n')
.append(Localization.lang("resolved")).append(' ').append(this.auxParserResult.getResolvedKeysCount()).append('\n')
.append(Localization.lang("not found")).append(' ').append(this.auxParserResult.getUnresolvedKeysCount()).append('\n')
.append(Localization.lang("not found")).append(' ').append(this.auxParserResult.getUnresolvedKeysCount()).append(missingEntries).append('\n')
.append(Localization.lang("crossreferenced entries included")).append(' ').append(this.auxParserResult.getCrossRefEntriesCount()).append('\n')
.append(Localization.lang("strings included")).append(' ').append(this.auxParserResult.getInsertedStrings()).append('\n');

if (includeMissingEntries && (this.auxParserResult.getUnresolvedKeysCount() > 0)) {
for (String entry : this.auxParserResult.getUnresolvedKeys()) {
result.append(entry).append('\n');
}
}
if (this.auxParserResult.getNestedAuxCount() > 0) {
result.append(Localization.lang("nested AUX files")).append(' ').append(this.auxParserResult.getNestedAuxCount());
}
Expand Down
20 changes: 16 additions & 4 deletions src/main/java/org/jabref/gui/auximport/FromAuxDialog.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,40 @@
<?import javafx.scene.control.ListView?>
<?import javafx.scene.control.TextArea?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.control.Tooltip?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<?import org.jabref.gui.icon.JabRefIconView?>

<DialogPane xmlns:fx="http://javafx.com/fxml/1" prefHeight="650.0" prefWidth="500.0"
xmlns="http://javafx.com/javafx/8.0.121" fx:controller="org.jabref.gui.auximport.FromAuxDialog">
<content>
<VBox spacing="30">
<VBox spacing="5.0">
<Label text="%LaTeX AUX file:"/>
<HBox spacing="10">
<HBox spacing="10" alignment="BASELINE_LEFT">
<TextField fx:id="auxFileField" HBox.hgrow="ALWAYS"/>
<Button onAction="#browseButtonClicked" text="%Browse"/>
<Button onAction="#browseButtonClicked"
styleClass="icon-button,narrow"
minWidth="20.0" minHeight="20.0" prefHeight="20.0" prefWidth="20.0">
<graphic>
<JabRefIconView glyph="OPEN"/>
</graphic>
<tooltip>
<Tooltip text="%Browse"/>
</tooltip>
</Button>
</HBox>
<Button defaultButton="true" onAction="#parseActionPerformed" text="%Parse"/>
<Button defaultButton="true" onAction="#parseActionPerformed" text="%Parse" maxWidth="Infinity"/>
</VBox>
<VBox spacing="5">
<Label text="%Result">
<font>
<Font name="System Bold"/>
</font>
</Label>
<TextArea fx:id="statusInfos" editable="false" prefHeight="300.0"/>
<TextArea fx:id="statusInfos" editable="false" prefHeight="300.0" wrapText="true"/>
<Label text="%Unknown BibTeX entries:"/>
<ListView fx:id="notFoundList" prefHeight="200"/>
</VBox>
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/jabref/gui/desktop/JabRefDesktop.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ private static void openIsbn(String isbn, PreferencesService preferencesService)

/**
* Open an external file, attempting to use the correct viewer for it.
* If the "file" is an online link, instead open it with the browser
*
* @param databaseContext The database this file belongs to.
* @param link The filename.
Expand All @@ -160,7 +161,7 @@ public static boolean openExternalFileAnyFormat(final BibDatabaseContext databas
String link,
final Optional<ExternalFileType> type) throws IOException {
if (REMOTE_LINK_PATTERN.matcher(link.toLowerCase(Locale.ROOT)).matches()) {
openExternalFilePlatformIndependent(type, link, filePreferences);
openBrowser(link, filePreferences);
return true;
}
Optional<Path> file = FileUtil.find(databaseContext, link, filePreferences);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ public void execute() {
BackgroundTask<Optional<BibEntry>> backgroundTask = searchAndImportEntryInBackground();
backgroundTask.titleProperty().set(Localization.lang("Import by ID"));
backgroundTask.showToUser(true);
backgroundTask.onRunning(() -> dialogService.notify("%s".formatted(backgroundTask.messageProperty().get())));
backgroundTask.onRunning(() -> {
entryFromIdPopOver.hide();
dialogService.notify("%s".formatted(backgroundTask.messageProperty().get()));
});
backgroundTask.onFailure(exception -> {
String fetcherExceptionMessage = exception.getMessage();

Expand Down Expand Up @@ -95,8 +98,6 @@ public void execute() {
} else {
dialogService.notify("No entry found or import canceled");
}

entryFromIdPopOver.hide();
});
backgroundTask.executeWith(taskExecutor);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ private String ellipseString(String s) {
}

public final void setEllipsisString(String value) {
ellipsisString.set((value == null) ? "" : value);
ellipsisString.set(value == null ? "" : value);
}

public String getEllipsisString() {
Expand Down
Loading

0 comments on commit 3697ced

Please sign in to comment.