Commit 75e130ef authored by Legodev's avatar Legodev

added write out of Makefile

parent 3b90317c
......@@ -2,7 +2,8 @@ import os
from pathlib import Path
from utils.findconfigfiles import findconfigfiles
from utils.getdependencylist import getdependencylist
from utils.createaddonbuildercmd import createaddonbuildercmd
from utils.createaddonbuildercmd import createaddonbuildercmd, arma3ToolsPath, addonBuilderExePath
from utils.createaddonmakefiledependencies import createmakefilealldependencies, createaddonmakefiledependencies
repo = "Client_Files"
branch = "PreRelease"
......@@ -16,14 +17,20 @@ keypath = sourcePath / "Keys" / "DesolationREDUX.{}.biprivatekey".format(branch)
projectPath = sourcePath / repo / namespace / "Addons"
sourceAddonsPath = projectPath
destinationpath = sourcePath / branch / repo / "Addons"
addonlist = [x for x in filter(os.path.isdir, os.listdir(sourceAddonsPath))]
addonlist = [x for x in os.listdir(sourceAddonsPath)]
with open("Makefile", "w") as f:
print(createmakefilealldependencies(destinationpath, addonlist), file=f)
for addon in addonlist:
dependencies = []
configfiles = findconfigfiles(sourceAddonsPath / addon)
for configfile in configfiles:
dependencies += [x for x in getdependencylist(configfile) if x in addonlist and not x in dependencies]
for addon in addonlist:
dependencies = []
configfiles = findconfigfiles(sourceAddonsPath / addon)
sourceAddonPath = sourceAddonsPath / addon
for configfile in configfiles:
dependencies += ["{}.pbo".format(x) for x in getdependencylist(configfile) if
x in addonlist and not x in dependencies]
print((addon, dependencies))
print(createaddonbuildercmd(projectPath, sourceAddonsPath, namespace, addon, destinationpath, keypath))
print("", file=f)
print(createaddonmakefiledependencies(addon, sourceAddonPath, destinationpath, dependencies), file=f)
print('\t{}'.format(createaddonbuildercmd(projectPath, sourceAddonPath, namespace,
addon, destinationpath, keypath)), file=f)
......@@ -4,10 +4,12 @@ arma3ToolsPath = Path("C:/Program Files (x86)/Steam/steamapps/common/Arma 3 Tool
addonBuilderExePath = arma3ToolsPath / "AddonBuilder/AddonBuilder.exe"
def createaddonbuildercmd(projectPath, sourceAddonsPath, namespace, addon, destinationpath, keypath):
sourceAddonPath = sourceAddonsPath / addon
cmd = '"{}" "{}" "{}" -clear -sign="{}" -project="{}" -binarizeAllTextures'.format(addonBuilderExePath,
sourceAddonPath, destinationpath,
keypath, projectPath)
return cmd
def createaddonbuildercmd(projectPath, sourceAddonPath, namespace, addon, destinationpath, keypath):
cmd = (str(addonBuilderExePath), str(sourceAddonPath), str(destinationpath), '-clear', '-sign="{}"'.format(keypath),
'-project="{}"'.format(projectPath), '-binarizeAllTextures')
cmdshell = '"{}" "{}" "{}" -clear -sign="{}" -project="{}" -binarizeAllTextures'.format(addonBuilderExePath,
sourceAddonPath,
destinationpath,
keypath, projectPath)
return cmdshell
def createmakefilealldependencies(destinationpath, addonlist):
dependencies = [str(destinationpath / dependency) + '.pbo' for dependency in addonlist]
return 'all: {}'.format(' '.join(dependencies))
def createaddonmakefiledependencies(addon, sourceAddonPath, destinationpath, dependencies):
dependencies = [str(destinationpath / dependency) for dependency in dependencies]
return '{}.pbo: $(shell find "{}" -type f) {}'.format(addon, sourceAddonPath, ' '.join(dependencies))
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment