Skip to content

Commit

Permalink
assign library path based on the OS
Browse files Browse the repository at this point in the history
  • Loading branch information
lfoppiano committed Jul 20, 2022
1 parent 3f63024 commit 46d6a05
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,8 @@ project("grobid-home") {
}
}

import org.apache.tools.ant.taskdefs.condition.Os

project(":grobid-service") {
apply plugin: 'application'
apply plugin: 'jacoco'
Expand All @@ -328,11 +330,18 @@ project(":grobid-service") {
mainClassName = 'org.grobid.service.main.GrobidServiceApplication'

tasks.run {
def libraries = ""
if (Os.isFamily(Os.FAMILY_MAC)) {
libraries = "${file("../grobid-home/lib/mac-64").absolutePath}"
} else if (Os.isFamily(Os.FAMILY_UNIX)) {
libraries = "${file("../grobid-home/lib/lin-64/jep").absolutePath}:" +
"${file("../grobid-home/lib/lin-64").absolutePath}:"
} else {
throw new RuntimeException("Unsupported platform!")
}

workingDir = rootProject.rootDir
systemProperty "java.library.path","${System.getProperty('java.library.path')}:" +
"${file("../grobid-home/lib/lin-64/jep").absolutePath}:" +
"${file("../grobid-home/lib/lin-64").absolutePath}:" +
"${file("../grobid-home/lib/mac-64").absolutePath}"
systemProperty "java.library.path","${System.getProperty('java.library.path')}:" + libraries
}

// Proposal to check the virtual environment information
Expand Down

0 comments on commit 46d6a05

Please sign in to comment.