1
1

updated project for current tooling

This commit is contained in:
Alina Marquardt 2025-07-19 15:35:25 +02:00
parent ce2ce43a0a
commit 11d807dd76
3 changed files with 57 additions and 92 deletions

85
.gitignore vendored
View File

@ -1,64 +1,37 @@
assets # Pebble
bin
# Created by https://www.gitignore.io/api/osx
### OSX ###
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
.lock-waf_darwin_build
build build
# Created by https://www.toptal.com/developers/gitignore/api/linux,direnv,waf
# Edit at https://www.toptal.com/developers/gitignore?templates=linux,direnv,waf
### direnv ###
.direnv
.envrc
# Created by https://www.gitignore.io/api/xcode ### Linux ###
*~
### Xcode ### # temporary files which can be created if a process still has a handle open of a deleted file
# Xcode .fuse_hidden*
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated # KDE directory preferences
build/ .directory
DerivedData
## Various settings # Linux trash folder which might appear on any partition or disk
*.pbxuser .Trash-*
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
## Other # .nfs files are created when an open file is removed but is still being accessed
*.xccheckout .nfs*
*.moved-aside
*.xcuserstate ### Waf ###
*.pbxproj # For projects that use the Waf build system: https://waf.io/
*.xcworkspacedata # Dot-hidden on Unix-like systems
.waf-*-*/
.waf3-*-*/
# Hidden directory on Windows (no dot)
waf-*-*/
waf3-*-*/
# Lockfile
.lock-waf_*_build
# End of https://www.toptal.com/developers/gitignore/api/linux,direnv,waf

62
wscript
View File

@ -1,62 +1,54 @@
# #
# This file is the default set of rules to compile a Pebble project. # This file is the default set of rules to compile a Pebble application.
# #
# Feel free to customize this to your needs. # Feel free to customize this to your needs.
# #
import os.path import os.path
try:
from sh import CommandNotFound, jshint, cat, ErrorReturnCode_2
hint = jshint
except (ImportError, CommandNotFound):
hint = None
top = '.' top = '.'
out = 'build' out = 'build'
def options(ctx): def options(ctx):
ctx.load('pebble_sdk') ctx.load('pebble_sdk')
def configure(ctx): def configure(ctx):
"""
This method is used to configure your build. ctx.load(`pebble_sdk`) automatically configures
a build for each valid platform in `targetPlatforms`. Platform-specific configuration: add your
change after calling ctx.load('pebble_sdk') and make sure to set the correct environment first.
Universal configuration: add your change prior to calling ctx.load('pebble_sdk').
"""
ctx.load('pebble_sdk') ctx.load('pebble_sdk')
def build(ctx): 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)
# Concatenate all our JS files (but not recursively), and only if any JS exists in the first place.
ctx.path.make_node('src/js/').mkdir()
js_paths = ctx.path.ant_glob(['src/*.js', 'src/**/*.js'])
if js_paths:
ctx(rule='cat ${SRC} > ${TGT}', source=js_paths, target='pebble-js-app.js')
has_js = True
else:
has_js = False
ctx.load('pebble_sdk') ctx.load('pebble_sdk')
build_worker = os.path.exists('worker_src') build_worker = os.path.exists('worker_src')
binaries = [] binaries = []
for p in ctx.env.TARGET_PLATFORMS: cached_env = ctx.env
ctx.set_env(ctx.all_envs[p]) for platform in ctx.env.TARGET_PLATFORMS:
ctx.env = ctx.all_envs[platform]
ctx.set_group(ctx.env.PLATFORM_NAME) ctx.set_group(ctx.env.PLATFORM_NAME)
app_elf='{}/pebble-app.elf'.format(p) app_elf = '{}/pebble-app.elf'.format(ctx.env.BUILD_DIR)
ctx.pbl_program(source=ctx.path.ant_glob('src/**/*.c'), ctx.pbl_build(source=ctx.path.ant_glob('src/c/**/*.c'), target=app_elf, bin_type='app')
target=app_elf)
if build_worker: if build_worker:
worker_elf='{}/pebble-worker.elf'.format(p) worker_elf = '{}/pebble-worker.elf'.format(ctx.env.BUILD_DIR)
binaries.append({'platform': p, 'app_elf': app_elf, 'worker_elf': worker_elf}) binaries.append({'platform': platform, 'app_elf': app_elf, 'worker_elf': worker_elf})
ctx.pbl_worker(source=ctx.path.ant_glob('worker_src/**/*.c'), ctx.pbl_build(source=ctx.path.ant_glob('worker_src/c/**/*.c'),
target=worker_elf) target=worker_elf,
bin_type='worker')
else: else:
binaries.append({'platform': p, 'app_elf': app_elf}) binaries.append({'platform': platform, 'app_elf': app_elf})
ctx.env = cached_env
ctx.set_group('bundle') ctx.set_group('bundle')
ctx.pbl_bundle(binaries=binaries, js='pebble-js-app.js' if has_js else []) ctx.pbl_bundle(binaries=binaries,
js=ctx.path.ant_glob(['src/pkjs/**/*.js',
'src/pkjs/**/*.json',
'src/common/**/*.js']),
js_entry_file='src/pkjs/index.js')