mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #2265 from jonpas/makeUpdate
Updated make.py with changes from CBA
This commit is contained in:
commit
728aafc3c2
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
#!/usr/bin/env python3
|
||||
# vim: set fileencoding=utf-8 :
|
||||
|
||||
# make.py
|
||||
@ -30,7 +30,7 @@
|
||||
|
||||
###############################################################################
|
||||
|
||||
__version__ = "0.6"
|
||||
__version__ = "0.7"
|
||||
|
||||
import sys
|
||||
|
||||
@ -59,7 +59,7 @@ if sys.platform == "win32":
|
||||
|
||||
######## GLOBALS #########
|
||||
project = "@ace"
|
||||
ACE_VERSION = "3.0.0"
|
||||
project_version = "3.0.0"
|
||||
arma3tools_path = ""
|
||||
work_drive = ""
|
||||
module_root = ""
|
||||
@ -130,7 +130,6 @@ def Fract_Sec(s):
|
||||
return d,h,m,sec
|
||||
#endef Fract_Sec
|
||||
|
||||
|
||||
# Copyright (c) André Burgaud
|
||||
# http://www.burgaud.com/bring-colors-to-the-windows-console-with-python/
|
||||
if sys.platform == "win32":
|
||||
@ -387,6 +386,7 @@ def copy_optionals_for_building(mod,pbos):
|
||||
if (os.path.isfile(sig_path)):
|
||||
#print("Moving {} for processing.".format(sig_path))
|
||||
shutil.move(sig_path, os.path.join(release_dir, project, "addons", sigFile_name))
|
||||
|
||||
except:
|
||||
print_error("Error in moving")
|
||||
raise
|
||||
@ -450,6 +450,9 @@ def cleanup_optionals(mod):
|
||||
continue
|
||||
shutil.rmtree(destination)
|
||||
|
||||
except FileNotFoundError:
|
||||
print_yellow("{} file not found".format(file_name))
|
||||
|
||||
except:
|
||||
print_error("Cleaning Optionals Failed")
|
||||
raise
|
||||
@ -556,9 +559,9 @@ def addon_restore(modulePath):
|
||||
return True
|
||||
|
||||
|
||||
def get_ace_version():
|
||||
global ACE_VERSION
|
||||
versionStamp = ACE_VERSION
|
||||
def get_project_version():
|
||||
global project_version
|
||||
versionStamp = project_version
|
||||
#do the magic based on https://github.com/acemod/ACE3/issues/806#issuecomment-95639048
|
||||
|
||||
try:
|
||||
@ -583,16 +586,16 @@ def get_ace_version():
|
||||
raise FileNotFoundError("File Not Found: {}".format(scriptModPath))
|
||||
|
||||
except Exception as e:
|
||||
print_error("Get_Ace_Version error: {}".format(e))
|
||||
print_error("Get_project_version error: {}".format(e))
|
||||
print_error("Check the integrity of the file: {}".format(scriptModPath))
|
||||
versionStamp = ACE_VERSION
|
||||
versionStamp = project_version
|
||||
print_error("Resetting to the default version stamp: {}".format(versionStamp))
|
||||
input("Press Enter to continue...")
|
||||
print("Resuming build...")
|
||||
|
||||
print_yellow("{} VERSION set to {}".format(project.lstrip("@").upper(),versionStamp))
|
||||
ACE_VERSION = versionStamp
|
||||
return ACE_VERSION
|
||||
project_version = versionStamp
|
||||
return project_version
|
||||
|
||||
|
||||
def replace_file(filePath, oldSubstring, newSubstring):
|
||||
@ -610,7 +613,7 @@ def replace_file(filePath, oldSubstring, newSubstring):
|
||||
|
||||
|
||||
def set_version_in_files():
|
||||
newVersion = ACE_VERSION # MAJOR.MINOR.PATCH.BUILD
|
||||
newVersion = project_version # MAJOR.MINOR.PATCH.BUILD
|
||||
newVersionShort = newVersion[:-2] # MAJOR.MINOR.PATCH
|
||||
|
||||
# Regex patterns
|
||||
@ -692,7 +695,7 @@ def restore_version_files():
|
||||
def get_private_keyname(commitID,module="main"):
|
||||
global pbo_name_prefix
|
||||
|
||||
aceVersion = get_ace_version()
|
||||
aceVersion = get_project_version()
|
||||
keyName = str("{prefix}{version}-{commit_id}".format(prefix=pbo_name_prefix,version=aceVersion,commit_id=commitID))
|
||||
return keyName
|
||||
|
||||
@ -769,7 +772,7 @@ def main(argv):
|
||||
"""Build an Arma addon suite in a directory from rules in a make.cfg file."""
|
||||
print_blue("\nmake.py for Arma, modified for Advanced Combat Environment v{}".format(__version__))
|
||||
|
||||
global ACE_VERSION
|
||||
global project_version
|
||||
global arma3tools_path
|
||||
global work_drive
|
||||
global module_root
|
||||
@ -855,7 +858,7 @@ See the make.cfg file for additional build options.
|
||||
argv.remove("release")
|
||||
else:
|
||||
make_release_zip = False
|
||||
release_version = ACE_VERSION
|
||||
release_version = project_version
|
||||
|
||||
if "target" in argv:
|
||||
make_target = argv[argv.index("target") + 1]
|
||||
|
Loading…
Reference in New Issue
Block a user