From 0a322e89309ed402161984a623f80c83af26c3af Mon Sep 17 00:00:00 2001 From: Erickson Silva Date: Wed, 30 Mar 2016 15:47:15 -0300 Subject: [PATCH] Adiciona script para geração de build --- .gitignore | 2 +- scripts/linux/make_build.py | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 scripts/linux/make_build.py diff --git a/.gitignore b/.gitignore index a942669..e0b5719 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,4 @@ vlibras_user tamanho.txt vlibras doc/ -src/compiled/ \ No newline at end of file +build/ \ No newline at end of file diff --git a/scripts/linux/make_build.py b/scripts/linux/make_build.py new file mode 100644 index 0000000..7b3189a --- /dev/null +++ b/scripts/linux/make_build.py @@ -0,0 +1,18 @@ +# Create a directory 'build' with the source code and data +import compileall, os, shutil, glob + +path_installation = "/".join(os.path.dirname(os.path.abspath(__file__)).split(os.sep)[:-2]) +path_source = os.path.join(path_installation, "src") +path_data = os.path.join(path_installation, "data") +path_build = os.path.join(path_installation, "build") + +if os.path.exists(path_build): + shutil.rmtree(path_build) +os.makedirs(path_build) + +compileall.compile_dir(path_source, force=True) +files = glob.iglob(os.path.join(path_source, "*.pyc")) +for file in files: + shutil.move(file, path_build) +shutil.copytree(path_data, path_build+"/data") +os.remove(path_build+"/TranslationServer.pyc") \ No newline at end of file -- libgit2 0.21.2