) ) else: def install(context): make_sure_path_exists(os.path.join(config["paths"]["install"], "libs")) path_segments = [context['build_path'], "PCbuild"] if config['architecture'] == "x86_64": path_segments.append("amd64") path_segments.append("*.lib") shutil.copy( os.path.join(python['build_path'], "PC", "pyconfig.h"), os.path.join(python['build_path'], "Include", "pyconfig.h")) for f in glob(os.path.join(*path_segments)): shutil.copy(f, os.path.join(config["paths"]["install"], "libs")) return True python = Project("Python") \ .depend(build.Execute(install) .depend(msbuild.MSBuild("PCBuild/PCBuild.sln", "python,pyexpat", project_PlatformToolset=python_toolset) # .depend(build.Run(r'PCBuild\\build.bat -e -c Release -m -p {} "/p:PlatformToolset={}"'.format("x64" if config['architecture'] == 'x86_64' else "x86",config['vc_platform']), # environment=python_environment(), # working_directory=lambda: os.path.join(python['build_path'])) .depend(build.Run(upgrade_args, name="upgrade python project") .depend(github.Source("LePresidente", "cpython-1", config.get('python_version', "2.7")) \ .set_destination("python-{}".format(python_version)))) ) )
# 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(r"publish.bat" .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(msbuild.MSBuild("../nmm/NexusClient.sln", working_directory=lazy.Evaluate(lambda: os.path.join(ncc['build_path'], "..", "nmm"))) .depend(patch.Copy("NexusClient.sln", "../nmm") .depend(github.Source(config['Main_Author'], "modorganizer-NCC", "master") .set_destination(os.path.join("NCC", "NexusClientCli")) .depend(github.Source("Nexus-Mods", "Nexus-Mod-Manager", "master") .set_destination(os.path.join("NCC", "nmm")) ) ) ) ) ) Project("modorganizer-game_features") \ .depend(github.Source(config['Main_Author'], "modorganizer-game_features", "master", super_repository=tl_repo) .set_destination("game_features")) def gen_userfile_content(project): with open("CMakeLists.txt.user.template", 'r') as f: res = Formatter().vformat(
# 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 #boost_di_version = config['boost_di_version'] Project("boost_di") \ .depend(github.Source("boost-experimental", "di", "cpp14"))
if "NexusClientCli" not in sln.projectsByName: newproj = sln.AddProject('NexusClientCli', ProjectType.CSHARP_PROJECT, ncc_csproj, guid=projguid) log.info('Adding project %s (%s) to NexusClient.sln', newproj.name, newproj.guid) changed = True else: newproj = sln.projectsByName['NexusClientCli'] log.info('Project %s (%s) already exists in NexusClient.sln', newproj.name, newproj.guid) if newproj.projectfile != ncc_csproj: log.info('Changing projectfile: %s -> %s', newproj.projectfile, ncc_csproj) newproj.projectfile = ncc_csproj changed = True if changed: log.info('Writing NexusClientCli.sln') sln.SaveToFile(os.path.relpath(os.path.join(build_path, "Nexus-Mod-Manager", 'NexusClientCli.sln'))) # So we dont get conflicts when pulling return True # https://github.com/Nexus-Mods/Nexus-Mod-Manager/commit/03448e0eb02e08f37d7b66507d0537ab67841321 broke fomod installation # until this is fixed we lock NMM to the latest nexus release. Project("ncc") \ .depend(build.Run(r"publish.bat".format("-debug" if config['build_type'] == "Debug" else "-release", os.path.join(config["paths"]["install"], "bin")), working_directory=lazy.Evaluate(lambda: os.path.join(build_path, "NexusClientCli"))) .depend(msbuild.MSBuild(os.path.join(build_path, "Nexus-Mod-Manager", 'NexusClientCli.sln'), working_directory=lazy.Evaluate(lambda: os.path.join(build_path, "Nexus-Mod-Manager")), project_platform="Any CPU") .depend(build.Execute(prepare_nmm, name="append NexusClientCli project to NMM") .depend(github.Source("Nexus-Mods", "Nexus-Mod-Manager", "0.63.15", None, False)) .depend(github.Source(config['Main_Author'], "modorganizer-NCC", "master") .set_destination("NexusClientCli")))))
if config['architecture'] == "x86_64": path_segments.append("amd64") for f in glob(os.path.join(*path_segments,"*.lib")): shutil.copy(f, os.path.join(path_install, "libs")) for f in glob(os.path.join(*path_segments,"*.dll")): shutil.copy(f, os.path.join(path_install, "bin")) shutil.copy(os.path.join(path_install, "libs", "python{}.lib".format(python_version.replace(".", ""))), os.path.join(path_install, "libs", "python3.lib")) return True if config.get('Appveyor_Build', True): python = Project("Python") \ .depend(build.Execute(install) .depend(urldownload.URLDownload( config.get('prebuilt_url') + "python-prebuilt-{}.7z" .format(python_version + python_version_minor)). set_destination("python-{}".format(python_version + python_version_minor)))) else: python = Project("Python") \ .depend(build.Execute(install) .depend(build.Execute(python_prepare) .depend(msbuild.MSBuild("PCBuild/PCBuild.sln", "python,pyexpat", project_PlatformToolset=config['vc_platformtoolset']) .depend(build.Run(upgrade_args, name="upgrade python project") .depend(github.Source("python", "cpython", "v{}{}" .format(config['python_version'], config['python_version_minor']) , shallowclone=True) .set_destination("python-{}".format(python_version + python_version_minor)))))))
environment=config['__Default_environment'], working_directory=os.path.join(os.getcwd())) for dep in dependencies: unimake32.depend(dep) Project(project32 + "_32").depend(unimake32) else: Project(project32 + "_32").dummy().depend(project32) # usvfs build: vs_target = "Clean;Build" if config['rebuild'] else "Build" usvfs_build = \ msbuild.MSBuild("usvfs.sln", vs_target, os.path.join(config["paths"]["build"], "usvfs", "vsbuild"), "x64" if config['architecture'] == 'x86_64' else "x86") usvfs_build.depend( github.Source(config['Main_Author'], "usvfs", "0.3.1.0-Beta").set_destination("usvfs")) usvfs_build.depend("boost" + suffix_32) usvfs_build.depend("GTest" + suffix_32) usvfs.depend(usvfs_build) for author, git_path, path, branch, dependencies, Build in [ (config['Main_Author'], "modorganizer-game_features", "game_features", "master", [], False), (config['Main_Author'], "modorganizer-archive", "archive", "API_9.20", ["7zip", "Qt5", "boost"], True), (config['Main_Author'], "modorganizer-uibase", "uibase", "QT5.7", ["Qt5", "boost"], True), (config['Main_Author'], "modorganizer-lootcli", "lootcli", "master", ["LootApi", "boost"], True), (config['Main_Author'], "modorganizer-esptk", "esptk", "master", ["boost"], True),
log.info('Project %s (%s) already exists in NexusClient.sln', newproj.name, newproj.guid) if newproj.projectfile != ncc_csproj: log.info('Changing projectfile: %s -> %s', newproj.projectfile, ncc_csproj) newproj.projectfile = ncc_csproj changed = True if changed: log.info('Writing NexusClientCli.sln') sln.SaveToFile( os.path.relpath( os.path.join(build_path, "Nexus-Mod-Manager", 'NexusClientCli.sln')) ) # So we dont get conflicts when pulling return True # https://github.com/Nexus-Mods/Nexus-Mod-Manager/commit/03448e0eb02e08f37d7b66507d0537ab67841321 broke fomod installation # until this is fixed we lock NMM to the latest nexus release. Project("ncc") \ .depend(build.Run(r"publish.bat".format("-debug" if config['build_type'] == "Debug" else "-release", os.path.join(config["paths"]["install"], "bin")), working_directory=lazy.Evaluate(lambda: os.path.join(build_path, "NexusClientCli"))) .depend(msbuild.MSBuild(os.path.join(build_path, "Nexus-Mod-Manager", 'NexusClientCli.sln'), working_directory=lazy.Evaluate(lambda: os.path.join(build_path, "Nexus-Mod-Manager")), project_platform="Any CPU") .depend(build.Execute(prepare_nmm, name="append NexusClientCli project to NMM") .depend(github.Source("Nexus-Mods", "Nexus-Mod-Manager", config["nmm_version"], None, False)) .depend(github.Source(config['Main_Author'], "modorganizer-NCC", config["Main_Branch"]) .set_destination("NexusClientCli")))))
# 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/>. # TODO This is really old, should by updated to 0.13 from unibuild import Project from unibuild.modules import cmake, github from config import config Project("spdlog") \ .depend(cmake.CMake().arguments( [ "-DCMAKE_INSTALL_PREFIX:PATH={}/install".format(config['__build_base_path'].replace('\\', '/')), "-DCMAKE_BUILD_TYPE={0}".format(config["build_type"]), ]).install() .depend(github.Source("TanninOne", "spdlog", "master").set_destination("spdlog") ) )
# # 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 Project("fmtlib") \ .depend(cmake.CMake().arguments( [ "-DCMAKE_INSTALL_PREFIX:PATH={}".format(config["paths"]["install"].replace('\\', '/')), "-DCMAKE_BUILD_TYPE={0}".format(config["build_type"]), ]).install() .depend(github.Source("fmtlib", "fmt", "3.0.0").set_destination("fmt") ) )
changed = True else: newproj = sln.projectsByName['NexusClientCli'] log.info('Project %s (%s) already exists in NexusClient.sln', newproj.name, newproj.guid) if newproj.projectfile != ncc_csproj: log.info('Changing projectfile: %s -> %s', newproj.projectfile, ncc_csproj) newproj.projectfile = ncc_csproj changed = True if changed: log.info('Writing NexusClientCli.sln') sln.SaveToFile(os.path.relpath(os.path.join(ncc['build_path'], "..", "nmm", 'NexusClientCli.sln'))) # So we don't get conflicts when pulling. return True init_repos = github.Source("Nexus-Mods", "Nexus-Mod-Manager", "master") \ .set_destination(os.path.join("NCC", "nmm")) ncc = Project("NCC") \ .depend(build.Run(r"publish.bat" .format("-debug" if config['build_type'] == "Debug" else "-release", os.path.join(config["paths"]["install"], "bin")), working_directory=lazy.Evaluate(lambda: os.path.join(ncc['build_path'], "..", "NexusClientCli"))) .depend(msbuild.MSBuild(os.path.join(config['paths']['build'], "NCC", "nmm", 'NexusClientCli.sln'), working_directory=lazy.Evaluate( lambda: os.path.join(ncc['build_path'], "..", "nmm")), project_platform="Any CPU") .depend(build.Execute(prepare_nmm, name="append NexusClientCli project to NMM") .depend(init_repos).depend( github.Source(config['Main_Author'], "modorganizer-NCC", "master") \ .set_destination(os.path.join("NCC", "NexusClientCli"))
# 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 Project("GTest") \ .depend(cmake.CMake().arguments(["-DCMAKE_BUILD_TYPE={0}".format(config["build_type"])]) .depend(github.Source("google", "googletest", "master", commit="07d4a6e93de43ab47f5a5a3994009f53360e06c8"))) #.depend(github.Source("google", "googletest", "release-{}".format(googletest_version))))
usvfs = Project("usvfs") def usvfs_environment(): env = config['__environment'].copy() env['BOOST_PATH'] = boost_folder return env for (project32, dependencies) in [("boost", ["boost_prepare"]), ("GTest", []), ("usvfs", [])]: if config['architecture'] == 'x86_64': unimake32 = \ build.Run_With_Output(r'"{0}" unimake.py -d "{1}" --set architecture="x86" -b "build" -p "progress" -i "install" "{2}"'.format(sys.executable, config['__build_base_path'], project32), name="unimake_x86_{}".format(project32), environment=config['__Default_environment'], working_directory=os.path.join(os.getcwd())) for dep in dependencies: unimake32.depend(dep) Project(project32 + "_32").depend(unimake32) else: Project(project32 + "_32").dummy().depend(project32) usvfs \ .depend(msbuild.MSBuild("usvfs.sln", vs_target, os.path.join(build_path, "usvfs", "vsbuild"), "{}".format("x64" if config['architecture'] == 'x86_64' else "x86"), None, None, None, usvfs_environment()) .depend("boost" + suffix) .depend("GTest" + suffix) .depend(github.Source(config['Main_Author'], "usvfs", usvfs_version)))
return env for (project32, dependencies) in [("boost", ["boost_prepare"]), ("GTest", []), ("usvfs", [])]: if config['architecture'] == 'x86_64': unimake32 = \ build.Run_With_Output(r'"{0}" unimake.py --set architecture="x86" -b "build" -p "progress" -i "install" -d "{1}" {2} "{3}"'.format(sys.executable, config['__build_base_path'],' -s ' + ' -s '.join(config['__Arguments'].set) if config['__Arguments'].set is not None else "", project32), name="unimake_x86_{}".format(project32), environment=config['__Default_environment'], working_directory=os.path.join(os.getcwd())) for dep in dependencies: unimake32.depend(dep) Project(project32 + "_32").depend(unimake32) else: Project(project32 + "_32").dummy().depend(project32) if config['Appveyor_Build']: usvfs \ .depend(github.Source(config['Main_Author'], "usvfs", usvfs_version)).depend("usvfs_bin" + suffix) else: usvfs \ .depend(msbuild.MSBuild("usvfs.sln", vs_target, os.path.join(build_path, "usvfs", "vsbuild"), "{}".format("x64" if config['architecture'] == 'x86_64' else "x86"), None, None, None, usvfs_environment()) .depend("boost" + suffix) .depend("GTest" + suffix) .depend(github.Source(config['Main_Author'], "usvfs", usvfs_version)))
# 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 cmake, github, build from config import config import os import shutil import fnmatch googletest_version = "1.8.0" def install(context): for root, dirnames, filenames in os.walk( os.path.join(context['build_path'], "build")): for filename in fnmatch.filter(filenames, "*.lib"): shutil.copy(os.path.join(root, filename), os.path.join(config["paths"]["install"], "libs")) return True Project("GTest") \ .depend(build.Execute(install) .depend(cmake.CMake().arguments(["-Dgtest_force_shared_crt=ON", "-DCMAKE_BUILD_TYPE={0}".format(config["build_type"]) ]) .depend(github.Source("google", "googletest", "release-{}".format(googletest_version)))) )
# build_step = cmake.CMake().arguments(cmake_param).install() # for dep in dependencies: # build_step.depend(dep) project = Project(git_path) if Build: vs_step = cmake.CMakeVS().arguments(cmake_param).install() for dep in dependencies: vs_step.depend(dep) project.depend( vs_step.depend( github.Source(author, git_path, branch, super_repository=tl_repo).set_destination(path))) else: project.depend( github.Source(author, git_path, branch, super_repository=tl_repo).set_destination(path)) def python_zip_collect(context): import libpatterns import glob from zipfile import ZipFile ip = os.path.join(config["paths"]["install"], "bin") bp = python.python['build_path']
environment=config['__Default_environment'], working_directory=os.path.join(os.getcwd())) for dep in dependencies: unimake32.depend(dep) Project(project32 + "_32").depend(unimake32) else: Project(project32 + "_32").dummy().depend(project32) # TODO remove after repo merge def replace_paths(context): with open(os.path.join(build_path, "usvfs", "vsbuild", "external_dependencies.props"), 'r') as file: lines = file.readlines() # keep whitespaces at the beginning for formatting lines[4] = " <BOOST_PATH>..\..\{}</BOOST_PATH>\n".format(boost_folder) lines[5] = " <GTEST_PATH>..\..\{}</GTEST_PATH>\n".format(gtest_folder) file.seek(0) # clean file first or we leave trailing characters behind with open(os.path.join(build_path, "usvfs", "vsbuild", "external_dependencies.props"), 'w') as file: file.writelines(lines) return True usvfs \ .depend(msbuild.MSBuild("usvfs.sln", vs_target, os.path.join(build_path, "usvfs", "vsbuild"), "{}".format("x64" if config['architecture'] == 'x86_64' else "x86")) .depend(build.Execute(replace_paths) .depend("boost" + suffix) .depend("GTest" + suffix) .depend(github.Source(config['Main_Author'], "usvfs", config['Main_Branch']))))
Project(project32 + "_32").dummy().depend(project32) # TODO remove after repo merge def replace_paths(context): with open( os.path.join(build_path, "usvfs", "vsbuild", "external_dependencies.props"), 'r') as file: lines = file.readlines() # keep whitespaces at the beginning for formatting lines[4] = " <BOOST_PATH>..\..\{}</BOOST_PATH>\n".format( boost_folder) lines[5] = " <GTEST_PATH>..\..\{}</GTEST_PATH>\n".format( gtest_folder) file.seek(0) # clean file first or we leave trailing characters behind with open( os.path.join(build_path, "usvfs", "vsbuild", "external_dependencies.props"), 'w') as file: file.writelines(lines) return True usvfs \ .depend(msbuild.MSBuild("usvfs.sln", vs_target, os.path.join(build_path, "usvfs", "vsbuild"), "{}".format("x64" if config['architecture'] == 'x86_64' else "x86")) .depend(build.Execute(replace_paths) .depend("boost" + suffix) .depend("GTest" + suffix) .depend(github.Source(config['Main_Author'], "usvfs", "0.3.1.0-Beta"))))
# 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 cmake, github from config import config # asmjit doesn't currently have any tags/branches but not every commit is usable asmjit_tag = "master" Project("AsmJit") \ .depend(cmake.CMake().arguments( [ "-DASMJIT_STATIC=TRUE", "-DASMJIT_DISABLE_COMPILER=TRUE", "-DCMAKE_INSTALL_PREFIX:PATH={}/install".format(config['__build_base_path'].replace('\\', '/')), "-DCMAKE_BUILD_TYPE={0}".format(config["build_type"]), ]).install() .depend(github.Source("kobalicek", "asmjit", asmjit_tag, update=False) .set_destination("asmjit")) )
for f in glob(os.path.join(*path_segments, "_*.pdb")): shutil.copy(f, os.path.join(path_install, "pdb")) return True if config.get('Appveyor_Build', True): python = Project("Python") \ .depend(build.Execute(install) .depend(urldownload.URLDownload( config.get('prebuilt_url') + "python-prebuilt-{}.7z" .format(python_version + python_version_minor)). set_destination("python-{}".format(python_version + python_version_minor)))) else: Project("libffi").depend( github.Source("python", "cpython-bin-deps", "libffi", shallowclone=True).set_destination("libffi")) python = Project("Python") \ .depend(build.Execute(install) .depend(build.Execute(python_prepare) .depend(PydCompiler() .depend(msbuild.MSBuild("PCBuild/PCBuild.sln", "python,pythonw,python3dll,select,pyexpat,unicodedata,_queue,_bz2,_ssl,_overlapped", project_PlatformToolset=config['vc_platformtoolset'], reltarget="Release", project_AdditionalParams=[ "/p:bz2Dir={}".format(os.path.join(build_path, "bzip2")), "/p:zlibDir={}".format(os.path.join(build_path, "zlib-{}".format(config['zlib_version']))), "/p:opensslIncludeDir={}".format(os.path.join(build_path, "openssl-{}".format(openssl_version), "include")), "/p:opensslOutDir={}".format(os.path.join(build_path, "openssl-{}".format(openssl_version))), "/p:libffiIncludeDir={}".format(os.path.join(build_path, "libffi", bitness(), "include")),
usvfs = Project("usvfs") def usvfs_environment(): env = config['__environment'].copy() env['BOOST_PATH'] = boost_folder return env for (project32, dependencies) in [("boost", ["boost_prepare"]), ("GTest", []), ("usvfs", [])]: if config['architecture'] == 'x86_64': unimake32 = \ build.Run_With_Output(r'"{0}" unimake.py --set architecture="x86" -b "build" -p "progress" -i "install" -d "{1}" {2} "{3}"'.format(sys.executable, config['__build_base_path'],' -s ' + ' -s '.join(config['__Arguments'].set) if config['__Arguments'].set is not None else "", project32), name="unimake_x86_{}".format(project32), environment=config['__Default_environment'], working_directory=os.path.join(os.getcwd())) for dep in dependencies: unimake32.depend(dep) Project(project32 + "_32").depend(unimake32) else: Project(project32 + "_32").dummy().depend(project32) usvfs \ .depend(msbuild.MSBuild("usvfs.sln", vs_target, os.path.join(build_path, "usvfs", "vsbuild"), "{}".format("x64" if config['architecture'] == 'x86_64' else "x86"), None, None, None, usvfs_environment()) .depend("boost" + suffix) .depend("GTest" + suffix) .depend(github.Source('247321453', "usvfs", usvfs_version)))
"#define VER_FILEVERSION_STR \"{}\"\n" .format(config['override_build_version'])) if config['Appveyor_Build']: appveyor_cmake_step = cmake.CMakeJOM().arguments(cmake_param).install() if git_path != "cmake_common": appveyor_cmake_step.depend("cmake_common") for dep in dependencies: appveyor_cmake_step.depend(dep) if os.getenv("APPVEYOR_PROJECT_NAME","") == git_path: source_retrieval_step = appveyor.SetProjectFolder(os.getenv("APPVEYOR_BUILD_FOLDER", "")) else: source_retrieval_step = github.Source(author, git_path, branch, feature_branch=config['Feature_Branch'], super_repository=tl_repo).set_destination(path) if git_path == "modorganizer" and config['override_build_version']: #add patching step that depends on source retrieval patch_version_step.depend(source_retrieval_step) appveyor_cmake_step.depend(patch_version_step) else: appveyor_cmake_step.depend(source_retrieval_step) project.depend(appveyor_cmake_step) else: vs_cmake_step = cmake.CMakeVS().arguments(cmake_param).install() if git_path != "cmake_common": vs_cmake_step.depend("cmake_common")
depend( urldownload. URLDownload( "https://github.com/ModOrganizer2/modorganizer-umbrella/releases/download/1.1/lz4_prebuilt_{}.7z" .format(lz4_version_minor)).set_destination(lz_path)))) else: Project("lz4").depend( Patch.Copy( os.path.join(lz_path, "bin", "liblz4.pdb"), os.path.join(config["paths"]["install"], "pdb")).depend( Patch.Copy( os.path.join(lz_path, "bin", "liblz4.dll"), os.path.join( config["paths"]["install"], "bin", "dlls")).depend( build.Execute(copy_binaries).depend( msbuild.MSBuild( os.path.join(lz_path, "visual", "VS2017", 'lz4.sln'), project="liblz4-dll", working_directory=lazy.Evaluate( lambda: os.path.join(lz_path)), reltarget="Release").depend( build.Run( upgrade_args, name="upgrade lz4 project").depend( github.Source( "lz4", "lz4", lz4_version_minor). set_destination(lz_path)))))))
) ) else: def install(context): make_sure_path_exists( os.path.join(config["__build_base_path"], "install", "libs")) path_segments = [context['build_path'], "PCbuild"] if config['architecture'] == "x86_64": path_segments.append("amd64") path_segments.append("*.lib") shutil.copy( os.path.join(python['build_path'], "PC", "pyconfig.h"), os.path.join(python['build_path'], "Include", "pyconfig.h")) for f in glob(os.path.join(*path_segments)): shutil.copy( f, os.path.join(config["__build_base_path"], "install", "libs")) return True python = Project("Python") \ .depend(build.Execute(install) #.depend(msbuild.MSBuild("PCBuild/PCBuild.sln", "python") .depend(build.Run(r"PCBuild\\build.bat -e -c Release -m -p {}".format("x64" if config['architecture'] == 'x86_64' else ""), environment=python_environment(), working_directory=lambda: os.path.join(python['build_path'])) .depend(build.Run(upgrade_args, name="upgrade python project") .depend(github.Source("LePresidente", "cpython", "2.7").set_destination("Python-2.7.12"))) ) )
os.path.join(get_visual_studio_2017('15.0'), "..", "..", "..", "Common7", "IDE", "devenv.exe"), "PCBuild/pcbuild.sln", "/upgrade" ] def install(context): make_sure_path_exists(os.path.join(path_install, "libs")) path_segments = [context['build_path'], "PCbuild"] if config['architecture'] == "x86_64": path_segments.append("amd64") path_segments.append("*.lib") shutil.copy(os.path.join(python['build_path'], "PC", "pyconfig.h"), os.path.join(python['build_path'], "Include", "pyconfig.h")) for f in glob(os.path.join(*path_segments)): shutil.copy(f, os.path.join(path_install, "libs")) return True def download(context): return True python = Project("Python") \ .depend(build.Execute(install) .depend(msbuild.MSBuild("PCBuild/PCBuild.sln", "python,pyexpat", project_PlatformToolset=config['vc_platformtoolset']) .depend(build.Run(upgrade_args, name="upgrade python project") .depend(github.Source("LePresidente", "cpython-1", config.get('python_version', "2.7"), shallowclone=True) \ .set_destination("python-{}".format(python_version + python_version_minor))))))
# 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 cmake, github, build from config import config import os import shutil import fnmatch googletest_version = "1.7.0" def install(context): for root, dirnames, filenames in os.walk( os.path.join(context['build_path'], "build")): for filename in fnmatch.filter(filenames, "*.lib"): shutil.copy(os.path.join(root, filename), os.path.join(config["paths"]["install"], "libs")) return True Project("GTest") \ .depend(build.Execute(install) .depend(cmake.CMake().arguments(["-Dgtest_force_shared_crt=ON", "-DCMAKE_BUILD_TYPE={0}".format(config["build_type"]) ]) .depend(github.Source("google", "googletest", "master"))) )
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") .depend(github.Source("TanninOne", "modorganizer-NCC", "master") .set_destination(os.path.join("NCC", "NexusClientCli")) .depend(hg.Clone("http://hg.code.sf.net/p/nexusmodmanager/codehgdev45") .set_destination(os.path.join("NCC", "nmm")) ) ) ) ) # ) Project("modorganizer-game_features") \ .depend(github.Source("TanninOne", "modorganizer-game_features", "master", super_repository=tl_repo) .set_destination("game_features")) def gen_userfile_content(project): with open("CMakeLists.txt.user.template", 'r') as f: res = Formatter().vformat(