mirror of
https://github.com/pebble-dev/clay.git
synced 2026-08-27 20:36:33 -04:00
Make Clay a Pebble package
This commit is contained in:
+7
-23
@@ -1,31 +1,15 @@
|
|||||||
# Logs
|
|
||||||
logs
|
|
||||||
*.log
|
|
||||||
|
|
||||||
# Runtime data
|
|
||||||
pids
|
|
||||||
*.pid
|
|
||||||
*.seed
|
|
||||||
|
|
||||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
||||||
lib-cov
|
|
||||||
|
|
||||||
# Coverage directory used by tools like istanbul
|
# Coverage directory used by tools like istanbul
|
||||||
coverage
|
/coverage
|
||||||
|
|
||||||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
|
||||||
.grunt
|
|
||||||
|
|
||||||
# node-waf configuration
|
# node-waf configuration
|
||||||
.lock-wscript
|
.lock-wscript
|
||||||
|
/.lock-waf_darwin_build
|
||||||
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
|
||||||
build/Release
|
|
||||||
|
|
||||||
# Dependency directory
|
# Dependency directory
|
||||||
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
|
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
|
||||||
node_modules
|
/node_modules
|
||||||
|
|
||||||
tmp
|
/tmp/
|
||||||
|
/src/js/index.js
|
||||||
dist
|
/dist.zip
|
||||||
|
/build/
|
||||||
|
|||||||
Executable
+4
@@ -0,0 +1,4 @@
|
|||||||
|
# We ignore everying except for what is actually used by the pebble tool.
|
||||||
|
/**/*
|
||||||
|
!/dist.zip
|
||||||
|
!/src/js/index.js
|
||||||
+2
-2
@@ -92,13 +92,13 @@ gulp.task('clay', ['inlineHtml'], function() {
|
|||||||
.transform(autoprefixify, autoprefixerOptions)
|
.transform(autoprefixify, autoprefixerOptions)
|
||||||
.require(require.resolve('./index'), {expose: 'pebble-clay'})
|
.require(require.resolve('./index'), {expose: 'pebble-clay'})
|
||||||
.bundle()
|
.bundle()
|
||||||
.pipe(source('clay.js'))
|
.pipe(source('index.js'))
|
||||||
.pipe(buffer())
|
.pipe(buffer())
|
||||||
.pipe(uglify({
|
.pipe(uglify({
|
||||||
preserveComments: 'license'
|
preserveComments: 'license'
|
||||||
}))
|
}))
|
||||||
.pipe(insert.prepend(versionMessage))
|
.pipe(insert.prepend(versionMessage))
|
||||||
.pipe(gulp.dest('./dist/'));
|
.pipe(gulp.dest('./src/js'));
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('dev-js', ['js', 'sass'], function() {
|
gulp.task('dev-js', ['js', 'sass'], function() {
|
||||||
|
|||||||
+19
-5
@@ -2,17 +2,17 @@
|
|||||||
"name": "pebble-clay",
|
"name": "pebble-clay",
|
||||||
"version": "0.1.7",
|
"version": "0.1.7",
|
||||||
"description": "Pebble Config Framework",
|
"description": "Pebble Config Framework",
|
||||||
"main": "dist/clay.js",
|
"main": "src/js/index.js",
|
||||||
"directories": {
|
|
||||||
"example": "example"
|
|
||||||
},
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test-travis": "./node_modules/.bin/gulp && ./node_modules/.bin/karma start ./test/karma.conf.js --single-run --browsers chromeTravisCI && ./node_modules/.bin/eslint ./",
|
"test-travis": "./node_modules/.bin/gulp && ./node_modules/.bin/karma start ./test/karma.conf.js --single-run --browsers chromeTravisCI && ./node_modules/.bin/eslint ./",
|
||||||
"test-debug": "(export DEBUG=true && ./node_modules/.bin/gulp && ./node_modules/.bin/karma start ./test/karma.conf.js --no-single-run)",
|
"test-debug": "(export DEBUG=true && ./node_modules/.bin/gulp && ./node_modules/.bin/karma start ./test/karma.conf.js --no-single-run)",
|
||||||
"test": "./node_modules/.bin/gulp && ./node_modules/.bin/karma start ./test/karma.conf.js --single-run",
|
"test": "./node_modules/.bin/gulp && ./node_modules/.bin/karma start ./test/karma.conf.js --single-run",
|
||||||
"lint": "./node_modules/.bin/eslint ./",
|
"lint": "./node_modules/.bin/eslint ./",
|
||||||
"build": "gulp",
|
"build": "gulp",
|
||||||
"dev": "gulp dev"
|
"dev": "gulp dev",
|
||||||
|
"pebble-clean": "rm -rf tmp src/js/index.js && pebble clean",
|
||||||
|
"pebble-publish": "npm run pebble-clean && npm run build && pebble build && pebble package publish && npm run pebble-clean",
|
||||||
|
"pebble-build": "npm run build && pebble build"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -27,6 +27,20 @@
|
|||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/pebble/clay/issues"
|
"url": "https://github.com/pebble/clay/issues"
|
||||||
},
|
},
|
||||||
|
"pebble": {
|
||||||
|
"projectType": "package",
|
||||||
|
"sdkVersion": "3",
|
||||||
|
"targetPlatforms": [
|
||||||
|
"aplite",
|
||||||
|
"basalt",
|
||||||
|
"chalk",
|
||||||
|
"diorite",
|
||||||
|
"emery"
|
||||||
|
],
|
||||||
|
"resources": {
|
||||||
|
"media": []
|
||||||
|
}
|
||||||
|
},
|
||||||
"homepage": "https://github.com/pebble/clay#readme",
|
"homepage": "https://github.com/pebble/clay#readme",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"autoprefixer": "^6.3.1",
|
"autoprefixer": "^6.3.1",
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
#
|
||||||
|
# This file is the default set of rules to compile a Pebble project.
|
||||||
|
#
|
||||||
|
# Feel free to customize this to your needs.
|
||||||
|
#
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
import waflib
|
||||||
|
|
||||||
|
top = '.'
|
||||||
|
out = 'build'
|
||||||
|
|
||||||
|
|
||||||
|
def distclean(ctx):
|
||||||
|
if os.path.exists('dist.zip'):
|
||||||
|
os.remove('dist.zip')
|
||||||
|
if os.path.exists('dist'):
|
||||||
|
shutil.rmtree('dist')
|
||||||
|
waflib.Scripting.distclean(ctx)
|
||||||
|
|
||||||
|
|
||||||
|
def options(ctx):
|
||||||
|
ctx.load('pebble_sdk_lib')
|
||||||
|
|
||||||
|
|
||||||
|
def configure(ctx):
|
||||||
|
ctx.load('pebble_sdk_lib')
|
||||||
|
|
||||||
|
|
||||||
|
def build(ctx):
|
||||||
|
ctx.load('pebble_sdk_lib')
|
||||||
|
|
||||||
|
cached_env = ctx.env
|
||||||
|
for platform in ctx.env.TARGET_PLATFORMS:
|
||||||
|
ctx.env = ctx.all_envs[platform]
|
||||||
|
ctx.set_group(ctx.env.PLATFORM_NAME)
|
||||||
|
lib_name = '{}/{}'.format(ctx.env.BUILD_DIR, ctx.env.PROJECT_INFO['name'])
|
||||||
|
ctx.pbl_build(source=ctx.path.ant_glob('src/c/**/*.c'), target=lib_name, bin_type='lib')
|
||||||
|
ctx.env = cached_env
|
||||||
|
|
||||||
|
ctx.set_group('bundle')
|
||||||
|
ctx.pbl_bundle(includes=ctx.path.ant_glob('include/**/*.h'),
|
||||||
|
js=ctx.path.ant_glob(['src/js/**/*.js', 'src/js/**/*.json']),
|
||||||
|
bin_type='lib')
|
||||||
|
|
||||||
|
if ctx.cmd == 'clean':
|
||||||
|
for n in ctx.path.ant_glob(['dist/**/*', 'dist.zip'], quiet=True):
|
||||||
|
n.delete()
|
||||||
Reference in New Issue
Block a user