forked from jackrobotics/CMMC_NB-IoT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
extra_script.py
34 lines (25 loc) · 886 Bytes
/
extra_script.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
from SCons.Script import DefaultEnvironment
import glob, shutil, os
Import("env")
# env = DefaultEnvironment()
# uncomment line below to see environment variables
# print env.Dump()
# print ARGUMENTS
def before_upload(source, target, env):
print "before_upload"
def after_upload(source, target, env):
print "after_upload"
def before_build(source, target, env):
print "before_build"
if not os.path.exists(".src-dev/CMMC_NB-IoT"):
os.makedirs(".src-dev/CMMC_NB-IoT")
# else:
# shutil.rmtree(".src-dev/CMMC_NB-IoT")
# os.makedirs(".src-dev/CMMC_NB-IoT")
for file in glob.iglob('src/*.*'):
print 'Copied file %s' % (file)
shutil.copy2(file, ".src-dev/CMMC_NB-IoT/")
print "Current build targets", map(str, BUILD_TARGETS)
env.AddPreAction("upload", before_upload)
env.AddPostAction("upload", after_upload)
env.AddPreAction("buildprog", before_build)