]>
git.saurik.com Git - apple/hfs.git/blob - livefiles_hfs_plugin/scripts/CreateRelease.py
5 # Temporarily change folder to another folder and then go back
7 def __init__(self
, newDir
):
8 self
.prevDir
= os
.getcwd()
14 def __exit__(self
, type, value
, traceback
):
15 os
.chdir(self
.prevDir
)
17 # Print and execute something
19 print('Command to execute: ' + cmd
)
21 if (ret
!= 0): raise Exception('Shell command failed with error code {}'.format(ret
))
24 if ( len(sys
.argv
) != 4 ):
25 raise Exception('Usage : python CreateRelease.py <Project Root Folder> <ReleaseNumber> <Configuration>')
28 PROJECT_ROOT_FOLDER
= sys
.argv
[1]
31 if CONF
not in ['Debug', 'Release']:
32 raise Exception('Bad confuguration {}'.format(CONF
))
34 print('Creating HFSPlugin Project [{}] Release [{}]...'.format(PROJECT_ROOT_FOLDER
, REL
))
35 SVN_URL
= 'http://iliha1-svn01.euro.apple.com/svn/Integration/S4E/production/Files/hfs_plugin'
37 shutil
.rmtree('/tmp/tmp_HFSPlugin', ignore_errors
=True)
39 with Temp_Chdir('/tmp'):
40 execute('svn co {} tmp_HFSPlugin --depth immediates'.format(SVN_URL
))
41 os
.makedirs('tmp_HFSPlugin/{}'.format(REL
))
46 'sdk' : 'iphoneos.internal',
47 'buildDir' : 'build/{}-iphoneos/'.format(CONF
)
50 'sdk' : 'macosx.internal',
51 'buildDir' : 'build/{}/'.format(CONF
)
55 with Temp_Chdir(PROJECT_ROOT_FOLDER
):
57 for target
, info
in targetsInfo
.items():
58 execute('mkdir -p /tmp/tmp_HFSPlugin/{}/{}'.format(REL
, target
))
59 execute('xcodebuild -target livefiles_hfs -sdk {} -configuration {}'.format(info
['sdk'], CONF
))
60 shutil
.copy('{}/livefiles_hfs.dylib'.format(info['buildDir']), '/tmp/tmp_HFSPlugin/{}/{}/'.format(REL
, target
))
62 execute('echo xcodebuild configuration : {} > /tmp/tmp_HFSPlugin/{}/release_notes.txt'.format(CONF
, REL
))
63 execute('echo Source branch : `git rev-parse --abbrev-ref HEAD` >> /tmp/tmp_HFSPlugin/{}/release_notes.txt'.format(REL
))
64 execute('echo Last commit Hash : `git rev-parse HEAD` >> /tmp/tmp_HFSPlugin/{}/release_notes.txt'.format(REL
))
65 execute('echo "\n\n In Order to checkout the source files execute :\n\tgit checkout `git rev-parse --abbrev-ref HEAD` \n\tgit checkout `git rev-parse HEAD`" >> /tmp/tmp_HFSPlugin/{}/release_notes.txt'.format(REL
))
68 with Temp_Chdir('/tmp/tmp_HFSPlugin'):
69 execute('svn add {}'.format(REL
))
70 execute('svn ci -m "Added release {}"'.format(REL
))
72 print('All set! {} HFSPlugin release is ready'.format(REL
))