Browse Source

Refactor: Cleaned up old scripts

BearishSun 6 years ago
parent
commit
fd593da459

+ 4 - 4
Scripts/build_editor_win_x64.py

@@ -9,8 +9,8 @@
 import os
 
 msbuildPath = "C:\\Program Files (x86)\\MSBuild\\14.0\\Bin\\amd64"
-configuration = 'OptimizedDebug' #sys.argv[1]
-buildPath = "..\\Build\\VS2015\\"
+configuration = 'Release' #sys.argv[1]
+buildPath = "..\\build\\"
 solutionPath = buildPath + "Banshee.sln"
 
 if not os.path.exists(msbuildPath):
@@ -20,9 +20,9 @@ if not os.path.exists(msbuildPath):
 os.environ["PATH"] += os.pathsep + msbuildPath
 
 # Build the engine
-os.system("msbuild {0} /p:Configuration=OptimizedDebug;Platform=x64 /m".format(solutionPath))
+os.system("msbuild {0} /p:Configuration={1};Platform=x64 /m".format(solutionPath, configuration))
 
 # Build Win32 game executable
-os.system("msbuild {0} /p:Configuration=Release;Platform=x64 /m".format(solutionPath))
+os.system("msbuild {0} /p:Configuration={1};Platform=x64 /m".format(solutionPath, configuration))
 
 os.system("package_editor.py " + configuration)

+ 0 - 38
Scripts/build_editor_win_x64_fast.py

@@ -1,38 +0,0 @@
-#!/usr/bin/python
-
-# Builds and packages the editor. Make sure you have MSBuild
-# installed and the path is valid.
-
-# Usage: "build_editor_win_x64 $Configuration"
-# Where: $Configuration - e.g. OptimizedDebug, Release
-
-import os
-import multiprocessing
-
-msbuildPath = "C:\\Program Files (x86)\\MSBuild\\14.0\\Bin\\amd64"
-buildPath = "..\\Build\\VS2015\\"
-
-def buildCSWorker(args):
-    projectPath = buildPath + "\\" + args[0] + "\\" + args[0] + ".csproj"
-    os.system("msbuild {0} /t:ClCompile /p:Configuration={1};Platform=x64 /m".format(projectPath, args[1]))
-    return
-
-if __name__ == '__main__':
-    if not os.path.exists(msbuildPath):
-        print("MSBuild path is not valid. Used path {0}: ".format(msbuildPath))
-        exit;
-
-    os.environ["PATH"] += os.pathsep + msbuildPath
-
-    # Build native projects
-    os.system("fast_build.py OptimizedDebug x64")
-    os.system("fast_build.py Release x64")
-
-    # Build managed projects
-    csProjectArgs = [("MBansheeEngine", "Debug"), ("MBansheeEngine", "Release"),
-                     ("MBansheeEditor", "Debug"), ("MBansheeEditor", "Release")]
-
-    pool = multiprocessing.Pool(multiprocessing.cpu_count())
-    pool.map(buildCSWorker, csProjectArgs)
-        
-    os.system("package_editor.py " + configuration)

+ 0 - 41
Scripts/fast_build.py

@@ -1,41 +0,0 @@
-#!/usr/bin/python
-
-# Builds all projects in the provided solution in a parallel way.
-
-# Usage: "fast_build $Solution $Configuration $Platform"
-# Where: $Solution - Path to a .sln file, e.g. Banshee.sln
-# Where: $Configuration - e.g. Debug, OptimizedDebug, Release
-# Where: $Platform - x86, x64
-
-# Usage example: fast_build Banshee.sln Debug x64
-
-# msbuild must be available in the PATH variable, or the script must be ran from VS or VS Command Prompt
-
-import sys
-import os
-import multiprocessing
-import re
-
-slnPath = sys.argv[1]
-configuration = sys.argv[2]
-platform = sys.argv[3]
-slnDir = os.path.dirname(slnPath)
-
-# Triggers compile for a single project
-def compileWorker(projectPath):
-    if not os.path.isabs(projectPath):
-        projectPath = os.path.join(slnDir, projectPath)
-        
-    os.system("msbuild {0} /t:ClCompile /p:Configuration={1};Platform={2}".format(projectPath, configuration, platform))
-    return
-
-# Since we'll be running this script using multiple processes, ensure this bit only runs on the main process
-if __name__ == '__main__':
-
-    # Parse the solution file to find all C++ projects
-    slnContents = open(slnPath, 'r').read()
-    projects = re.findall(r"Project\(\".*\"\) = \".*\", \"(.*\.vcxproj)\", \".*\"\n", slnContents);
-
-    # Launch a compile thread for every project
-    pool = multiprocessing.Pool(multiprocessing.cpu_count())
-    pool.map(compileWorker, projects)

+ 0 - 121
Scripts/generate_cmake_sources.py

