-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathCopyResources.py
62 lines (49 loc) · 2.45 KB
/
CopyResources.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
58
59
60
61
62
#!/usr/bin/env python3
###################################################################################
# This script will generate the target files inside CMakeLists.txt #
# Run this script every time files are added to the Squally/Source/ directory. #
###################################################################################
from dirsync import sync
from os import listdir
from os import path
from os.path import isfile, join, splitext, abspath, relpath, realpath, basename, relpath
import argparse
import os
from sys import platform as _platform
# Initialize the parser
parser = argparse.ArgumentParser(description="Check for --release argument")
parser.add_argument('--release', action='store_true',
help='Include this flag to indicate release')
args = parser.parse_args()
def main():
print(_platform)
if _platform == "win32" or _platform == "win64" or _platform == "darwin" or _platform == "linux2":
copyResources()
else:
print("Unsupported platform")
def copyResources():
projectRoot = abspath(join(realpath(__file__), ".."))
sourcePathPublic = join(projectRoot, "Resources/Public/")
sourcePathPrivate = join(projectRoot, "Resources/Private/")
if _platform == "win32" or _platform == "win64":
binRoots = [abspath(join(realpath(__file__), "../build/bin/"))]
elif _platform == "darwin":
binRoots = [abspath(join(realpath(__file__), "../build/bin/Squally.app/Contents/"))]
elif _platform == "linux2":
binRoots = [abspath(join(realpath(__file__), "../build/bin/"))]
if args.release:
binRoots = [
"G://.shortcut-targets-by-id/1ekuO4zIiSeWqZxLnf3Gy7XC3RwPz6UIW/SquallyFiles/SquallyDeploy/content/MacOS/Squally.app/Contents/",
"G://.shortcut-targets-by-id/1ekuO4zIiSeWqZxLnf3Gy7XC3RwPz6UIW/SquallyFiles/SquallyDeploy/content/Linux/",
"G://.shortcut-targets-by-id/1ekuO4zIiSeWqZxLnf3Gy7XC3RwPz6UIW/SquallyFiles/SquallyDeploy/content/Windows/",
]
for binRoot in binRoots:
destPathPublic = join(binRoot, "Resources/Public/")
destPathPrivate = join(binRoot, "Resources/Private/")
doSync(sourcePathPublic, destPathPublic);
doSync(sourcePathPrivate, destPathPrivate);
def doSync(source, dest):
print("SYNCING: " + source + " => " + dest)
sync(source, dest, 'sync', create=True, content=True, ignore=['.git'])
if __name__ == '__main__':
main()