From 9b0dd5dc979bd490ae34f6d790c466b47c84c920 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Fri, 20 Dec 2019 18:53:08 +0100 Subject: [PATCH 01/13] Fix code style (#5772) --- src/main/java/org/jabref/JabRefGUI.java | 33 +++++++++++++------------ 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/main/java/org/jabref/JabRefGUI.java b/src/main/java/org/jabref/JabRefGUI.java index 76684d8e1ed..3d9b20c3ba3 100644 --- a/src/main/java/org/jabref/JabRefGUI.java +++ b/src/main/java/org/jabref/JabRefGUI.java @@ -79,7 +79,7 @@ private void openWindow(Stage mainStage) { mainStage.setWidth(Globals.prefs.getDouble(JabRefPreferences.SIZE_X)); mainStage.setHeight(Globals.prefs.getDouble(JabRefPreferences.SIZE_Y)); } - printWindowState(mainStage); + debugLogWindowState(mainStage); // We create a decoration pane ourselves for performance reasons // (otherwise it has to be injected later, leading to a complete redraw/relayout of the complete scene) @@ -204,33 +204,34 @@ private void saveWindowState(Stage mainStage) { Globals.prefs.putDouble(JabRefPreferences.POS_Y, mainStage.getY()); Globals.prefs.putDouble(JabRefPreferences.SIZE_X, mainStage.getWidth()); Globals.prefs.putDouble(JabRefPreferences.SIZE_Y, mainStage.getHeight()); - printWindowState(mainStage); + debugLogWindowState(mainStage); } /** - * outprints the Data from the Screen - * (only in debug mode) + * outprints the Data from the Screen (only in debug mode) + * * @param mainStage */ - private void printWindowState(Stage mainStage) { - StringBuilder bob = new StringBuilder(); - bob.append("SCREEN DATA:"); - bob.append("mainStage.WINDOW_MAXIMISED: " + mainStage.isMaximized() + "\n"); - bob.append("mainStage.POS_X: " + mainStage.getX() + "\n"); - bob.append("mainStage.POS_Y: " + mainStage.getY() + "\n"); - bob.append("mainStage.SIZE_X: " + mainStage.getWidth() + "\n"); - bob.append("mainStages.SIZE_Y: " + mainStage.getHeight() + "\n"); - LOGGER.debug(bob.toString()); + private void debugLogWindowState(Stage mainStage) { + if (LOGGER.isDebugEnabled()) { + StringBuilder debugLogString = new StringBuilder(); + debugLogString.append("SCREEN DATA:"); + debugLogString.append("mainStage.WINDOW_MAXIMISED: " + mainStage.isMaximized() + "\n"); + debugLogString.append("mainStage.POS_X: " + mainStage.getX() + "\n"); + debugLogString.append("mainStage.POS_Y: " + mainStage.getY() + "\n"); + debugLogString.append("mainStage.SIZE_X: " + mainStage.getWidth() + "\n"); + debugLogString.append("mainStages.SIZE_Y: " + mainStage.getHeight() + "\n"); + LOGGER.debug(debugLogString.toString()); + } } /** * Tests if the window coordinates are out of the mainscreen + * * @return outbounds */ private boolean isWindowPositionOutOfBounds() { - - return !Screen.getPrimary().getBounds().contains(Globals.prefs.getDouble(JabRefPreferences.POS_X) , Globals.prefs.getDouble(JabRefPreferences.POS_Y)); - + return !Screen.getPrimary().getBounds().contains(Globals.prefs.getDouble(JabRefPreferences.POS_X), Globals.prefs.getDouble(JabRefPreferences.POS_Y)); } private void openLastEditedDatabases() { From c19feb16139f7834043b2913f35e746387860cdf Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Fri, 20 Dec 2019 22:18:27 +0100 Subject: [PATCH 02/13] Fix Springer fetcher tests (#5773) --- .../logic/importer/fetcher/SpringerLink.java | 17 +++++++++-------- .../importer/fetcher/SpringerLinkTest.java | 3 +++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/jabref/logic/importer/fetcher/SpringerLink.java b/src/main/java/org/jabref/logic/importer/fetcher/SpringerLink.java index 28f2357efc5..98e313078dd 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/SpringerLink.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/SpringerLink.java @@ -20,14 +20,14 @@ /** * FulltextFetcher implementation that attempts to find a PDF URL at SpringerLink. - * + *

* Uses Springer API, see @link{https://dev.springer.com} */ public class SpringerLink implements FulltextFetcher { private static final Logger LOGGER = LoggerFactory.getLogger(SpringerLink.class); private static final String API_URL = "https://api.springer.com/meta/v1/json"; - private static final String API_KEY = "b0c7151179b3d9c1119cf325bca8460d"; + private static final String API_KEY = "a98b4a55181ffcd27259bea45edad12e"; private static final String CONTENT_HOST = "link.springer.com"; @Override @@ -45,13 +45,14 @@ public Optional findFullText(BibEntry entry) throws IOException { .queryString("api_key", API_KEY) .queryString("q", String.format("doi:%s", doi.get().getDOI())) .asJson(); + if (jsonResponse.getBody() != null) { + JSONObject json = jsonResponse.getBody().getObject(); + int results = json.getJSONArray("result").getJSONObject(0).getInt("total"); - JSONObject json = jsonResponse.getBody().getObject(); - int results = json.getJSONArray("result").getJSONObject(0).getInt("total"); - - if (results > 0) { - LOGGER.info("Fulltext PDF found @ Springer."); - pdfLink = Optional.of(new URL("http", CONTENT_HOST, String.format("/content/pdf/%s.pdf", doi.get().getDOI()))); + if (results > 0) { + LOGGER.info("Fulltext PDF found @ Springer."); + pdfLink = Optional.of(new URL("http", CONTENT_HOST, String.format("/content/pdf/%s.pdf", doi.get().getDOI()))); + } } } catch (UnirestException e) { LOGGER.warn("SpringerLink API request failed", e); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/SpringerLinkTest.java b/src/test/java/org/jabref/logic/importer/fetcher/SpringerLinkTest.java index 22d5964c6b6..275a5fb6761 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/SpringerLinkTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/SpringerLinkTest.java @@ -6,6 +6,7 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; +import org.jabref.support.DisabledOnCIServer; import org.jabref.testutils.category.FetcherTest; import org.junit.jupiter.api.BeforeEach; @@ -36,6 +37,7 @@ public void doiNotPresent() throws IOException { assertEquals(Optional.empty(), finder.findFullText(entry)); } + @DisabledOnCIServer("Disable on CI Server to not hit the API call limit") @Test public void findByDOI() throws IOException { entry.setField(StandardField.DOI, "10.1186/s13677-015-0042-8"); @@ -44,6 +46,7 @@ public void findByDOI() throws IOException { finder.findFullText(entry)); } + @DisabledOnCIServer("Disable on CI Server to not hit the API call limit") @Test public void notFoundByDOI() throws IOException { entry.setField(StandardField.DOI, "10.1186/unknown-doi"); From cb2173b653e9e9ac992ebd61f9878843cb92350f Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Fri, 20 Dec 2019 23:12:49 +0100 Subject: [PATCH 03/13] Normalize line ending in test file (#5775) --- .../BibTeXMLImporterTestArticle2.bib | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestArticle2.bib b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestArticle2.bib index 580a364c6a3..0dffe9854cf 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestArticle2.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestArticle2.bib @@ -1,9 +1,9 @@ -@article{Mustermann2016, - author = {Max Mustermann}, - journal = {Java Journal}, - keywords = {java}, - month = feb, - pages = {2}, - title = {Java tricks}, - year = {2016} -} +@article{Mustermann2016, + author = {Max Mustermann}, + journal = {Java Journal}, + keywords = {java}, + month = feb, + pages = {2}, + title = {Java tricks}, + year = {2016} +} From 5ffb1b2924691f132b578c86123248fe3355e3a7 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Fri, 20 Dec 2019 23:14:28 +0100 Subject: [PATCH 04/13] Fix Medline tests (#5774) - wait between calls to avoid 403 - remove assertion of entry not returned anymore --- .../org/jabref/logic/importer/IdBasedParserFetcher.java | 2 +- .../jabref/logic/importer/fetcher/MedlineFetcherTest.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/jabref/logic/importer/IdBasedParserFetcher.java b/src/main/java/org/jabref/logic/importer/IdBasedParserFetcher.java index 7083b8a5a9f..bcce10f292b 100644 --- a/src/main/java/org/jabref/logic/importer/IdBasedParserFetcher.java +++ b/src/main/java/org/jabref/logic/importer/IdBasedParserFetcher.java @@ -81,7 +81,7 @@ default Optional performSearchById(String identifier) throws FetcherEx } catch (URISyntaxException e) { throw new FetcherException("Search URI is malformed", e); } catch (IOException e) { - // TODO: Catch HTTP Response 401 errors and report that user has no rights to access resource + // TODO: Catch HTTP Response 401 errors and report that user has no rights to access resource. It might be that there is an UnknownHostException (eutils.ncbi.nlm.nih.gov cannot be resolved). throw new FetcherException("A network error occurred", e); } catch (ParseException e) { throw new FetcherException("An internal parser error occurred", e); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/MedlineFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/MedlineFetcherTest.java index c8bcfd12946..7ad94a2bfea 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/MedlineFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/MedlineFetcherTest.java @@ -24,7 +24,10 @@ public class MedlineFetcherTest { private BibEntry entryWijedasa, entryEndharti, bibEntryIchikawa, bibEntrySari; @BeforeEach - public void setUp() { + public void setUp() throws InterruptedException { + // pause between runs to avoid 403 and 429 at Medline + Thread.sleep(1000); + fetcher = new MedlineFetcher(); entryWijedasa = new BibEntry(); @@ -167,7 +170,6 @@ public void testMultipleEntries() throws Exception { entryList.forEach(entry -> entry.clearField(StandardField.ABSTRACT)); //Remove abstract due to copyright); assertEquals(50, entryList.size()); assertTrue(entryList.contains(bibEntryIchikawa)); - assertTrue(entryList.contains(bibEntrySari)); } @Test From be5fa3ab50a35226db426f33d4aa6d2948318c94 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Sun, 22 Dec 2019 11:15:21 +0100 Subject: [PATCH 05/13] Switch to rsync (#5778) * Switch to rsync * Address comments * Fix name for build job * Increase indent of list by 2 (in build job) --- .github/workflows/deployment.yml | 244 ++++++++++++++++++------------- 1 file changed, 145 insertions(+), 99 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index fa8a4727a04..95b4f6f30c8 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -3,9 +3,9 @@ name: Deployment on: [push] jobs: - deploy: + build: strategy: - fail-fast: false + fail-fast: true matrix: os: [ubuntu-latest, windows-latest, macOS-latest] include: @@ -13,7 +13,7 @@ jobs: displayName: linux jpackageDownload: https://download.java.net/java/early_access/jdk14/27/GPL/openjdk-14-ea+27_linux-x64_bin.tar.gz jdk14Path: /jdk-14 - archivePortable: tar -czf build/distribution/JabRef-portable_linux.tar.gz -C build/distribution JabRef && rm -R build/distribution/JabRef + archivePortable: tar -c -C build/distribution JabRef | pigz --rsyncable > build/distribution/JabRef-portable_linux.tar.gz && rm -R build/distribution/JabRef - os: windows-latest displayName: windows jpackageDownload: https://download.java.net/java/early_access/jdk14/27/GPL/openjdk-14-ea+27_windows-x64_bin.zip @@ -23,104 +23,150 @@ jobs: displayName: macOS jpackageDownload: https://download.java.net/java/early_access/jdk14/27/GPL/openjdk-14-ea+27_osx-x64_bin.tar.gz jdk14Path: /jdk-14.jdk/Contents/Home - archivePortable: tar -czf build/distribution/JabRef-portable_macos.tar.gz -C build/distribution JabRef.app && rm -R build/distribution/JabRef.app + archivePortable: brew install pigz && tar -c -C build/distribution JabRef.app | pigz --rsyncable > build/distribution/JabRef-portable_macos.tar.gz && rm -R build/distribution/JabRef.app runs-on: ${{ matrix.os }} - name: Deploy on ${{ matrix.displayName }} + name: Create installer and portable version for ${{ matrix.displayName }} steps: - - name: Checkout source - uses: actions/checkout@v2-beta - with: - fetch-depth: 0 - - name: Fetch tags and master for GitVersion - run: | - git fetch --tags origin - git rev-parse --verify master - if (-not $?) { - git branch --force --create-reflog master origin/master - } - shell: pwsh - - name: Install GitVersion - uses: gittools/actions/setup-gitversion@v0.3 - with: - versionSpec: '5.1.2' - - name: Run GitVersion - id: gitversion - uses: gittools/actions/execute-gitversion@v0.3 - - name: Set up JDK - uses: actions/setup-java@v1 - with: - java-version: 13 - - uses: actions/cache@v1 - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} - restore-keys: | - ${{ runner.OS }}-gradle-${{ env.cache-name }}- - ${{ runner.OS }}-gradle- - ${{ runner.OS }}- - - uses: actions/cache@v1 - name: Cache gradle wrapper - with: - path: ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} - - name: Download jpackage - # We need to download jpackage from https://jdk.java.net/jpackage/ - run: | - import tarfile - import zipfile - import sys - if sys.version_info[0] >= 3: - from urllib.request import urlretrieve - else: - from urllib import urlretrieve + - name: Checkout source + uses: actions/checkout@v2-beta + with: + fetch-depth: 0 + - name: Fetch tags and master for GitVersion + run: | + git fetch --tags origin + git rev-parse --verify master + if (-not $?) { + git branch --force --create-reflog master origin/master + } + shell: pwsh + - name: Install GitVersion + uses: gittools/actions/setup-gitversion@v0.3 + with: + versionSpec: '5.1.2' + - name: Run GitVersion + id: gitversion + uses: gittools/actions/execute-gitversion@v0.3 + - name: Set up JDK + uses: actions/setup-java@v1 + with: + java-version: 13 + # configuration based on https://github.com/actions/cache/blob/master/examples.md#java---gradle + - uses: actions/cache@v1 + name: Restore gradle cache + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: | + ${{ runner.OS }}-gradle-${{ env.cache-name }}- + ${{ runner.OS }}-gradle- + ${{ runner.OS }}- + - uses: actions/cache@v1 + name: Cache gradle wrapper + # cache at Mac OS X is 2 GB (too large) + if: matrix.displayName == 'linux' || matrix.displayName == 'windows' + with: + path: ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} + - name: Download jpackage + # We need to download jpackage from https://jdk.java.net/jpackage/ + run: | + import tarfile + import zipfile + import sys + if sys.version_info[0] >= 3: + from urllib.request import urlretrieve + else: + from urllib import urlretrieve - url = "${{ matrix.jpackageDownload }}" - tmpfile, headers = urlretrieve(url) - if (url.endswith("tar.gz")): - tar = tarfile.open(tmpfile) - tar.extractall() - tar.close() - elif (url.endswith("zip")): - zip = zipfile.ZipFile(tmpfile) - zip.extractall() - zip.close() - shell: python - - name: Build runtime image - run: ./gradlew -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" jlinkZip - - name: Build installer - run: | - export BADASS_JLINK_JPACKAGE_HOME="${GITHUB_WORKSPACE}${{ matrix.jdk14Path }}" - ./gradlew -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" jpackage - shell: bash - - name: Package application image - run: ${{ matrix.archivePortable }} - shell: bash - - name: Build and publish snap - if: matrix.os == 'ubuntu-latest' && steps.gitversion.outputs.branchName == 'master' - env: - SNAPCRAFT_LOGIN_FILE: ${{ secrets.SNAPCRAFT_LOGIN_FILE }} - run: | - mkdir .snapcraft && echo ${SNAPCRAFT_LOGIN_FILE} | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg - docker run -v $(pwd):$(pwd) -t lyzardking/snapcraft-bionic sh -c "apt update -qq && cd $(pwd) && snapcraft && mv jabref*.snap build/distribution/ && snapcraft push build/distribution/jabref*.snap --release edge || true" - shell: bash - - name: Rename files - run: | - get-childitem -Path build/distribution/* | rename-item -NewName {$_.name -replace "${{ steps.gitversion.outputs.AssemblySemVer }}","${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}"} - get-childitem -Path build/distribution/* | rename-item -NewName {$_.name -replace "portable","${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}-portable"} - shell: pwsh - - name: Upload to GitHub workflow artifacts store - uses: actions/upload-artifact@master - with: - name: JabRef-${{ matrix.displayName }} - path: build/distribution - - name: Upload to builds.jabref.org - uses: garygrossgarten/github-action-scp@release - with: - local: build/distribution - remote: www/${{ steps.gitversion.outputs.branchName }} - host: builds.jabref.org - username: builds_jabref_org - privateKey: ${{ secrets.buildJabRefPrivateKey }} - port: 9922 + url = "${{ matrix.jpackageDownload }}" + tmpfile, headers = urlretrieve(url) + if (url.endswith("tar.gz")): + tar = tarfile.open(tmpfile) + tar.extractall() + tar.close() + elif (url.endswith("zip")): + zip = zipfile.ZipFile(tmpfile) + zip.extractall() + zip.close() + shell: python + - name: Build runtime image + run: ./gradlew -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" jlinkZip + - name: Build installer + run: | + export BADASS_JLINK_JPACKAGE_HOME="${GITHUB_WORKSPACE}${{ matrix.jdk14Path }}" + ./gradlew -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" jpackage + shell: bash + - name: Package application image + run: ${{ matrix.archivePortable }} + shell: bash + - name: Build and publish snap + if: matrix.displayName == 'linux' && github.ref == 'refs/heads/master' + env: + SNAPCRAFT_LOGIN_FILE: ${{ secrets.SNAPCRAFT_LOGIN_FILE }} + run: | + mkdir .snapcraft && echo ${SNAPCRAFT_LOGIN_FILE} | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg + docker run -v $(pwd):$(pwd) -t lyzardking/snapcraft-bionic sh -c "apt update -qq && cd $(pwd) && snapcraft && mv jabref*.snap build/distribution/ && snapcraft push build/distribution/jabref*.snap --release edge || true" + shell: bash + - name: Rename files + run: | + get-childitem -Path build/distribution/* | rename-item -NewName {$_.name -replace "${{ steps.gitversion.outputs.AssemblySemVer }}","${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}"} + get-childitem -Path build/distribution/* | rename-item -NewName {$_.name -replace "portable","${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}-portable"} + shell: pwsh + - name: Upload to GitHub workflow artifacts store + uses: actions/upload-artifact@master + with: + name: JabRef-${{ matrix.displayName }} + path: build/distribution + deploy: + name: Deploy binaries on builds.jabref.org + runs-on: ubuntu-latest + needs: [build] + steps: + - name: Checkout source + uses: actions/checkout@v2-beta + with: + fetch-depth: 0 + - name: Fetch tags and master for GitVersion + run: | + git fetch --tags origin + git rev-parse --verify master + if (-not $?) { + git branch --force --create-reflog master origin/master + } + shell: pwsh + - name: Install GitVersion + uses: gittools/actions/setup-gitversion@v0.3 + with: + versionSpec: '5.1.2' + - name: Run GitVersion + id: gitversion + uses: gittools/actions/execute-gitversion@v0.3 + - name: Get linux binaries + uses: actions/download-artifact@master + with: + name: JabRef-linux + path: build/distribution + - name: Get windows binaries + uses: actions/download-artifact@master + with: + name: JabRef-windows + path: build/distribution + - name: Get macOS binaries + uses: actions/download-artifact@master + with: + name: JabRef-macOS + path: build/distribution/ + - name: Deploy to builds.jabref.org + id: deploy + uses: Pendect/action-rsyncer@v1.1.0 + env: + DEPLOY_KEY: ${{ secrets.buildJabRefPrivateKey }} + BRANCH: ${{ steps.gitversion.outputs.branchName }} + with: + flags: -vaz --itemize-changes --stats --partial-dir=/tmp/partial --rsync-path="mkdir -p /var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }} && rsync" + options: '' + ssh_options: '-p 9922' + src: 'build/distribution/' + dest: jrrsync@builds.jabref.org:/var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }}/ From d36f251a683377ab208ce6efb2669896bb07311c Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Sun, 22 Dec 2019 20:42:31 +0100 Subject: [PATCH 06/13] Revert "Disable non-working cleanup_pr workflow" This reverts commit 5d539edda443aac36aab27abba3a15d9536eedc0. --- .github/workflows/cleanup_pr.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/cleanup_pr.yml diff --git a/.github/workflows/cleanup_pr.yml b/.github/workflows/cleanup_pr.yml new file mode 100644 index 00000000000..74a70a6f80e --- /dev/null +++ b/.github/workflows/cleanup_pr.yml @@ -0,0 +1,24 @@ +name: Cleanup after PR + +on: + pull_request: + types: [closed] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Extract branch name + shell: bash + run: echo "##[set-output name=branch;](echo{GITHUB_REF#refs/heads/})" + id: extract_branch + - name: Delete folder on builds.jabref.org + uses: appleboy/ssh-action@v0.0.3 + with: + script: rm -rf www/${{ steps.extract_branch.outputs.branch }} + host: builds.jabref.org + username: builds_jabref_org + key: ${{ secrets.buildJabRefPrivateKey }} + port: 9922 From ba0acc53480b048af242d339f22243f692bb233d Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Sun, 22 Dec 2019 20:45:41 +0100 Subject: [PATCH 07/13] Update script to absolute path and new username --- .github/workflows/cleanup_pr.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cleanup_pr.yml b/.github/workflows/cleanup_pr.yml index 74a70a6f80e..a04a56f85e5 100644 --- a/.github/workflows/cleanup_pr.yml +++ b/.github/workflows/cleanup_pr.yml @@ -15,10 +15,10 @@ jobs: run: echo "##[set-output name=branch;](echo{GITHUB_REF#refs/heads/})" id: extract_branch - name: Delete folder on builds.jabref.org - uses: appleboy/ssh-action@v0.0.3 + uses: appleboy/ssh-action@v0.0.6 with: - script: rm -rf www/${{ steps.extract_branch.outputs.branch }} + script: rm -rf /var/www/builds.jabref.org/www/${{ steps.extract_branch.outputs.branch }} host: builds.jabref.org - username: builds_jabref_org - key: ${{ secrets.buildJabRefPrivateKey }} port: 9922 + username: jrrsync + key: ${{ secrets.buildJabRefPrivateKey }} From db8ab397ed17f7cfc9ad38066f64aeeb336c3525 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Sun, 22 Dec 2019 21:04:44 +0100 Subject: [PATCH 08/13] Fix branch name detection --- .github/workflows/cleanup_pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cleanup_pr.yml b/.github/workflows/cleanup_pr.yml index a04a56f85e5..5afd4f4d98c 100644 --- a/.github/workflows/cleanup_pr.yml +++ b/.github/workflows/cleanup_pr.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Extract branch name shell: bash - run: echo "##[set-output name=branch;](echo{GITHUB_REF#refs/heads/})" + run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" id: extract_branch - name: Delete folder on builds.jabref.org uses: appleboy/ssh-action@v0.0.6 From e5afee5c20d347a2d4241d4423c44d14b394dc41 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Sun, 22 Dec 2019 21:38:59 +0100 Subject: [PATCH 09/13] Try to use implicit shell to enable variable correctly be set --- .github/workflows/cleanup_pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cleanup_pr.yml b/.github/workflows/cleanup_pr.yml index 5afd4f4d98c..863a7a57bb3 100644 --- a/.github/workflows/cleanup_pr.yml +++ b/.github/workflows/cleanup_pr.yml @@ -11,9 +11,9 @@ jobs: steps: - name: Extract branch name - shell: bash - run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" id: extract_branch + run: | + echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - name: Delete folder on builds.jabref.org uses: appleboy/ssh-action@v0.0.6 with: From 401acfc864c0fbeb03b0b97671973354163daf5a Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Sun, 22 Dec 2019 23:05:52 +0100 Subject: [PATCH 10/13] Fix line endings. Refs https://github.com/JabRef/jabref/pull/5775 --- .../fileformat/BibTeXMLImporterTestEmpty.bib | 6 +++--- .../logic/importer/fileformat/RisImporterTest7.bib | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestEmpty.bib b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestEmpty.bib index abc96e4f08b..5e40fa403f5 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestEmpty.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestEmpty.bib @@ -1,3 +1,3 @@ -@misc{EmptyEntry, - -} +@misc{EmptyEntry, + +} diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/RisImporterTest7.bib b/src/test/resources/org/jabref/logic/importer/fileformat/RisImporterTest7.bib index fcef995ec0f..9bd610a27ad 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/RisImporterTest7.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/RisImporterTest7.bib @@ -1,7 +1,7 @@ -@book{, - author = {Smith, Bob and Doe, Jan and Brown, Judy and Martin, Steve and Clark, Joe}, - publisher = {Test Publisher}, - title = {Testing Book Title}, - volume = {1}, - year = {2015} -} +@book{, + author = {Smith, Bob and Doe, Jan and Brown, Judy and Martin, Steve and Clark, Joe}, + publisher = {Test Publisher}, + title = {Testing Book Title}, + volume = {1}, + year = {2015} +} From 51d6986b1d33ec255d1868af53e858eacc0c84e8 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2019 10:28:24 +0100 Subject: [PATCH 11/13] Bump byte-buddy-parent from 1.10.5 to 1.10.6 (#5783) Bumps [byte-buddy-parent](https://github.com/raphw/byte-buddy) from 1.10.5 to 1.10.6. - [Release notes](https://github.com/raphw/byte-buddy/releases) - [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md) - [Commits](https://github.com/raphw/byte-buddy/compare/byte-buddy-1.10.5...byte-buddy-1.10.6) Signed-off-by: dependabot-preview[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 8ab7c060340..66b3a09da81 100644 --- a/build.gradle +++ b/build.gradle @@ -211,7 +211,7 @@ dependencies { testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.5.2' testCompile 'org.junit.platform:junit-platform-launcher:1.5.2' - testCompile 'net.bytebuddy:byte-buddy-parent:1.10.5' + testCompile 'net.bytebuddy:byte-buddy-parent:1.10.6' 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.2.4' From a362ac36621a4842f0282be85824b7b97c3fefb6 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2019 10:29:41 +0100 Subject: [PATCH 12/13] Bump org.beryx.jlink from 2.16.4 to 2.17.0 (#5782) Bumps org.beryx.jlink from 2.16.4 to 2.17.0. Signed-off-by: dependabot-preview[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 66b3a09da81..432b326d0ad 100644 --- a/build.gradle +++ b/build.gradle @@ -23,7 +23,7 @@ plugins { id 'com.github.ben-manes.versions' version '0.27.0' id 'org.javamodularity.moduleplugin' version '1.5.0' id 'org.openjfx.javafxplugin' version '0.0.8' - id 'org.beryx.jlink' version '2.16.4' + id 'org.beryx.jlink' version '2.17.0' // nicer test outputs during running and completion id 'com.adarshr.test-logger' version '2.0.0' From cd6f6569de4992079aff6d677ea560115068cd00 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Mon, 23 Dec 2019 10:37:17 +0100 Subject: [PATCH 13/13] Fixes StringIndexOutOfBoundsException when cutting text (#5776) * Fixes StringIndexOutOfBoundsException when cutting text * Incldue workaround as proposed at https://bugs.openjdk.java.net/browse/JDK-8176270 * Try to get right text * Access input value the right way * Fix checkstyle Co-authored-by: Oliver Kopp --- .../java/org/jabref/gui/ClipBoardManager.java | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/jabref/gui/ClipBoardManager.java b/src/main/java/org/jabref/gui/ClipBoardManager.java index 340fb61ea1a..80f66951882 100644 --- a/src/main/java/org/jabref/gui/ClipBoardManager.java +++ b/src/main/java/org/jabref/gui/ClipBoardManager.java @@ -12,6 +12,7 @@ import java.util.List; import java.util.Optional; +import javafx.application.Platform; import javafx.scene.control.TextInputControl; import javafx.scene.input.Clipboard; import javafx.scene.input.ClipboardContent; @@ -57,20 +58,24 @@ public ClipBoardManager(Clipboard clipboard, java.awt.datatransfer.Clipboard pri } /** - * Add X11 clipboard support to a text input control. - * It is necessary to call this method in every input where you want to use it: - * {@code ClipBoardManager.addX11Support(TextInputControl input);}. + * Add X11 clipboard support to a text input control. It is necessary to call this method in every input where you + * want to use it: {@code ClipBoardManager.addX11Support(TextInputControl input);}. * * @param input the TextInputControl (e.g., TextField, TextArea, and children) where adding this functionality. - * @see Short summary for X11 clipboards - * @see Longer text over clipboards + * @see Short summary for X11 + * clipboards + * @see Longer + * text over clipboards */ public static void addX11Support(TextInputControl input) { - input.selectedTextProperty().addListener((observable, oldValue, newValue) -> { - if (!newValue.isEmpty() && primary != null) { - primary.setContents(new StringSelection(newValue), null); - } - }); + input.selectedTextProperty().addListener( + // using InvalidationListener because of https://bugs.openjdk.java.net/browse/JDK-8176270 + observable -> Platform.runLater(() -> { + String newValue = input.getSelectedText(); + if (!newValue.isEmpty() && primary != null) { + primary.setContents(new StringSelection(newValue), null); + } + })); input.setOnMouseClicked(event -> { if (event.getButton() == MouseButton.MIDDLE) { input.insertText(input.getCaretPosition(), getContentsPrimary());