Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathmake-java.py
More file actions
Latest commit
executable file
·37 lines (31 loc) · 1012 Bytes
/
Copy pathmake-java.py
File metadata and controls
executable file
·37 lines (31 loc) · 1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python
# encoding: utf-8
importsys
importos
importre
fromshutilimportcopyfile
importsubprocess
JARFILE="gatetools-gatenlpworker-1.0.jar"
JARFILE_PATH=os.path.join("java", "target", JARFILE) # where it is after compiling
JARFILE_DIST=os.path.join(
"gatenlp", "_jars", JARFILE
) # where to put the jarfile prior before running setup
JARFILE_DEST=os.path.join(
"_jars", JARFILE
) # where it should be relative to the gatenlp package
JAVAFILE_PATH=os.path.join(
"java", "src", "main", "java", "gate", "tools", "gatenlpworker", "GatenlpWorker.java"
)
defmake_java():
if (
os.path.exists(JARFILE_DIST)
andos.stat(JARFILE_DIST).st_mtime>os.stat(JAVAFILE_PATH).st_mtime
):
return
os.chdir("java")
retcode=subprocess.call("mvn package", shell=True)
ifretcode!=0:
raiseException("Could not build jar, exit code is {}".format(retcode))
os.chdir("..")
copyfile(JARFILE_PATH, JARFILE_DIST)
make_java()