commit 539c16dc5ab6fd60b82ccadca87f69e1a1ad5882 Author: alanacheff Date: Sun Oct 6 21:20:19 2024 +0000 Upload files to "/" diff --git a/jshintrc b/jshintrc new file mode 100644 index 0000000..faaa264 --- /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": {"XMLHttpRequest": true, "console": true, "setTimeout": true, "Pebble": true, "Int8Array": true, "WebSocket": true, "localStorage": true, "Float64Array": true, "Uint16Array": true, "module": true, "Uint8Array": true, "Float32Array": true, "require": true, "setInterval": true, "Int16Array": true, "Uint32Array": true, "Uint8ClampedArray": true, "exports": true, "Int32Array": true, "navigator": 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..04a1aa8 --- /dev/null +++ b/package.json @@ -0,0 +1,99 @@ +{ + "author": "singleserveapps", + "dependencies": { + "pebble-battery-bar": "^1.0.8", + "pebble-bluetooth-icon": "^1.0.6" + }, + "keywords": [], + "name": "basic-steps-weather", + "pebble": { + "capabilities": [ + "location", + "configurable", + "health" + ], + "displayName": "Basic Steps Weather", + "enableMultiJS": true, + "messageKeys": { + "KEY_BACKGROUND_COLOR": 22, + "KEY_CONDITIONS": 2, + "KEY_CONDITION_CODE": 13, + "KEY_DISPLAY_DIGITAL_TIME": 15, + "KEY_DISPLAY_WEATHER": 5, + "KEY_GET_WEATHER": 7, + "KEY_HOUR_FONT": 23, + "KEY_HR_COLOR": 19, + "KEY_JS_READY": 18, + "KEY_MINUTES_FONT": 24, + "KEY_MIN_COLOR": 20, + "KEY_MIN_SINCE_WEATHER_UPDATE": 6, + "KEY_OPTIONS": 99, + "KEY_SHAKE_FOR_LOHI": 14, + "KEY_TEMPERATURE": 8, + "KEY_TEMPERATURE_HI": 10, + "KEY_TEMPERATURE_IN_C": 1, + "KEY_TEMPERATURE_IN_C_HI": 12, + "KEY_TEMPERATURE_IN_C_LO": 11, + "KEY_TEMPERATURE_LO": 9, + "KEY_USE_CELSIUS": 4, + "KEY_WEATHER_FREQUENCY": 3, + "KEY_WEATHER_LOCATION": 17, + "KEY_WEATHER_USE_GPS": 16, + "KEY_WSD_COLOR": 21 + }, + "projectType": "native", + "resources": { + "media": [ + { + "file": "fonts/Roboto-Light.ttf", + "name": "FONT_ROBOTO_LIGHT_52", + "targetPlatforms": null, + "type": "font" + }, + { + "file": "fonts/Roboto-Light.ttf", + "name": "FONT_ROBOTO_LIGHT_48", + "targetPlatforms": null, + "type": "font" + }, + { + "file": "fonts/Roboto-Bold.ttf", + "name": "FONT_ROBOTO_BOLD_50", + "targetPlatforms": null, + "type": "font" + }, + { + "file": "fonts/Roboto-Bold.ttf", + "name": "FONT_ROBOTO_BOLD_48", + "targetPlatforms": null, + "type": "font" + }, + { + "file": "fonts/Roboto-Regular.ttf", + "name": "FONT_ROBOTO_REGULAR_52", + "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": "825b781e-9945-47be-80c8-f3a578492c87", + "watchapp": { + "watchface": true + } + }, + "version": "1.6.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')