Skip to content

Commit 5563811

Browse files
shitikanthkoppor
authored andcommitted
Use v8 engine for CSL (#2250)
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.
1 parent dbd45bb commit 5563811

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

build.gradle

+25
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,26 @@ configurations {
6666
antlr4
6767
}
6868

69+
def getV8Dependency() {
70+
def arch = System.getProperty('os.arch')
71+
def dep = null
72+
if (OperatingSystem.current().isWindows()) {
73+
dep = 'win32_x86'
74+
if (arch.equals('amd64')) {
75+
dep += '_64'
76+
}
77+
} else if (OperatingSystem.current().isMacOsX() && (arch.equals('amd64') || arch.equals('x86_64'))) {
78+
dep = 'macosx_x86_64'
79+
} else if (OperatingSystem.current().isLinux() && arch.equals('amd64')) {
80+
dep = 'linux_x86_64'
81+
}
82+
if (dep == null) {
83+
logger.error("Could not find V8 runtime compatible to this system")
84+
return null
85+
}
86+
return 'com.eclipsesource.j2v8:j2v8_' + dep + ':4.5.0'
87+
}
88+
6989
dependencies {
7090
compile 'com.jgoodies:jgoodies-common:1.8.1'
7191
compile 'com.jgoodies:jgoodies-forms:1.9.0'
@@ -143,6 +163,11 @@ dependencies {
143163
compile group: 'com.microsoft.azure', name: 'applicationinsights-core', version: '1.0.+'
144164
compile group: 'com.microsoft.azure', name: 'applicationinsights-logging-log4j2', version: '1.0.+'
145165

166+
// if available, use platform specific build of V8
167+
if (getV8Dependency() != null) {
168+
compile getV8Dependency()
169+
}
170+
146171
testCompile 'junit:junit:4.12'
147172
testCompile 'org.mockito:mockito-core:2.7.22'
148173
testCompile 'com.github.tomakehurst:wiremock:2.6.0'

external-libraries.txt

+5
Original file line numberDiff line numberDiff line change
@@ -216,4 +216,9 @@ Project: latex2unicode
216216
URL: https://github.com/tomtung/latex2unicode
217217
License: Apache 2.0
218218

219+
Id: com.eclipse.j2v8
220+
Project: J2V8
221+
URL: https://github.com/eclipsesource/J2V8
222+
Licence: EPL-1.0
223+
219224
The last entry has to end with an empty line. Otherwise the entry is not present in About.html.

0 commit comments

Comments
 (0)