Skip to content

Commit

Permalink
Use v8 engine for CSL (#2250)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
shitikanth authored and koppor committed Dec 5, 2016
1 parent 5a827bd commit fdaf1c0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
25 changes: 25 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,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'
Expand Down Expand Up @@ -133,6 +153,11 @@ dependencies {

compile 'com.github.lgooddatepicker:LGoodDatePicker:8.2.2'

// 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.26'
testCompile 'com.github.tomakehurst:wiremock:2.4.1'
Expand Down
5 changes: 5 additions & 0 deletions external-libraries.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,9 @@ Project: Citeproc-Java
URL: http://michel-kraemer.github.io/citeproc-java/
Licence: Apache-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.

0 comments on commit fdaf1c0

Please sign in to comment.