Просмотр исходного кода

Improved editor package script so it doesn't include unnecessary files

BearishSun 9 лет назад
Родитель
Сommit
ac751447f1
1 измененных файлов с 7 добавлено и 6 удалено
  1. 7 6
      Scripts/package_editor.py

+ 7 - 6
Scripts/package_editor.py

@@ -7,14 +7,14 @@
 # Usage: "package_editor $Configuration"
 # Usage: "package_editor $Configuration"
 # Where: $Configuration - e.g. Debug, OptimizedDebug
 # Where: $Configuration - e.g. Debug, OptimizedDebug
 
 
-# TODO: Don't package Settings.asset, Game binaries, Example binaries
-
 import os
 import os
 import sys
 import sys
 import shutil
 import shutil
 
 
 configuration = 'OptimizedDebug' #sys.argv[1]
 configuration = 'OptimizedDebug' #sys.argv[1]
-dataFoldersToIgnore = ['Examples', 'Raw']
+dataEntriesToIgnore = ['Examples', 'Raw', 'Settings.asset']
+binEntriesToIgnore = ['Game.exe', 'Game.pdb', 'ExampleProject.exe', 'ExampleProject.pdb',
+                      'BansheeD3D9RenderAPI.dll', 'BansheeD3D9RenderAPI.pdb']
 
 
 dataFolder = 'Data'
 dataFolder = 'Data'
 assembliesFolder = 'Assemblies'
 assembliesFolder = 'Assemblies'
@@ -38,7 +38,7 @@ def ignore_data(path, entries):
     if path != inputDataFolder:
     if path != inputDataFolder:
         return []
         return []
 
 
-    return list(set(dataFoldersToIgnore) & set(entries))    
+    return list(set(dataEntriesToIgnore) & set(entries))    
 
 
 def package_editor():
 def package_editor():
     if os.path.exists(outputBaseFolder):
     if os.path.exists(outputBaseFolder):
@@ -52,7 +52,8 @@ def package_editor():
     for root, dirs, files in os.walk(inputLibFolder):
     for root, dirs, files in os.walk(inputLibFolder):
         for file in files:
         for file in files:
             if(file.lower().endswith(('.dll', '.exe', '.pdb', '.so'))):
             if(file.lower().endswith(('.dll', '.exe', '.pdb', '.so'))):
-                filePath = os.path.join(root, file)
-                shutil.copy(filePath, outputLibFolder)
+                if(not file in binEntriesToIgnore):
+                    filePath = os.path.join(root, file)
+                    shutil.copy(filePath, outputLibFolder)
 
 
 package_editor()
 package_editor()