forked from Oueee/Excel-Lent
/
manage.py
44 lines (31 loc) · 969 Bytes
/
manage.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
35
36
37
38
39
40
41
42
43
44
"""Module manage.
"""
import sys
import os
import subprocess
import launcher
import shutil
attributs = {
'flags': '-g',# -Xlint:all',
#'main_class': 'core.MainConsole'
'main_class': 'gui.GUI',
#'main_class': 'excel.Excel_settings'
}
### compile parts
def build(self):
files_path = os.path.join('src', 'main')
main_class = self.main_class.replace('.', os.sep) + '.java'
cmd = '{0} -d bin -sourcepath {1} -cp "lib/poi-3.11/*" {2} {3}'.format(
self.compilo, files_path,
os.path.join(files_path, main_class), self.flags)
subprocess.call(cmd, shell=True)
### run parts
def run(self, *args):
subprocess.call('java -cp "lib/poi-3.11/*:bin" {0} {1}'.format(self.main_class, ' '.join(args)),
shell=True)
def clean(self):
"""clean the java project"""
self._clean(os.path.join('bin', '*'),
os.path.join('tree', '*'))
self._clean_rec('*~')
launcher.main()