Skip to content

Commit ae94819

Browse files
jplexergmarull
authored andcommitted
build: move stored_apps wscript to wscript_build
Signed-off-by: Joshua Jun <lets@throw.rocks>
1 parent 485ed8d commit ae94819

2 files changed

Lines changed: 15 additions & 26 deletions

File tree

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
1-
import os
2-
import time
3-
4-
import waflib
5-
import waflib.Tools
61
import waftools.objcopy as objcopy
72
import waftools.pebble_sdk_gcc as pebble_sdk_gcc
83

94
from resources.types.resource_definition import ResourceDefinition
105
from resources.types.resource_object import ResourceObject
116

127
from pebble_sdk_platform import pebble_platforms
13-
from pebble_sdk_version import set_env_sdk_version
148

159
import generate_appinfo
1610

@@ -19,14 +13,6 @@ import generate_appinfo
1913
#
2014

2115

22-
# -----------------------------------------------------------------------------------
23-
def configure(conf):
24-
process_info = conf.path.parent.find_node('src/fw/process_management/pebble_process_info.h')
25-
set_env_sdk_version(conf, process_info)
26-
pebble_sdk_gcc.configure(conf)
27-
conf.env.append_value('DEFINES', 'RELEASE')
28-
29-
3016
# -----------------------------------------------------------------------------------
3117
def build_app(bld, app_name):
3218
sdk_folder = bld.path.parent.get_bld().make_node('sdk').make_node(bld.env.PLATFORM_NAME)
@@ -118,16 +104,14 @@ def build_app(bld, app_name):
118104

119105

120106
# -----------------------------------------------------------------------------------
121-
def build(bld):
122-
# When you add a new stored app, you must also do the following to include it into the
123-
# system resources and register it with the launcher:
124-
# 1.) Add a raw resource entry with a name of "STORED_APP_<appname>" to
125-
# resources/normal/resource_map.json.
126-
# The "file" field should be set to normal/raw/app_<appname>.bin
127-
# 2.) Add a new entry to the INIT_STORED_APPS array in system_app_registry.h
128-
apps = bld.path.ant_glob('*', dir=True, src=False)
129-
for app in apps:
130-
build_app(bld, app.name)
131-
107+
# When you add a new stored app, you must also do the following to include it into the
108+
# system resources and register it with the launcher:
109+
# 1.) Add a raw resource entry with a name of "STORED_APP_<appname>" to
110+
# resources/normal/resource_map.json.
111+
# The "file" field should be set to normal/raw/app_<appname>.bin
112+
# 2.) Add a new entry to the INIT_STORED_APPS array in system_app_registry.h
113+
apps = bld.path.ant_glob('*', dir=True, src=False)
114+
for app in apps:
115+
build_app(bld, app.name)
132116

133117
# vim:filetype=python

wscript

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,11 @@ sys.path.append(os.path.join(waf_dir, 'waftools'))
3131
import waftools.gitinfo
3232
import waftools.ldscript
3333
import waftools.openocd
34+
import waftools.pebble_sdk_gcc as pebble_sdk_gcc
3435
from waftools.pebble_sdk_locator import activate_sdk
3536

37+
from pebble_sdk_version import set_env_sdk_version
38+
3639
# Prefer an installed PebbleOS SDK's binaries (toolchain, QEMU, sftool) when
3740
# present. Done at import time so it applies to every waf invocation.
3841
activate_sdk(waflib.Context.run_dir or os.getcwd())
@@ -370,7 +373,9 @@ def configure(conf):
370373

371374
Logs.pprint('CYAN', 'Configuring stored apps environment')
372375
conf.setenv('stored_apps', base_env)
373-
conf.recurse('stored_apps')
376+
process_info = conf.path.find_node('src/fw/process_management/pebble_process_info.h')
377+
set_env_sdk_version(conf, process_info)
378+
pebble_sdk_gcc.configure(conf)
374379

375380
# Confirm that requirements-*.txt and requirements-osx-brew.txt have been satisfied.
376381
import tool_check

0 commit comments

Comments
 (0)