From e88500c8afe2fe6f6875ef4dc5ad6ccd143ddc21 Mon Sep 17 00:00:00 2001 From: Victor Häggqvist Date: Thu, 26 Feb 2015 21:55:13 +0100 Subject: sdk 3 convertion --- appinfo.json | 21 +++++++++++++-------- wscript | 23 +++++++++++++++++++---- 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/appinfo.json b/appinfo.json index 510b60a..32a272f 100644 --- a/appinfo.json +++ b/appinfo.json @@ -11,12 +11,17 @@ "appKeys": {}, "resources": { "media": [ - { - "type": "png", - "file": "icon.png", - "menuIcon": true, - "name": "ICON" - } + { + "type": "png", + "file": "icon.png", + "menuIcon": true, + "name": "ICON" + } ] - } -} + }, + "targetPlatforms": [ + "aplite", + "basalt" + ], + "sdkVersion": "3" +} \ No newline at end of file diff --git a/wscript b/wscript index 0554dc8..e9657e5 100644 --- a/wscript +++ b/wscript @@ -5,6 +5,8 @@ # Feel free to customize this to your needs. # +import os.path + top = '.' out = 'build' @@ -17,8 +19,21 @@ def configure(ctx): def build(ctx): ctx.load('pebble_sdk') - ctx.pbl_program(source=ctx.path.ant_glob('src/**/*.c'), - target='pebble-app.elf') + build_worker = os.path.exists('worker_src') + binaries = [] + + for p in ctx.env.TARGET_PLATFORMS: + ctx.set_env(ctx.all_envs[p]) + app_elf='{}/pebble-app.elf'.format(ctx.env.BUILD_DIR) + ctx.pbl_program(source=ctx.path.ant_glob('src/**/*.c'), + target=app_elf) + + if build_worker: + worker_elf='{}/pebble-worker.elf'.format(ctx.env.BUILD_DIR) + binaries.append({'platform': p, 'app_elf': app_elf, 'worker_elf': worker_elf}) + ctx.pbl_worker(source=ctx.path.ant_glob('worker_src/**/*.c'), + target=worker_elf) + else: + binaries.append({'platform': p, 'app_elf': app_elf}) - ctx.pbl_bundle(elf='pebble-app.elf', - js=ctx.path.ant_glob('src/js/**/*.js')) + ctx.pbl_bundle(binaries=binaries, js=ctx.path.ant_glob('src/js/**/*.js')) -- cgit v1.2.3