Skip to content

Commit

Permalink
Merge pull request #1377 from tobiasdiez/mergeMaster
Browse files Browse the repository at this point in the history
Merge master into javafx branch
  • Loading branch information
tobiasdiez committed May 10, 2016
2 parents f954e0b + 86fdb4d commit 3fe2645
Show file tree
Hide file tree
Showing 730 changed files with 9,438 additions and 6,323 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
JabRef version <version as shown in the about box> on <Windows 10|Ubuntu 14.04|Mac OS X 10.8|...>
Hint: If you use a [development version](http://builds.jabref.org/master/), ensure that you use the latest one.
<Hint: If you use a [development version](http://builds.jabref.org/master/), ensure that you use the latest one.>

Steps to reproduce:

1. ...
2. ...
3. ...

If applicable, excerpt of the bibliography file, screenshot, and excerpt of log (available in the error console)
<If applicable, excerpt of the bibliography file, screenshot, and excerpt of log (available in the error console)>
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ after_script:
- bash <(curl -s https://codecov.io/bash)

# cache gradle dependencies
# https://docs.travis-ci.com/user/languages/java#Caching
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
cache:
directories:
- $HOME/.gradle/caches/
Expand Down
31 changes: 30 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,43 @@ to [sourceforge feature requests](https://sourceforge.net/p/jabref/features/) by
## [Unreleased]

### Changed
- Implemented [#629](https://github.com/JabRef/jabref/issues/629): Explicit groups are now written in the "groups" field of the entry instead of at the end of the bib file
- Main table now accepts pasted DOIs and tries to retrieve the entry
- Added support for several Biblatex-fields through drop-down lists with valid alternatives
- Added integrity checker for an odd number of unescaped '#'
- Implemented [feature request 384](https://sourceforge.net/p/jabref/features/384): The merge entries dialog now show all text and colored differences between the fields
- Partly switched to new UI technology (JavaFX). Redesigned about dialog.
- Implemented [#1233](https://github.com/JabRef/jabref/issues/1233): Group side pane now takes up all the remaining space
- Added integrity check detecting HTML-encoded characters
- Added missing help files
- Implemented [feature request #1294](https://github.com/JabRef/jabref/issues/1294): Added possibility to filter for `*.jstyle` files in OpenOffice/LibreOffice style selection dialog. Open style selection dialog in directory of last selected file
- Added integrity check for ISSN
- Add LaTeX to Unicode converter as cleanup operation
- Added an option in the about dialog to easily copy the version information of JabRef
- Integrity check table can be sorted by clicking on column headings

### Fixed
- Fixed [#473](https://github.com/JabRef/jabref/issues/473): Values in an entry containing symbols like ' are now properly escaped for exporting to the database
- Fixed [#1270](https://github.com/JabRef/jabref/issues/1270): Auto save is now working again as expected (without leaving a bunch of temporary files behind)
- Fixed [#1234](https://github.com/JabRef/jabref/issues/1234): NPE when getting information from retrieved DOI
- Fixed [#1245](https://github.com/JabRef/jabref/issues/1245): Empty jstyle properties can now be specified as ""
- Fixed [#1259](https://github.com/JabRef/jabref/issues/1259): NPE when sorting tabs
- Fixed display bug in the cleanup dialog: field formatters are now correctly displayed using their name
- Fixed [#1271](https://github.com/JabRef/jabref/issues/1271): Authors with compound first names are displayed properly
- Fixed: Selecting invalid jstyle causes NPE and prevents opening of style selection dialog
- Fixed: Move linked files to default directory works again
- Fixed [#1327](https://github.com/JabRef/jabref/issues/1327): PDF cleanup changes order of linked pdfs
- Fixed [#1313](https://github.com/JabRef/jabref/issues/1313): Remove UI for a configuration option which was no longer available
- Fixed [#1340](https://github.com/JabRef/jabref/issues/1340): Edit -> Mark Specific Color Dysfunctional on OSX
- Fixed [#1245](https://github.com/JabRef/jabref/issues/1245): Empty jstyle properties can now be specified as ""
- Fixed [#1364](https://github.com/JabRef/jabref/issues/1364): Windows: install to LOCALAPPDATA directory for non-admin users
- Fixed [#1365](https://github.com/JabRef/jabref/issues/1365): Default label pattern back to "[auth][year]"
- Fixed [#796](https://github.com/JabRef/jabref/issues/796): Undoing more than one entry at the same time is now working

### Removed

- Removed possibility to export entries/databases to an `.sql` file, as the logic cannot easily use the correct escape logic
- Removed support of old groups format, which was used prior to JabRef version 1.6. If you happen to have a 10 years old .bib file, then JabRef 3.3 can be used to convert it to the current format.
- Removed possibility to automatically add braces via Option - Preferences - File - Store the following fields with braces around capital letters. Please use save actions instead for adding braces automatically.



Expand Down Expand Up @@ -88,8 +115,10 @@ to [sourceforge feature requests](https://sourceforge.net/p/jabref/features/) by
- Implemented [#672](https://github.com/JabRef/jabref/issues/672): FileList now distributes its space dependent on the width of its columns
- Added missing German translations
- Swedish is added as a language option (still not a complete translation)
- [#969](https://github.com/JabRef/jabref/issues/969) Adding and replacing old event system mechanisms with Google Guava EventBus.

### Fixed
- Alleviate multiuser concurrency issue when near simultaneous saves occur to a shared database file
- Fixed [#318](https://github.com/JabRef/jabref/issues/318): Improve normalization of author names
- Fixed [#598](https://github.com/JabRef/jabref/issues/598) and [#402](https://github.com/JabRef/jabref/issues/402): No more issues with invalid icons for ExternalFileTypes in global search or after editing the settings
- Fixed [#883](https://github.com/JabRef/jabref/issues/883): No NPE during cleanup
Expand Down
11 changes: 8 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,14 @@ because <additional rationale>.


### When adding a new Localization.lang entry
Run `python scripts/syncLang.py -s` to search for new untranslated strings.
If everything is OK, run `python scripts/syncLang.py -s -u` to update `JabRef_en.properties`.

Add new Localization.lang("KEY") to Java file.
Tests fail. In the test output a snippet is generated which must be added to the English translation file. There is also a snippet generated for the non-English files, but this is irrelevant.
Add snippet to English translation file located at `src/main/resources/l10n/JabRef_en.properties`
With `gradlew -b localization.gradle generateMissingTranslationKeys` the "KEY" is added to the other translation files as well.
Tests are green again.

You can also directly run the specific test in your IDE. The test "LocalizationConsistencyTest" is placed under `src/test/java/net.sf.jabref.logic.l10n/LocalizationConsistencyTest.java`
Find more information in the [JabRef Wiki](https://github.com/JabRef/jabref/wiki/Code-Howtos#using-localization-correctly)


### Create a pull request
Expand Down
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ We use [install4j], the multi-platform installer builder.

### Background

JabRef is a graphical Java application for editing [BibTeX] and [Biblatex] (`.bib`) databases.
JabRef is a graphical Java application for editing [BibTeX] and [Biblatex] `.bib` databases.
JabRef lets you organize your entries into overlapping logical groups, and with a single click limit your view to a single group or an intersection or union of several groups.
You can customize the entry information shown in the main window, and sort by any of the standard BibTeX fields.
JabRef can autogenerate BibTeX keys for your entries.
Expand Down Expand Up @@ -87,6 +87,13 @@ and then generate the Eclipse `gradlew eclipse`.
For IntelliJ IDEA, just import the project via a Gradle Import by pointing at the `build.gradle`.


## Testing

`gradlew test` executes the normal unit tests.
If you want to test the UI, execute `gradlew integrationTest`.
Sources for the integration test are kept in `src/integrationTest`.


## Release Process

Requires [install4j].
Expand All @@ -103,10 +110,10 @@ All binaries are created inside the directory `build/releases`.
### Releasing Developer Releases

Run `gradlew -Pdev=true ANY_RELEASE_TASK` to execute any of the previously defined release tasks.
The only difference is that the version contains the keyword *snapshot*, the *date*, the *branch name*, and the *shortend git hash*.
The only difference is that the version contains the keyword *snapshot*, the *date*, the *branch name*, and the *shortened git hash*.

Normal: `JabRef--3.0dev.jar`
With `-Pdev=true`: `JabRef-3.0dev--snapshot--2015-11-20--master--cc4f5d1.jar`
* Normal: `JabRef--3.0dev.jar`
* With `-Pdev=true`: `JabRef-3.0dev--snapshot--2015-11-20--master--cc4f5d1.jar`

## License

Expand Down
12 changes: 8 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,12 @@ dependencies {

compile 'org.swinglabs:swingx:1.6.1' // do not update, 1.6.5.1 is broken

compile 'org.apache.pdfbox:pdfbox:1.8.11'
compile 'org.apache.pdfbox:fontbox:1.8.11'
compile 'org.apache.pdfbox:jempbox:1.8.11'
// update to 2.0.x is not possible - see https://github.com/JabRef/jabref/pull/1096#issuecomment-208857517
compile 'org.apache.pdfbox:pdfbox:1.8.12'
compile 'org.apache.pdfbox:fontbox:1.8.12'
compile 'org.apache.pdfbox:jempbox:1.8.12'

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

compile 'commons-cli:commons-cli:1.3.1'
Expand Down Expand Up @@ -110,7 +113,7 @@ dependencies {
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
testCompile 'com.github.tomakehurst:wiremock:1.58'
testCompile 'org.assertj:assertj-swing-junit:3.2.0'
testCompile 'org.assertj:assertj-swing-junit:3.3.0'
}

sourceSets {
Expand Down Expand Up @@ -329,6 +332,7 @@ task media(type: com.install4j.gradle.Install4jTask, dependsOn: "releaseJar") {
checkstyle {
// do not use other packages for checkstyle, excluding gen(erated) sources
checkstyleMain.source = "src/main/java"
toolVersion = '6.17'
}

task release(dependsOn: ["media", "releaseJar"]) {
Expand Down
5 changes: 5 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
coverage:
ignore:
- src/gen/.*
status:
patch: false
20 changes: 16 additions & 4 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">

<!--
Checkstyle configuration that checks the sun coding conventions from:
Expand Down Expand Up @@ -29,10 +29,22 @@

<module name="TreeWalker">

<!-- Checks for imports -->
<!-- See http://checkstyle.sf.net/config_import.html -->
<module name="UnusedImports"/>

<module name="RedundantImport"/>

<module name="AvoidStarImport"/>

<module name="IllegalImport"/>

<module name="ImportOrder">
<property name="groups" value="java,javax,net.sf.jabref,*"/>
<property name="ordered" value="true"/>
<property name="separated" value="true"/>
<property name="option" value="bottom"/>
<property name="sortStaticImportsAlphabetically" value="true"/>
</module>

</module>

</module>
6 changes: 5 additions & 1 deletion jabref.install4j
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,11 @@
<string>if (Util.hasFullAdminRights()) {
context.setInstallationDirectory(context.getInstallationDirectory());
} else {
context.setInstallationDirectory(new File(System.getProperty("user.home"), "JabRef"));
if (Util.isAtLeastWindowsVista()) {
context.setInstallationDirectory(new File(System.getProperty("LOCALAPPDATA"), "JabRef"));
} else {
context.setInstallationDirectory(new File(System.getProperty("user.home"), "JabRef"));
}
}
return true;</string>
</void>
Expand Down
4 changes: 4 additions & 0 deletions scripts/remove-git-markers-in-localization-files.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# call from project root via $ ruby remove-git-markers-in-localization-files.rb
Dir.glob("src/main/resources/l10n/*.properties") do |f|
File.write(f, IO.readlines(f).map { |line| line.strip.start_with?("<<<<<<<") || line.strip.start_with?("=======") || line.strip.start_with?(">>>>>>>") ? "" : line }.join(""))
end
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package net.sf.jabref.gui;

import javax.swing.*;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

import javax.swing.SwingUtilities;

/**
* Can catch any exceptions occuring on the EDT thread for assertion.
*/
Expand Down
46 changes: 36 additions & 10 deletions src/integrationTest/java/net/sf/jabref/gui/GUITest.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
package net.sf.jabref.gui;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

import javax.swing.JButton;

import net.sf.jabref.JabRefMain;
import net.sf.jabref.gui.dbproperties.DatabasePropertiesDialog;
import net.sf.jabref.gui.preftabs.PreferencesDialog;

import org.assertj.swing.core.GenericTypeMatcher;
import org.assertj.swing.dependency.jsr305.Nonnull;
import org.assertj.swing.fixture.AbstractWindowFixture;
import org.assertj.swing.fixture.DialogFixture;
import org.assertj.swing.fixture.FrameFixture;
import org.assertj.swing.image.ScreenshotTaker;
import org.assertj.swing.junit.testcase.AssertJSwingJUnitTestCase;
import org.assertj.swing.timing.Pause;
import org.junit.Ignore;
import org.junit.Test;

import javax.swing.*;

import static org.assertj.swing.finder.WindowFinder.findDialog;
import static org.assertj.swing.finder.WindowFinder.findFrame;
import static org.assertj.swing.launcher.ApplicationLauncher.application;
Expand Down Expand Up @@ -58,7 +67,7 @@ private void newDatabase(FrameFixture mainFrame) {
}

@Test
public void testCreateBibtexEntry() {
public void testCreateBibtexEntry() throws IOException {
FrameFixture mainFrame = findFrame(JabRefFrame.class).withTimeout(10_000).using(robot());

newDatabase(mainFrame);
Expand All @@ -72,20 +81,21 @@ protected boolean isMatching(@Nonnull JButton jButton) {
return "Book".equals(jButton.getText());
}
}).click();

takeScreenshot(mainFrame, "MainWindowWithOneDatabase");
exitJabRef(mainFrame);
}

@Ignore
@Test
public void testOpenAndSavePreferences() {
public void testOpenAndSavePreferences() throws IOException {
FrameFixture mainFrame = findFrame(JabRefFrame.class).withTimeout(10_000).using(robot());
mainFrame.menuItemWithPath("Options", "Preferences").click();

robot().waitForIdle();

findDialog(PreferencesDialog.class).withTimeout(10_000).using(robot())
.button(new GenericTypeMatcher<JButton>(JButton.class) {
DialogFixture preferencesDialog = findDialog(PreferencesDialog.class).withTimeout(10_000).using(robot());
takeScreenshot(preferencesDialog, "PreferencesDialog");
preferencesDialog.button(new GenericTypeMatcher<JButton>(JButton.class) {

@Override
protected boolean isMatching(@Nonnull JButton jButton) {
Expand Down Expand Up @@ -117,7 +127,7 @@ public void testViewChanges() {
}

@Test
public void testDatabasePropertiesDialog() {
public void testDatabasePropertiesDialog() throws IOException {

FrameFixture mainFrame = findFrame(JabRefFrame.class).withTimeout(10_000).using(robot());
newDatabase(mainFrame);
Expand All @@ -126,8 +136,9 @@ public void testDatabasePropertiesDialog() {

robot().waitForIdle();

findDialog(DatabasePropertiesDialog.class).withTimeout(10_000).using(robot())
.button(new GenericTypeMatcher<JButton>(JButton.class) {
DialogFixture databasePropertiesDialog = findDialog(DatabasePropertiesDialog.class).withTimeout(10_000).using(robot());
takeScreenshot(databasePropertiesDialog, "DatabasePropertiesDialog");
databasePropertiesDialog.button(new GenericTypeMatcher<JButton>(JButton.class) {

@Override
protected boolean isMatching(@Nonnull JButton jButton) {
Expand All @@ -137,4 +148,19 @@ protected boolean isMatching(@Nonnull JButton jButton) {

exitJabRef(mainFrame);
}

private void takeScreenshot(AbstractWindowFixture<?, ?, ?> dialog, String filename) throws IOException {
ScreenshotTaker screenshotTaker = new ScreenshotTaker();
Path folder = Paths.get("build", "screenshots");
// Create build/srceenshots folder if not present
if (!Files.exists(folder)) {
Files.createDirectory(folder);
}
Path file = folder.resolve(filename + ".png").toAbsolutePath();
// Delete already present file
if (Files.exists(file)) {
Files.delete(file);
}
screenshotTaker.saveComponentAsPng(dialog.target(), file.toString());
}
}
Loading

0 comments on commit 3fe2645

Please sign in to comment.