/
prepare-release.py
34 lines (29 loc) · 1.25 KB
/
prepare-release.py
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
# Checks and updates the resources that go into a final release. These are:
# * the olca-modules (we assume that the olca-modules repository is located
# next to this repository)
# * the current reference database
# * the HTML pages
# * the current modules interface for the Jython interpreter
import os
from subprocess import call
def main():
if os.name == "posix":
call(["mvn", "clean"], cwd="./olca-app")
call("./update_modules.sh")
call(["mvn", "package"], cwd="./olca-refdata")
call(["npm", "install"], cwd="./olca-app-html")
call(["npm", "run", "build"], cwd="./olca-app-html")
call(["node", "gen-jython-bindings.js"])
call("npm install", cwd="./olca-app-build/credits")
call("node credits-gen.js", cwd="./olca-app-build/credits")
else:
call("mvn.cmd clean", cwd="./olca-app")
call("update_modules.bat")
call("mvn.cmd package", cwd="./olca-refdata")
call("npm.cmd install", cwd="./olca-app-html")
call("npm.cmd run build", cwd="./olca-app-html")
call("node gen-jython-bindings.js")
call("npm.cmd install", cwd="./olca-app-build/credits")
call("node credits-gen.js", cwd="./olca-app-build/credits")
if __name__ == "__main__":
main()