mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Fixed make.py release zip archive
This commit is contained in:
@ -595,6 +595,7 @@ def replace_file(filePath, oldSubstring, newSubstring):
|
|||||||
|
|
||||||
|
|
||||||
def set_version():
|
def set_version():
|
||||||
|
# Cut build away from version stamp
|
||||||
#newVersion = ACE_VERSION[:-2]
|
#newVersion = ACE_VERSION[:-2]
|
||||||
newVersion = "3.3.0"
|
newVersion = "3.3.0"
|
||||||
|
|
||||||
@ -602,11 +603,9 @@ def set_version():
|
|||||||
|
|
||||||
# Change versions in files containing version
|
# Change versions in files containing version
|
||||||
for i in versionFiles:
|
for i in versionFiles:
|
||||||
try:
|
filePath = os.path.join(module_root_parent, i)
|
||||||
# Get root and file path
|
|
||||||
root = os.path.abspath(os.path.join(os.getcwd(), os.pardir))
|
|
||||||
filePath = os.path.join(root, i)
|
|
||||||
|
|
||||||
|
try:
|
||||||
# Save the file contents to a variable if the file exists
|
# Save the file contents to a variable if the file exists
|
||||||
if os.path.isfile(filePath):
|
if os.path.isfile(filePath):
|
||||||
f = open(filePath, "r+")
|
f = open(filePath, "r+")
|
||||||
@ -626,6 +625,9 @@ def set_version():
|
|||||||
pass
|
pass
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print_error("set_version error: {}".format(e))
|
print_error("set_version error: {}".format(e))
|
||||||
|
return False
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
def get_private_keyname(commitID,module="main"):
|
def get_private_keyname(commitID,module="main"):
|
||||||
@ -700,6 +702,7 @@ def version_stamp_pboprefix(module,commitID):
|
|||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
|
||||||
@ -736,7 +739,7 @@ def main(argv):
|
|||||||
# Default behaviors
|
# Default behaviors
|
||||||
test = False # Copy to Arma 3 directory?
|
test = False # Copy to Arma 3 directory?
|
||||||
arg_modules = False # Only build modules on command line?
|
arg_modules = False # Only build modules on command line?
|
||||||
make_release = False # Make zip file from the release?
|
make_release = True # Make zip file from the release?
|
||||||
release_version = 0 # Version of release
|
release_version = 0 # Version of release
|
||||||
use_pboproject = True # Default to pboProject build tool
|
use_pboproject = True # Default to pboProject build tool
|
||||||
make_target = "DEFAULT" # Which section in make.cfg to use for the build
|
make_target = "DEFAULT" # Which section in make.cfg to use for the build
|
||||||
@ -1291,23 +1294,26 @@ See the make.cfg file for additional build options.
|
|||||||
# Delete the pboproject temp files if building a release.
|
# Delete the pboproject temp files if building a release.
|
||||||
if make_release and build_tool == "pboproject":
|
if make_release and build_tool == "pboproject":
|
||||||
try:
|
try:
|
||||||
shutil.rmtree(os.path.join(module_root, release_dir, project, "temp"), True)
|
shutil.rmtree(os.path.join(release_dir, project, "temp"), True)
|
||||||
except:
|
except:
|
||||||
print_error("ERROR: Could not delete pboProject temp files.")
|
print_error("ERROR: Could not delete pboProject temp files.")
|
||||||
|
|
||||||
# Make release
|
# Make release
|
||||||
if make_release:
|
if make_release:
|
||||||
print_blue("\nMaking release: {}-{}.zip".format(project,release_version))
|
print_blue("\nMaking release: {}_{}.zip".format(prefix, ACE_VERSION[:-2]))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Delete all log files
|
# Delete all log files
|
||||||
for root, dirs, files in os.walk(os.path.join(module_root, release_dir, project, "addons")):
|
for root, dirs, files in os.walk(os.path.join(release_dir, project, "addons")):
|
||||||
for currentFile in files:
|
for currentFile in files:
|
||||||
if currentFile.lower().endswith("log"):
|
if currentFile.lower().endswith("log"):
|
||||||
os.remove(os.path.join(root, currentFile))
|
os.remove(os.path.join(root, currentFile))
|
||||||
|
|
||||||
# Create a zip with the contents of release/ in it
|
# Create a zip with the contents of release/ in it
|
||||||
shutil.make_archive(project + "-" + release_version, "zip", os.path.join(module_root, release_dir))
|
release_zip = shutil.make_archive("{}_{}".format(prefix, ACE_VERSION[:-2]), "zip", release_dir)
|
||||||
|
# Move release zip to release/ folder
|
||||||
|
shutil.copy(release_zip, release_dir)
|
||||||
|
os.remove(release_zip)
|
||||||
except:
|
except:
|
||||||
raise
|
raise
|
||||||
print_error("Could not make release.")
|
print_error("Could not make release.")
|
||||||
|
Reference in New Issue
Block a user