def create_stylesheet_project(author, name, filename, extension="7z"): version = "v" + config[name + "_version"] dir = name + "-" + version Project(name) \ .depend(build.Execute(lambda context: copy_stylesheets(context, dir)) .depend(github.Release(author, name, version, filename, extension)))
# # This file is part of Mod Organizer. # # Mod Organizer is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Mod Organizer is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. from unibuild import Project from unibuild.modules import github, Patch from config import config import os lz4_version = "v1.7.4" Project("lz4") \ .depend(Patch.Copy(os.path.join(config['paths']['build'], "lz4", "dll", "liblz4.dll"), os.path.join(config["paths"]["install"], "bin", "dlls")) .depend(github.Release("lz4", "lz4", lz4_version, "lz4_{0}_win{1}".format(lz4_version.replace(".","_"),"64" if config['architecture'] == 'x86_64' else "32"),"zip") .set_destination("lz4") ) )
from config import config from unibuild import Project from unibuild.modules import build, github, Patch # TODO: transifex version = "v2.1.0" def translations_install(context): try: os.mkdir( os.path.join(config["paths"]["install"], "bin", "translations")) except: pass for file in glob.iglob( os.path.join(config["paths"]["build"], "translations-{}".format(version), "*.qm")): if os.path.isfile(file): shutil.copy2( file, os.path.join(config["paths"]["install"], "bin", "translations")) return True Project("translations") \ .depend(build.Execute(translations_install) .depend(github.Release("LePresidente", "modorganizer", version, "translations", extension="7z", tree_depth=1) .set_destination("translations-{}".format(version))))
from unibuild.projects import googletest, lz4, WixToolkit # TODO modorganizer-lootcli needs an overhaul as the api has changed alot def bitness(): return "x64" if config['architecture'] == "x86_64" else "Win32" def bitnessLoot(): return "64" if config['architecture'] == "x86_64" else "32" Project("LootApi") \ .depend( Patch.Copy("loot_api.dll", os.path.join(config["paths"]["install"], "bin", "loot")) .depend(github.Release("loot", "loot-api", loot_version, "loot_api-{}-0-{}_update-deps-win{}".format(loot_version, commit_id, bitnessLoot()), "7z", tree_depth=1) .set_destination("lootapi")) ) tl_repo = git.SuperRepository("modorganizer_super") def gen_userfile_content(project): with open("CMakeLists.txt.user.template", 'r') as f: res = Formatter().vformat( f.read(), [], FormatDict({ 'build_dir': project['edit_path'], 'environment_id': config['qt_environment_id'], 'profile_name': config['qt_profile_name'],
logging.error( "failed to run pyqt configure.py (returncode %s), see %s and %s", proc.returncode, soutpath, serrpath) return False return True init_transifex_repo = build.Run( "{} init --token={} --force --no-interactive".format( transifex_client_binary, transifex_api), name="init transifex repository") config_transifex_repo = build.Run( "{} config mapping-remote https://www.transifex.com/tannin/mod-organizer/". format(transifex_client_binary), name="config transifex repository") pull_transifex_repo = build.Run("{} pull -a -f --minimum-perc={}".format( transifex_client_binary, transifex_minimum_percentage), name="pull transifex repository") Project("translations") \ .depend(GenerateTranslations() .depend(pull_transifex_repo .depend(config_transifex_repo .depend(init_transifex_repo .depend(build.Execute(translations_stage) .depend(github.Release("transifex", "transifex-client", transifex_version, "tx.py27.x64", extension="exe") .set_destination("transifex-translations")))))))
# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Mod Organizer is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. import os from config import config from unibuild import Project from unibuild.modules import github, Patch loot_version = config['loot_version'] loot_commit = config['loot_commit'] loot_branch = config['loot_branch'] def bitnessLoot(): return "64" if config['architecture'] == "x86_64" else "32" # TODO modorganizer-lootcli needs an overhaul as the api has changed alot Project("libloot") \ .depend(Patch.Copy("loot.dll", os.path.join(config["paths"]["install"], "bin", "loot")) .depend(github.Release("loot", "libloot", loot_version, "libloot-{}-0-{}_{}-win{}".format(loot_version, loot_commit, loot_branch, bitnessLoot()), "7z", tree_depth=1) .set_destination("libloot-{}-{}".format(loot_version, loot_commit))))
# # Mod Organizer is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Mod Organizer is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. import os from config import config from unibuild import Project from unibuild.modules import github, Patch loot_version = config['loot_version'] loot_commit = config['loot_commit'] def bitnessLoot(): return "64" if config['architecture'] == "x86_64" else "32" # TODO modorganizer-lootcli needs an overhaul as the api has changed alot Project("lootapi") \ .depend(Patch.Copy("loot_api.dll", os.path.join(config["paths"]["install"], "bin", "loot")) .depend(github.Release("loot", "loot-api", loot_version, "loot_api-{}-0-{}_dev-win{}".format(loot_version, loot_commit, bitnessLoot()), "7z", tree_depth=1) .set_destination("lootapi-{}-{}".format(loot_version, loot_commit))))
# # This file is part of Mod Organizer. # # Mod Organizer is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Mod Organizer is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. from unibuild import Project from unibuild.modules import github from config import config import os WixToolSet_Version_Binary = config['WixToolSet_Version_Binary'] Project("WixToolkit") \ .depend(github.Release("wixtoolset", "wix3", "wix{}rtm".format(WixToolSet_Version_Binary), "wix{}-binaries".format(WixToolSet_Version_Binary)) .set_destination("WixToolkit"))
commit_id = "g0fcf788" """ Projects """ from unibuild.projects import sevenzip, qt5, boost, zlib, python, sip, pyqt5, ncc from unibuild.projects import asmjit, udis86, googletest, spdlog, fmtlib, lz4, WixToolkit # TODO modorganizer-lootcli needs an overhaul as the api has changed alot def bitness(): return "x64" if config['architecture'] == "x86_64" else "Win32" Project("LootApi") \ .depend(Patch.Copy("loot_api.dll".format(loot_version, commit_id), os.path.join(config["paths"]["install"], "bin", "loot")) .depend(github.Release("loot", "loot", loot_version, "loot-api_{}-0-{}_dev_{}".format(loot_version, commit_id, bitness()),"7z",tree_depth=1) .set_destination("lootapi")) ) tl_repo = git.SuperRepository("modorganizer_super") def gen_userfile_content(project): with open("CMakeLists.txt.user.template", 'r') as f: res = Formatter().vformat( f.read(), [], FormatDict({ 'build_dir': project['edit_path'], 'environment_id': config['qt_environment_id'], 'profile_name': config['qt_profile_name'], 'profile_id': config['qt_profile_id'] }))
from config import config return "x64" if config['architecture'] == "x86_64" else "x86" libbsarch_version = config['libbsarch_version'] libbsarch_path = os.path.join( config['paths']['build'], "libbsarch-{}-{}".format(libbsarch_version, bitness())) def deploy_dll(context): if not os.path.exists( os.path.join(config["paths"]["install"], "bin", "dlls")): os.mkdir(os.path.join(config["paths"]["install"], "bin", "dlls")) shutil.copy( os.path.join(libbsarch_path, "libbsarch.dll"), os.path.join(config["paths"]["install"], "bin", "dlls", "libbsarch.dll")) return True Project("libbsarch").depend( build.Execute(deploy_dll).depend( github.Release("ModOrganizer2", "libbsarch", version=libbsarch_version, filename="libbsarch-{}-release-{}".format( libbsarch_version, bitness()), extension="7z", tree_depth=1).set_destination(libbsarch_path)))
# Copyright (C) 2015 Sebastian Herbord. All rights reserved. # Copyright (C) 2016 - 2018 Mod Organizer contributors. # # This file is part of Mod Organizer. # # Mod Organizer is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Mod Organizer is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. from config import config from unibuild import Project from unibuild.modules import github WixToolset_version = config['WixToolset_version'] Project("WixToolkit") \ .depend(github.Release("wixtoolset", "wix3", "wix{}rtm".format(WixToolset_version), "wix{}-binaries".format(WixToolset_version)) .set_destination("WixToolkit-{}".format(WixToolset_version)))
# Copyright (C) 2015 Sebastian Herbord. All rights reserved. # Copyright (C) 2016 - 2019 Mod Organizer contributors. # # This file is part of Mod Organizer. # # Mod Organizer is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Mod Organizer is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. from config import config from unibuild import Project from unibuild.modules import cmake, github, build fmt_version = config['fmt_version'] Project("fmt") \ .depend(cmake.CMake().arguments(["-DCMAKE_BUILD_TYPE={0}".format(config["build_type"]), "-DFMT_TEST=OFF", "-DFMT_DOC=OFF"]) .depend(github.Release("fmtlib", "fmt", fmt_version, "fmt-" + fmt_version, tree_depth=1)))
""" Settings """ loot_version = "v0.8.0" """ Projects """ from unibuild.projects import sevenzip, qt5, boost, zlib, python, sip, pyqt5 from unibuild.projects import asmjit, udis86, googletest Project("LootApi") \ .depend(patch.Copy("loot32.dll", os.path.join(config['__build_base_path'], "install", "bin", "loot")) .depend(github.Release("loot", "loot", loot_version, "LOOT.API.{}".format(loot_version), "7z") .set_destination("lootapi")) ) tl_repo = git.SuperRepository("modorganizer_super") # install compiled mo components """ doesn't build through msbuild but builds fine in IDE?? .depend(msbuild.MSBuild("../nmm/NexusClient.sln", "NexusClientCli", working_directory=lazy.Evaluate(lambda: os.path.join(ncc['build_path'], "..", "nmm"))) """ ncc = Project("NCC") \ .depend(build.Run("powershell .\\publish.ps1 {0} -outputPath {1}" .format("-debug" if config['build_type'] == "Debug" else "-release", os.path.join(config['__build_base_path'], "install", "bin")), working_directory=lazy.Evaluate(lambda: ncc['build_path'])) .depend(patch.Copy("NexusClient.sln", "../nmm")