Skip to content

Commit

Permalink
Merge branch 'main' into reduce-log-noise
Browse files Browse the repository at this point in the history
  • Loading branch information
koppor authored Mar 18, 2023
2 parents a16719e + b8497e9 commit f27797e
Show file tree
Hide file tree
Showing 21 changed files with 1,707 additions and 752 deletions.
3 changes: 3 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ The title of the PR must not reference an issue, because GitHub does not support
- [x] done; [ ] not done / not applicable
-->

```[tasklist]
### Compulsory checks
- [ ] Change in `CHANGELOG.md` described in a way that is understandable for the average user (if applicable)
- [ ] Tests created for changes (if applicable)
- [ ] Manually tested changed features in running JabRef (always required)
- [ ] Screenshots added in PR description (for UI changes)
- [ ] [Checked developer's documentation](https://devdocs.jabref.org/): Is the information available and up to date? If not, I outlined it in this pull request.
- [ ] [Checked documentation](https://docs.jabref.org/): Is the information available and up to date? If not, I created an issue at <https://github.com/JabRef/user-documentation/issues> or, even better, I submitted a pull request to the documentation repository.
```
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
### Changed

- 'Get full text' now also checks the file url. [#568](https://github.com/koppor/jabref/issues/568)
- We modified the `Add Group` dialog to use the most recently selected group hierarchical context. [#9141](https://github.com/JabRef/jabref/issues/9141)
- We refined the 'main directory not found' error message. [#9625](https://github.com/JabRef/jabref/pull/9625)
- JabRef writes a new backup file only if there is a change. Before, JabRef created a backup upon start. [#9679](https://github.com/JabRef/jabref/pull/9679)
- Backups of libraries are not stored per JabRef version, but collected together.
- We streamlined the paths for logs and backups: The parent path fragement is always `logs` or `backups`.
- `log.txt` now contains debug messages. Debugging needs to be enabled explicitly. [#9678](https://github.com/JabRef/jabref/pull/9678)
- `log.txt` does not contain entries for non-found files during PDF indexing. [#9678](https://github.com/JabRef/jabref/pull/9678)
- We modified the `Add Group` dialog to use the most recently selected group hierarchical context [#9141](https://github.com/JabRef/jabref/issues/9141)
- We improved the Medline importer to correctly import ISO dates for `revised`. [#9536](https://github.com/JabRef/jabref/issues/9536)



Expand Down
10 changes: 0 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ processResources {

task generateSource(dependsOn: ["generateBstGrammarSource",
"generateSearchGrammarSource",
"generateMedlineSource",
"generateBibtexmlSource",
"generateEndnoteSource",
"generateModsSource",
Expand Down Expand Up @@ -290,15 +289,6 @@ tasks.register("generateSearchGrammarSource", JavaExec) {
args = ["-o","src-gen/main/java/org/jabref/search" , "-visitor", "-no-listener", "-package", "org.jabref.search", "$projectDir/src/main/antlr4/org/jabref/search/Search.g4"]
}

task generateMedlineSource(type: XjcTask) {
group = 'JabRef'
description = "Generates java files for the medline importer."

schemaFile = "src/main/resources/xjc/medline/medline.xsd"
outputDirectory = "src-gen/main/java"
javaPackage = "org.jabref.logic.importer.fileformat.medline"
}

task generateBibtexmlSource(type: XjcTask) {
group = 'JabRef'
description = "Generates java files for the bibtexml importer."
Expand Down
2 changes: 1 addition & 1 deletion docs/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ gem "jekyll", "~> 4.3" # installed by `gem jekyll`
# Homepage: https://github.com/paulrobertlloyd/jekyll-figure#jekyll-figure
gem 'jekyll-figure'

gem "just-the-docs", "0.4.0.rc3"
gem "just-the-docs", "0.4.2"

gem "jekyll-remote-theme"

Expand Down
11 changes: 7 additions & 4 deletions src/main/java/org/jabref/cli/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.jabref.logic.remote.RemotePreferences;
import org.jabref.logic.remote.client.RemoteClient;
import org.jabref.logic.util.BuildInfo;
import org.jabref.logic.util.OS;
import org.jabref.migrations.PreferencesMigrations;
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.database.BibDatabaseMode;
Expand Down Expand Up @@ -90,10 +91,12 @@ public static void main(String[] args) {
* the log configuration programmatically anymore.
*/
private static void addLogToDisk() {
Path directory = Path.of(AppDirsFactory.getInstance().getUserLogDir(
"jabref",
new BuildInfo().version.toString(),
"org.jabref"));
Path directory = Path.of(AppDirsFactory.getInstance()
.getUserDataDir(
OS.APP_DIR_APP_NAME,
"logs",
OS.APP_DIR_APP_AUTHOR))
.resolve(new BuildInfo().version.toString());
try {
Files.createDirectories(directory);
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public BackupResolverDialog(Path originalPath) {
getDialogPane().setMinHeight(180);
getDialogPane().getButtonTypes().setAll(RESTORE_FROM_BACKUP, REVIEW_BACKUP, IGNORE_BACKUP);

Optional<Path> backupPathOpt = BackupFileUtil.getPathOfLatestExisingBackupFile(originalPath, BackupFileType.BACKUP);
Optional<Path> backupPathOpt = BackupFileUtil.getPathOfLatestExistingBackupFile(originalPath, BackupFileType.BACKUP);
String backupFilename = backupPathOpt.map(Path::getFileName).map(Path::toString).orElse(Localization.lang("File not found"));
String content = new StringBuilder()
.append(Localization.lang("A backup file for '%0' was found at [%1]",
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/dialogs/BackupUIManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private static Optional<ParserResult> showReviewBackupDialog(DialogService dialo
// This will be modified by using the `DatabaseChangesResolverDialog`.
BibDatabaseContext originalDatabase = originalParserResult.getDatabaseContext();

Path backupPath = BackupFileUtil.getPathOfLatestExisingBackupFile(originalPath, BackupFileType.BACKUP).orElseThrow();
Path backupPath = BackupFileUtil.getPathOfLatestExistingBackupFile(originalPath, BackupFileType.BACKUP).orElseThrow();
BibDatabaseContext backupDatabase = OpenDatabase.loadDatabase(backupPath, importFormatPreferences, new DummyFileUpdateMonitor()).getDatabaseContext();

DatabaseChangeResolverFactory changeResolverFactory = new DatabaseChangeResolverFactory(dialogService, originalDatabase, preferencesService.getBibEntryPreferences());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class BackupManager {
// During a write, the less recent backup file is deleted
private final Queue<Path> backupFilesQueue = new LinkedBlockingQueue<>();

private boolean needsBackup = true;
private boolean needsBackup = false;

BackupManager(BibDatabaseContext bibDatabaseContext, BibEntryTypesManager entryTypesManager, PreferencesService preferences) {
this.bibDatabaseContext = bibDatabaseContext;
Expand All @@ -87,7 +87,7 @@ static Path getBackupPathForNewBackup(Path originalPath) {
* Determines the most recent existing backup file name
*/
static Optional<Path> getLatestBackupPath(Path originalPath) {
return BackupFileUtil.getPathOfLatestExisingBackupFile(originalPath, BackupFileType.BACKUP);
return BackupFileUtil.getPathOfLatestExistingBackupFile(originalPath, BackupFileType.BACKUP);
}

/**
Expand Down
Loading

0 comments on commit f27797e

Please sign in to comment.