Migrates Apex to Python
[apex.git] / apex / build.py
similarity index 98%
rename from ci/build.py
rename to apex/build.py
index a17b21b..cda4e06 100644 (file)
@@ -20,6 +20,7 @@ TMP_CACHE = '.cache'
 BUILD_ROOT = 'build'
 BUILD_LOG_FILE = './apex_build.log'
 
+
 class ApexBuildException(Exception):
     pass
 
@@ -216,9 +217,12 @@ if __name__ == '__main__':
     console.setFormatter(logging.Formatter(formatter))
     logging.getLogger('').addHandler(console)
     apex_root = os.path.split(os.getcwd())[0]
+    if 'apex/apex' in apex_root:
+        apex_root = os.path.split(apex_root)[0]
     for root, dirs, files in os.walk(apex_root):
-        if BUILD_ROOT in dirs:
+        if BUILD_ROOT in dirs and 'apex/apex' not in root:
             apex_root = root
+            break
     apex_build_root = os.path.join(apex_root, BUILD_ROOT)
     if os.path.isdir(apex_build_root):
         cache_tmp_dir = os.path.join(apex_root, TMP_CACHE)