commit 135d1c9f092811c45e4f4df3e2a72b4aba2d729e Author: alanacheff Date: Sun Oct 6 20:51:53 2024 +0000 Upload files to "/" diff --git a/jshintrc b/jshintrc new file mode 100644 index 0000000..55a90f5 --- /dev/null +++ b/jshintrc @@ -0,0 +1,43 @@ + +/* + * Example jshint configuration file for Pebble development. + * + * Check out the full documentation at http://www.jshint.com/docs/options/ + */ +{ + // Declares the existence of the globals available in PebbleKit JS. + "globals": {"exports": true, "console": true, "Uint32Array": true, "require": true, "Float32Array": true, "module": true, "navigator": true, "XMLHttpRequest": true, "Int32Array": true, "Pebble": true, "Float64Array": true, "setInterval": true, "localStorage": true, "WebSocket": true, "Int16Array": true, "Int8Array": true, "Uint16Array": true, "Uint8ClampedArray": true, "Uint8Array": true, "setTimeout": true}, + + // Do not mess with standard JavaScript objects (Array, Date, etc) + "freeze": true, + + // Do not use eval! Keep this warning turned on (ie: false) + "evil": false, + + /* + * The options below are more style/developer dependent. + * Customize to your liking. + */ + + // All variables should be in camelcase - too specific for CloudPebble builds to fail + // "camelcase": true, + + // Do not allow blocks without { } - too specific for CloudPebble builds to fail. + // "curly": true, + + // Prohibits the use of immediate function invocations without wrapping them in parentheses + "immed": true, + + // Don't enforce indentation, because it's not worth failing builds over + // (especially given our somewhat lacklustre support for it) + "indent": false, + + // Do not use a variable before it's defined + "latedef": "nofunc", + + // Spot undefined variables + "undef": "true", + + // Spot unused variables + "unused": "true" +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..791536f --- /dev/null +++ b/package.json @@ -0,0 +1,75 @@ +{ + "author": "singleserveapps", + "dependencies": { + "pebble-battery-bar": "^1.0.8", + "pebble-bluetooth-icon": "^1.0.6" + }, + "keywords": [], + "name": "basic-steps", + "pebble": { + "capabilities": [ + "configurable", + "health" + ], + "displayName": "Basic Steps", + "enableMultiJS": true, + "messageKeys": { + "KEY_BACKGROUND_COLOR": 5, + "KEY_HOUR_FONT": 6, + "KEY_HR_COLOR": 2, + "KEY_JS_READY": 1, + "KEY_MINUTES_FONT": 7, + "KEY_MIN_COLOR": 3, + "KEY_OPTIONS": 99, + "KEY_WSD_COLOR": 4 + }, + "projectType": "native", + "resources": { + "media": [ + { + "file": "fonts/Roboto-Bold.ttf", + "name": "FONT_ROBOTO_BOLD_48", + "targetPlatforms": null, + "type": "font" + }, + { + "file": "fonts/Roboto-Light.ttf", + "name": "FONT_ROBOTO_LIGHT_48", + "targetPlatforms": null, + "type": "font" + }, + { + "file": "fonts/Roboto-Thin.ttf", + "name": "FONT_ROBOTO_THIN_48", + "targetPlatforms": null, + "type": "font" + }, + { + "file": "fonts/Roboto-Regular.ttf", + "name": "FONT_ROBOTO_REGULAR_36", + "targetPlatforms": null, + "type": "font" + }, + { + "file": "fonts/Roboto-Regular.ttf", + "name": "FONT_ROBOTO_REGULAR_48", + "targetPlatforms": null, + "type": "font" + } + ] + }, + "sdkVersion": "3", + "targetPlatforms": [ + "aplite", + "basalt", + "chalk", + "diorite", + "emery" + ], + "uuid": "076a67db-0a26-4e79-90da-048c2652fafe", + "watchapp": { + "watchface": true + } + }, + "version": "3.5.0" +} diff --git a/wscript b/wscript new file mode 100644 index 0000000..9ad9c9f --- /dev/null +++ b/wscript @@ -0,0 +1,52 @@ +# +# This file is the default set of rules to compile a Pebble project. +# +# Feel free to customize this to your needs. +# + +import os.path +try: + from sh import CommandNotFound, jshint, cat, ErrorReturnCode_2 + hint = jshint +except (ImportError, CommandNotFound): + hint = None + +top = '.' +out = 'build' + + +def options(ctx): + ctx.load('pebble_sdk') + + +def configure(ctx): + ctx.load('pebble_sdk') + + +def build(ctx): + if False and hint is not None: + try: + hint([node.abspath() for node in ctx.path.ant_glob("src/**/*.js")], _tty_out=False) # no tty because there are none in the cloudpebble sandbox. + except ErrorReturnCode_2 as e: + ctx.fatal("\nJavaScript linting failed (you can disable this in Project Settings):\n" + e.stdout) + + ctx.load('pebble_sdk') + + build_worker = os.path.exists('worker_src') + binaries = [] + + for p in ctx.env.TARGET_PLATFORMS: + ctx.set_env(ctx.all_envs[p]) + ctx.set_group(ctx.env.PLATFORM_NAME) + app_elf = '{}/pebble-app.elf'.format(ctx.env.BUILD_DIR) + ctx.pbl_program(source=ctx.path.ant_glob('src/c/**/*.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/**/*.c'), target=worker_elf) + else: + binaries.append({'platform': p, 'app_elf': app_elf}) + + ctx.set_group('bundle') + ctx.pbl_bundle(binaries=binaries, js=ctx.path.ant_glob(['src/pkjs/**/*.js', 'src/pkjs/**/*.json']), js_entry_file='src/pkjs/app.js')