Commit 0a322e89309ed402161984a623f80c83af26c3af
1 parent
45c66940
Exists in
master
and in
1 other branch
Adiciona script para geração de build
Showing
2 changed files
with
19 additions
and
1 deletions
Show diff stats
.gitignore
| @@ -0,0 +1,18 @@ | @@ -0,0 +1,18 @@ | ||
| 1 | +# Create a directory 'build' with the source code and data | ||
| 2 | +import compileall, os, shutil, glob | ||
| 3 | + | ||
| 4 | +path_installation = "/".join(os.path.dirname(os.path.abspath(__file__)).split(os.sep)[:-2]) | ||
| 5 | +path_source = os.path.join(path_installation, "src") | ||
| 6 | +path_data = os.path.join(path_installation, "data") | ||
| 7 | +path_build = os.path.join(path_installation, "build") | ||
| 8 | + | ||
| 9 | +if os.path.exists(path_build): | ||
| 10 | + shutil.rmtree(path_build) | ||
| 11 | +os.makedirs(path_build) | ||
| 12 | + | ||
| 13 | +compileall.compile_dir(path_source, force=True) | ||
| 14 | +files = glob.iglob(os.path.join(path_source, "*.pyc")) | ||
| 15 | +for file in files: | ||
| 16 | + shutil.move(file, path_build) | ||
| 17 | +shutil.copytree(path_data, path_build+"/data") | ||
| 18 | +os.remove(path_build+"/TranslationServer.pyc") | ||
| 0 | \ No newline at end of file | 19 | \ No newline at end of file |