Commit 111868c6 authored by Legodev's avatar Legodev

added support for mikeros tools

parent 53aa0b5a
Pipeline #4 canceled with stages
......@@ -3,8 +3,10 @@ import subprocess
from pathlib import Path
from utils.findconfigfiles import findconfigfiles
from utils.getdependencylist import getdependencylist
from utils.createaddonbuildercmd import createaddonbuildercmd, arma3ToolsPath, addonBuilderExePath
from utils.createaddonmakefiledependencies import createmakefilealldependencies, createaddonmakefiledependencies
from utils.createaddonbuildercmd import createaddonbuildercmd, arma3ToolsPath, addonBuilderExePath, createsigncmd, \
DSSignFileExePath, MakePboExePath, MakePboOptions, createmikeromakepbocmd
from utils.createaddonmakefiledependencies import createmakefilealldependencies, createaddonmakefiledependencies, \
createaddonmakefiledependenciesrefs, createaddonmakefiledependenciessign
repo = "Client_Files"
branch = "PreRelease"
......@@ -29,6 +31,9 @@ if createMakefile:
with open("Makefile", "w") as f:
print('ADDONBUILDEREXEPATH={}'.format(addonBuilderExePath), file=f)
print('DSSIGNFILEEXEPATH={}'.format(DSSignFileExePath), file=f)
print('MAKEPBOEXEPATH={}'.format(MakePboExePath), file=f)
print('MAKEPBOOPTIONS={}'.format(MakePboOptions), file=f)
print('SOURCEADDONSPATH={}'.format(sourceAddonsPath), file=f)
print('DESTINATIONPATH={}'.format(destinationpath), file=f)
print('PROJECTPATH={}'.format(projectPath), file=f)
......@@ -44,10 +49,16 @@ if createMakefile:
dependencies += [x for x in getdependencylist(configfile) if
x in addonlist and not x in dependencies]
print("", file=f)
print(createaddonmakefiledependenciesrefs(addon, destinationpath, branch), file=f)
print("", file=f)
print(createaddonmakefiledependencies(addon, sourceAddonPath, destinationpath, dependencies), file=f)
print('\t{}'.format(createaddonbuildercmd(projectPath, sourceAddonPath, namespace,
addon, destinationpath, keypath)[1]), file=f)
# print('\t{}'.format(createaddonbuildercmd(projectPath, sourceAddonPath, namespace,
# addon, destinationpath, keypath)[1]), file=f)
print('\t{}'.format(createmikeromakepbocmd(sourceAddonsPath, addon, destinationpath)[1]), file=f)
print("", file=f)
print(createaddonmakefiledependenciessign(addon, destinationpath, branch), file=f)
print('\t{}'.format(createsigncmd(addon, destinationpath, keypath)[1]), file=f)
else:
for addon in addonlist:
......
from pathlib import Path
arma3ToolsPath = Path("C:/Program Files (x86)/Steam/steamapps/common/Arma 3 Tools/")
mikerosToolsPath = Path("C:/Program Files (x86)/Mikero/DePboTools/bin/")
addonBuilderExePath = arma3ToolsPath / "AddonBuilder/AddonBuilder.exe"
DSSignFileExePath = arma3ToolsPath / "DSSignFile/DSSignFile.exe"
MakePboExePath = mikerosToolsPath / "MakePbo.exe"
MakePboOptions = "-X=thumbs.db,*.txt,*.h,*.dep,*.cpp,*.bak,*.png,*.log,source -PgFWB"
def createaddonbuildercmd(projectPath, sourceAddonsPath, namespace, addon, destinationpath, keypath):
sourceAddonPath = sourceAddonsPath / addon
cmd = (str(addonBuilderExePath), str(sourceAddonPath), str(destinationpath), '-clear', '-sign="{}"'.format(keypath),
'-project="{}"'.format(projectPath), '-include={}'.format(projectPath / "includes.txt"),'-binarizeAllTextures')
'-project="{}"'.format(projectPath), '-include={}'.format(projectPath / "includes.txt"),
'-binarizeAllTextures')
cmdshell = '"{}" "{}" "{}" -clear -sign="{}" -project="{}" -include="{}" -binarizeAllTextures' \
''.format("${ADDONBUILDEREXEPATH}",
......@@ -18,3 +23,22 @@ def createaddonbuildercmd(projectPath, sourceAddonsPath, namespace, addon, desti
"${INCLUDELIST}")
return cmd, cmdshell
def createsigncmd(addon, destinationpath, keypath):
destAddonPath = destinationpath / '{}.pbo'.format(addon)
cmd = (str(DSSignFileExePath), keypath, str(destinationpath))
cmdshell = '"{}" "{}" ${{DESTINATIONPATH}}/{}.pbo'.format("${DSSIGNFILEEXEPATH}", "${KEYPATH}", addon)
return cmd, cmdshell
def createmikeromakepbocmd(sourceAddonsPath, addon, destinationpath):
sourceAddonPath = sourceAddonsPath / addon
cmd = (str(MakePboExePath), MakePboOptions, str(sourceAddonPath), str(destinationpath))
cmdshell = '"{}" "{}" "{}" "{}"'.format("${MAKEPBOEXEPATH}", "${MAKEPBOOPTIONS}", sourceAddonPath,
"${DESTINATIONPATH}")
return cmd, cmdshell
def createmakefilealldependencies(destinationpath, addonlist):
dependencies = ["${{DESTINATIONPATH}}/{}.pbo".format(dependency) for dependency in addonlist]
return 'all: {}'.format(' '.join(dependencies))
return 'all: {}'.format(' '.join(addonlist))
def createaddonmakefiledependencies(addon, sourceAddonPath, destinationpath, dependencies):
dependencies = ["${{DESTINATIONPATH}}/{}.pbo".format(dependency) for dependency in dependencies]
return '${{DESTINATIONPATH}}/{}.pbo: $(shell find "{}" -type f | sed \'s/ /\\\\\\\\ /g\') {}'.format(addon, sourceAddonPath, ' '.join(dependencies))
\ No newline at end of file
# dependencies = ["${{DESTINATIONPATH}}/{}.pbo".format(dependency) for dependency in dependencies]
return '${{DESTINATIONPATH}}/{}.pbo: $(shell find "{}" -type f | sed \'s/ /\\\\\\\\ /g\') {}'.format(addon, sourceAddonPath, ' '.join(dependencies))
def createaddonmakefiledependenciesrefs(addon, destinationpath, branch):
# dependencies = ["${{DESTINATIONPATH}}/{}.pbo".format(dependency) for dependency in dependencies]
return '{}: ${{DESTINATIONPATH}}/{}.pbo ${{DESTINATIONPATH}}/{}.pbo.DesolationREDUX.{}.bisign'.format(addon, addon, addon, branch)
def createaddonmakefiledependenciessign(addon, destinationpath, branch):
# dependencies = ["${{DESTINATIONPATH}}/{}.pbo".format(dependency) for dependency in dependencies]
return '${{DESTINATIONPATH}}/{}.pbo.DesolationREDUX.{}.bisign: ${{DESTINATIONPATH}}/{}.pbo '.format(addon, branch, addon)
\ 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