@@ -1,121 +0,0 @@
-#!/usr/bin/python
-
-# Script that parses Visual Studio projects and generates a list of source
-# and header files used by those projects. The generated files are in CMake
-# format. This script is primarily meant to be used by those who use the
-# VS projects as their primary workflow, but want to keep the CMake build
-# up to date. Simply run this script to re-generate the source/header file
-# list in CMakeLists.txt for all projects.
-#
-# The output is generated as CMakeSources.cmake in every project's sub-directory,
-# which is generally included and used by CMakeLists.txt.
-#
-# This will only generate a list of include/source files, and will not preserve
-# any other VS options (like compiler/linker settings). For those you must edit
-# CMakeLists.txt manually. This script will however preserve VS filters (folders).
-
-import os
-import sys
-import shutil
-import xml.etree.ElementTree
-
-def getLocalPath(path):
-    remainingPath = path
-    localPath = ''
-
-    while True:
-        split = os.path.split(remainingPath)
-    
-        remainingPath = split[0]
-        tail = split[1]
-        
-        if localPath:
-            localPath = tail + '/' + localPath
-        else:
-            localPath = tail;
-        
-        if tail == 'Source' or tail == 'Include':
-            break
-
-        if not remainingPath:
-            localPath = os.path.split(path)[1]
-            break
-
-    return localPath
-
-def getFilterVarName(prefix, filter):
-    output = filter.replace('Source Files\\', 'SRC_')
-    output = output.replace('Header Files\\', 'INC_')
-
-    output = output.replace('Source Files', 'SRC_NOFILTER')
-    output = output.replace('Header Files', 'INC_NOFILTER')
-
-    output = output.replace('\\', '_')
-    output = output.replace('/', '_')
-
-    return prefix + output.upper()
-
-def processEntries(tag, group, filters):
-    for child in group.iter('{http://schemas.microsoft.com/developer/msbuild/2003}' + tag):
-        filterElem = child.find('{http://schemas.microsoft.com/developer/msbuild/2003}Filter')
-
-        if filterElem is not None:
-            filterName = filterElem.text
-            if filterName not in filters:
-                filters[filterName] = []
-                
-            filters[filterName].append(getLocalPath(child.get('Include')))
-
-# Process a .filter file and output a corresponding .txt file containing the necessary CMake commands
-def processFile(file):
-    tree = xml.etree.ElementTree.parse(file)
-    root = tree.getroot()
-
-    filters = {}
-
-    for group in root.iter('{http://schemas.microsoft.com/developer/msbuild/2003}ItemGroup'):
-        processEntries('ClInclude', group, filters)
-        processEntries('ClCompile', group, filters)      
-
-    outputName = os.path.splitext(file)[0]
-    outputName = os.path.splitext(outputName)[0]
-    outputName = os.path.split(outputName)[1]
-    
-    varPrefix = 'BS_' + outputName.upper() + '_'
-    outputFolder = '..\\Source\\' + outputName + '\\CMakeSources.cmake'
-
-    with open(outputFolder, 'w') as outputFile:
-        # Output variables containing all the .h and .cpp files
-        for key in filters.keys():
-            outputFile.write('set(%s\n' % getFilterVarName(varPrefix, key))
-
-            for entry in filters[key]:
-                outputFile.write('\t\"%s\"\n' % entry)
-            
-            outputFile.write(')\n\n')
-
-        # Output source groups (filters)
-        for key in filters.keys():
-            filter = key.replace('\\', '\\\\')
-            outputFile.write('source_group(\"{0}\" FILES ${{{1}}})\n'.format(filter, getFilterVarName(varPrefix, key)))
-
-        outputFile.write('\n')
-
-        # Output a variable containing all variables from the previous step so we can use it for compiling
-        outputFile.write('set(%sSRC\n' % varPrefix)
-        for key in filters.keys():
-            outputFile.write('\t${%s}\n' % getFilterVarName(varPrefix, key))
-
-        outputFile.write(')')
-
-# Go through all .filter files
-def processAllFiles():
-    solutionFolder = '..\\Build\\VS2015'
-
-    for root, dirs, files in os.walk(solutionFolder):
-        for file in files:
-            if(file.lower().endswith('.filters')):
-                filePath = os.path.join(root, file)
-                processFile(filePath)
-
-processAllFiles()

+ 1 - 1
Scripts/package_editor.py

@@ -23,7 +23,7 @@ libFolder = 'x64\\' + configuration + '\\'
 
 inputDataFolder = '..\\' + dataFolder
 inputBsfDataFolder = '..\\' + bsfDataFolder
-inputBinFolder = '..\\bin\\'
+inputBinFolder = '..\\build\\bin\\'
 inputAssembliesFolder = inputBinFolder + assembliesFolder
 inputMonoFolder = inputBinFolder + monoFolder
 inputLibFolder = inputBinFolder + libFolder

+ 0 - 3
Scripts/pdb2mdb.bat

@@ -1,3 +0,0 @@
-IF EXIST "%MONO_INSTALL_DIR%\bin\pdb2mdb.bat" (
- IF %2 == "Debug" CALL "%MONO_INSTALL_DIR%\bin\pdb2mdb.bat" %1
-)