Revision 1883,
984 bytes
checked in by tekrjant, 12 years ago
(diff) |
ei oo os.time niin ei sitten.
|
Line | |
---|
1 | import sys |
---|
2 | import os |
---|
3 | from os.path import join, exists, abspath |
---|
4 | from shutil import * |
---|
5 | from glob import * |
---|
6 | from subprocess import * |
---|
7 | |
---|
8 | |
---|
9 | def main(): |
---|
10 | root_dir = abspath('.') |
---|
11 | games_dir = join(root_dir, 'pelit') |
---|
12 | |
---|
13 | if exists(games_dir): |
---|
14 | rmtree(games_dir) |
---|
15 | os.mkdir(games_dir) |
---|
16 | |
---|
17 | for root, dirs, files in os.walk('.'): |
---|
18 | if '.svn' in dirs: |
---|
19 | dirs.remove('.svn') |
---|
20 | if 'bin' in dirs: |
---|
21 | dirs = [d for d in dirs if d == 'bin'] |
---|
22 | if 'x86' in dirs: |
---|
23 | dirs = [d for d in dirs if d == 'x86'] |
---|
24 | if 'Windows Phone' in dirs: |
---|
25 | dirs.remove('Windows Phone') |
---|
26 | # if 'Release' in dirs: |
---|
27 | # copytree(join(root, 'Release'), games_dir) |
---|
28 | |
---|
29 | projects = glob(join(root, '*.csproj')) |
---|
30 | if projects: |
---|
31 | print 'projects: ' + str(projects) |
---|
32 | # return_code = call('msbuild ' + projects[0], shell=True, stdout=PIPE) |
---|
33 | return_code = call('msbuild ' + projects[0]) |
---|
34 | if return_code != 0: |
---|
35 | print 'DOES NOT BUILD: ' + projects[0] |
---|
36 | |
---|
37 | |
---|
38 | if __name__ == '__main__': |
---|
39 | sys.exit(main()) |
---|
Note: See
TracBrowser
for help on using the repository browser.