-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
124 lines (109 loc) · 3.53 KB
/
main.py
File metadata and controls
124 lines (109 loc) · 3.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# ##### BEGIN GPL LICENSE BLOCK #####
#
# Copyright 2012, Thomas Dinges
#
# This program 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 2
# of the License, or (at your option) any later version.
#
# This program 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 this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
import os
from subprocess import Popen
# Compile Helper Includes
import svn
import tools
import scons
# Path to the root folder
root = "D:/blender_dev"
# Path to the code folder
code_path = str(root + "/code/")
# Available checkouts
source_tree = ("trunk", "soc-2011-tomato", "cycles", "tile", "render25", "asset-browser")
def print_list():
nr = 1
for elem in source_tree:
print ("%s: %s" % (nr, elem))
nr += 1
br_in = int(input("Tree: "))
return (source_tree[br_in-1])
def sub_call(tree, path):
os.system("title %s" % tree)
while True:
print("1: Compile a fresh build\n")
print("10: Compile Release (Installer)\n")
print("2: Update")
print("3: Commit")
print("4: Revert\n")
print("5: Start Blender\n")
print("6: Compile")
print("7: Clean\n")
print("0: Back to Main menu")
print("")
op = int(input(">> "))
nsis = False
if op == 1:
bit = int(input("32 or 64 bit? "))
svn.update(path)
rev = svn.revision(root, path)
scons.clean(path)
if bit == 32:
scons.compile_32(path, nsis)
tools.copy_libs_32(tree)
elif bit == 64:
scons.compile_64(path, nsis)
tools.copy_libs_64(tree)
else:
continue
tools.compress(root, tree, rev, bit)
elif op == 10:
bit = int(input("32 or 64 bit? "))
svn.update(path)
rev = svn.revision(root, path)
scons.clean(path)
if bit == 32:
scons.compile_32(path, nsis=True)
elif bit == 64:
scons.compile_64(path, nsis=True)
else:
continue
elif op == 2:
svn.update(path)
elif op == 3:
svn.commit(path)
elif op == 4:
svn.revert(path)
elif op == 5:
try:
os.chdir('%s/install/%s' % (root, tree))
Popen('%s/install/%s/blender.exe' % (root, tree))
except:
print ("No binary file found. Please recompile.")
elif op == 6:
bit = int(input("32 or 64 bit? "))
if bit == 32:
scons.compile_32(path, nsis)
elif bit == 64:
scons.compile_64(path, nsis)
elif op == 7:
scons.clean(path)
elif op == 0:
os.system('cls')
start()
def start():
print ("Welcome to the Blender Compile Helper")
#Variablen
tree = print_list()
full_path = str(code_path + tree)
os.system('cls')
sub_call(tree, full_path)
start()