-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcordova_prepare_ios.py
57 lines (42 loc) · 1.15 KB
/
cordova_prepare_ios.py
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
#!/usr/bin/python
import os
import shutil
from distutils import dir_util
from time import gmtime, strftime
print strftime("> %d.%m.%Y %H:%M:%S", gmtime())
root_www = "cordova/www"
ios_www = "cordova/platforms/ios/www"
cordova_js = "cordova/platforms/ios/platform_www/cordova.js"
cordova_plugins_js = "cordova/platforms/ios/platform_www/cordova_plugins.js"
public_ignored = [
# dirs
".excluded",
#"app/*.js",
#"lib",
"node_modules",
#"temp",
"upload",
# files
".bowerrc",
".htaccess",
"bower.json",
"gulpfile.js",
"index.php",
"karma.conf.js",
"package.json",
"robots.txt",
]
def copyignore(src, files):
if src == "public":
return public_ignored
return []
print '> empty "%s"' % root_www
if os.path.isdir(root_www):
shutil.rmtree(root_www)
print ' o copy from "public" to "%s"' % root_www
shutil.copytree("public", root_www, ignore=copyignore)
print ' o copy "cordova.js" to "%s"' % root_www
shutil.copy2(cordova_js, root_www)
print ' o copy "cordova_plugins.js" to "%s"' % root_www
shutil.copy2(cordova_plugins_js, root_www)
print '> cordova ios platform is ready'