From 7507fe89d18673b26ab4ace57d7d35b9640a8e1c Mon Sep 17 00:00:00 2001 From: Shitikanth Kashyap Date: Tue, 8 Nov 2016 05:04:03 -0500 Subject: [PATCH 1/4] Add a dependency to com.eclipsesource.J2V8 (Java Bindings for V8) in build.gradle. Citeproc-java detects that V8 is present in the classpath and starts using it automatically. --- build.gradle | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/build.gradle b/build.gradle index 925255a8f16..efc3c506603 100644 --- a/build.gradle +++ b/build.gradle @@ -65,6 +65,26 @@ configurations { integrationTestRuntime.extendsFrom testRuntime } +def getV8Dependency() { + def arch = System.getProperty('os.arch') + def dep = null + if (OperatingSystem.current().isWindows()) { + dep = 'win32_x86' + if (arch.equals('amd64')) { + dep += '_64' + } + } else if (OperatingSystem.current().isMacOsX() && (arch.equals('amd64') || arch.equals('x86_64'))) { + dep = 'macosx_x86_64' + } else if (OperatingSystem.current().isLinux() && arch.equals('amd64')) { + dep = 'linux_x86_64' + } + if (dep == null) { + logger.error("Could not find V8 runtime compatible to this system") + return null + } + return 'com.eclipsesource.j2v8:j2v8_' + dep + ':4.5.0' +} + dependencies { compile 'com.jgoodies:jgoodies-common:1.8.1' compile 'com.jgoodies:jgoodies-forms:1.9.0' @@ -124,6 +144,8 @@ dependencies { compile 'org.citationstyles:locales:1.0.1-SNAPSHOT' compile 'de.undercouch:citeproc-java:1.0.0-SNAPSHOT' + compile getV8Dependency() + testCompile 'junit:junit:4.12' testCompile 'org.mockito:mockito-core:2.2.9' testCompile 'com.github.tomakehurst:wiremock:2.2.2' From b1c4039e878892941ce1a98445e68831b6dfd9b6 Mon Sep 17 00:00:00 2001 From: Shitikanth Kashyap Date: Wed, 16 Nov 2016 08:37:29 -0500 Subject: [PATCH 2/4] Make sure that V8 dependency is available. --- build.gradle | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index efc3c506603..3e684442985 100644 --- a/build.gradle +++ b/build.gradle @@ -144,7 +144,10 @@ dependencies { compile 'org.citationstyles:locales:1.0.1-SNAPSHOT' compile 'de.undercouch:citeproc-java:1.0.0-SNAPSHOT' - compile getV8Dependency() + // if available, use platform specific build of V8 + if (getV8Dependency() != null) { + compile getV8Dependency() + } testCompile 'junit:junit:4.12' testCompile 'org.mockito:mockito-core:2.2.9' From 5ee4d79ffe1912f51a4534777291184a530364e6 Mon Sep 17 00:00:00 2001 From: Shitikanth Kashyap Date: Wed, 16 Nov 2016 08:44:13 -0500 Subject: [PATCH 3/4] Add entry for J2V8 in external-libraries.txt. --- external-libraries.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/external-libraries.txt b/external-libraries.txt index 50088cd8293..fde443d4e93 100644 --- a/external-libraries.txt +++ b/external-libraries.txt @@ -174,4 +174,9 @@ Project: Citeproc-Java URL: http://michel-kraemer.github.io/citeproc-java/ Licence: Apache License, Version 2.0 +Id: com.eclipse.j2v8 +Project: J2V8 +URL: https://github.com/eclipsesource/J2V8 +Licence: EPL- 1.0 + The last entry has to end with an empty line. Otherwise the entry is not present in About.html. From c04f46bdc1bdb9533a120bef542c9e24222d6fbb Mon Sep 17 00:00:00 2001 From: Shitikanth Kashyap Date: Tue, 22 Nov 2016 08:19:42 -0500 Subject: [PATCH 4/4] Removed space from licence identifier. --- external-libraries.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external-libraries.txt b/external-libraries.txt index fde443d4e93..81517c9a973 100644 --- a/external-libraries.txt +++ b/external-libraries.txt @@ -177,6 +177,6 @@ Licence: Apache License, Version 2.0 Id: com.eclipse.j2v8 Project: J2V8 URL: https://github.com/eclipsesource/J2V8 -Licence: EPL- 1.0 +Licence: EPL-1.0 The last entry has to end with an empty line. Otherwise the entry is not present in About.html.