Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Adding xpk target to gruntfile, plus signature file.
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Waterman committed Oct 26, 2013
1 parent e7e7cb9 commit 237bdc5
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 40 deletions.
108 changes: 74 additions & 34 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = function (grunt) {

grunt.initConfig({
packageInfo: grunt.file.readJSON('package.json'),
chromeInfo: grunt.file.readJSON('data/manifest.json'),
chromeInfo: grunt.file.readJSON('data/chrome-crx/manifest.json'),

clean: ['build'],

Expand All @@ -20,9 +20,9 @@ module.exports = function (grunt) {
// (default: '/tmp')
tizenAppScriptDir: '/home/developer/',

// path to the config.xml file for the Tizen wgt file
// path to the config.xml file for the Tizen wgt file - post templating
// (default: 'config.xml')
configFile: 'data/config.xml',
configFile: 'build/wgt/config.xml',

// path to the sdb command (default: process.env.SDB or 'sdb')
sdbCmd: 'sdb'
Expand All @@ -31,69 +31,107 @@ module.exports = function (grunt) {
// minify JS
uglify: {
dist: {
files: {
'build/app/js/calc.js': ['app/js/calc.js'],
'build/app/js/help.js': ['app/js/help.js'],
'build/app/js/license.js': ['app/js/license.js'],
'build/app/js/localizer.js': ['app/js/localizer.js'],
'build/app/lib/q/q.js': ['app/lib/q/q.js'],
}
files: [
{ expand: true, cwd: '.', src: 'app/js/**/*.js', dest: 'build/' }
]
}
},

// minify CSS
cssmin: {
dist: {
files: {
'build/app/css/calc.css': ['app/css/calc.css'],
'build/app/css/calc_portrait.css': ['app/css/calc_portrait.css'],
'build/app/css/lazy.css': ['app/css/lazy.css'],
'build/app/css/lazy_portrait.css': ['app/css/lazy_portrait.css'],
'build/app/css/jquery.jscrollpane.css': ['app/css/jquery.jscrollpane.css']
}
files: [
{ expand: true, cwd: '.', src: ['app/css/**/*.css'], dest: 'build/' }
]
}
},

copy: {
common: {
files: [
{ expand: true, cwd: '.', src: ['app/lib/intel-appframework/appframework.min.js'], dest: 'build/' },
{ expand: true, cwd: '.', src: ['app/lib/peg-0.7.0.min/index.js'], dest: 'build/' },
{ expand: true, cwd: '.', src: ['app/lib/iscroll/dist/iscroll-min.js'], dest: 'build/' },
{ expand: true, cwd: '.', src: ['app/lib/pegjs/src/parser.pegjs'], dest: 'build/' },
{ expand: true, cwd: '.', src: ['app/lib/open-sans/OpenSans-Light.ttf'], dest: 'build/' },
{ expand: true, cwd: '.', src: ['app/lib/open-sans/OpenSans-Regular.ttf'], dest: 'build/' },
{ expand: true, cwd: '.', src: ['app/lib/open-sans/OpenSans-Semibold.ttf'], dest: 'build/' },
{ expand: true, cwd: '.', src: ['app/lib/**'], dest: 'build/' },
{ expand: true, cwd: '.', src: ['app/audio/**'], dest: 'build/' },
{ expand: true, cwd: '.', src: ['app/js/peg-code.txt'], dest: 'build/' },
{ expand: true, cwd: '.', src: ['app/data/**'], dest: 'build/' },
{ expand: true, cwd: '.', src: ['app/README.txt'], dest: 'build/' },
{ expand: true, cwd: '.', src: ['LICENSE'], dest: 'build/app/' },
{ expand: true, cwd: '.', src: ['app/_locales/**'], dest: 'build/' }
]
},

wgt: {
files: [
{ expand: true, cwd: 'build/app/', src: ['**'], dest: 'build/wgt/' },
{ expand: true, cwd: 'data/', src: ['config.xml'], dest: 'build/wgt/' },
{ expand: true, cwd: '.', src: ['icon_128.png'], dest: 'build/wgt/' }
]
},

wgt_config: {
files: [
{ expand: true, cwd: 'data/tizen-wgt/', src: ['config.xml'], dest: 'build/wgt/' }
],
options:
{
processContent: function(content, srcpath)
{
return grunt.template.process(content);
}
}
},

crx: {
files: [
{ expand: true, cwd: 'build/app/', src: ['**'], dest: 'build/crx/' },
{ expand: true, cwd: '.', src: ['manifest.json'], dest: 'build/crx/' },
{ expand: true, cwd: '.', src: ['icon*.png'], dest: 'build/crx/' }
]
},

crx_manifest:
{
files: [
{ expand: true, cwd: 'data/chrome-crx/', src: ['manifest.json'], dest: 'build/crx/' }
],

options:
{
processContent: function(content, srcpath)
{
return grunt.template.process(content);
}
}

},

xpk: {
files: [
{ expand: true, cwd: 'build/app/', src: ['**'], dest: 'build/xpk/' },
{ expand: true, cwd: '.', src: ['icon*.png'], dest: 'build/xpk/' }
]
},

xpk_manifest:
{
files: [
{ expand: true, cwd: 'data/tizen-xpk/', src: ['manifest.json'], dest: 'build/xpk/' }
],

options:
{
processContent: function(content, srcpath)
{
return grunt.template.process(content);
}
}

},

sdk: {
files: [
{ expand: true, cwd: 'build/app/', src: ['**'], dest: 'build/sdk/' },
{ expand: true, cwd: 'app/', src: ['js/**'], dest: 'build/sdk/' },
{ expand: true, cwd: 'app/', src: ['css/**'], dest: 'build/sdk/' },
{ expand: true, cwd: 'app/', src: ['*.html'], dest: 'build/sdk/' },
{ expand: true, cwd: 'data/', src: ['config.xml'], dest: 'build/sdk/' },
{ expand: true, cwd: '.', src: ['icon*.png'], dest: 'build/sdk/' },
{ expand: true, cwd: 'app/lib/', src: ['q/q.js'], dest: 'build/sdk/lib/'}
{ expand: true, cwd: 'data/tizen-wgt/', src: ['config.xml'], dest: 'build/sdk/' },
{ expand: true, cwd: '.', src: ['icon*.png'], dest: 'build/sdk/' }
]
}
},
Expand Down Expand Up @@ -165,7 +203,7 @@ module.exports = function (grunt) {
install: {
action: 'install',
remoteFiles: {
pattern: '/home/developer/Calculator*.wgt',
pattern: '/home/developer/<%= packageInfo.name %>*.wgt',
filter: 'latest'
}
},
Expand Down Expand Up @@ -202,14 +240,15 @@ module.exports = function (grunt) {
'copy:common'
]);

grunt.registerTask('crx', ['dist', 'copy:crx']);
grunt.registerTask('wgt', ['dist', 'copy:wgt', 'package:wgt']);

grunt.registerTask('crx', ['dist', 'copy:crx', 'copy:crx_manifest']);
grunt.registerTask('wgt', ['dist', 'copy:wgt', 'copy:wgt_config', 'package:wgt']);
grunt.registerTask('xpk', ['dist', 'copy:xpk', 'copy:xpk_manifest']);
grunt.registerTask('sdk', [
'clean',
'imagemin:dist',
'copy:common',
'copy:sdk',
'copy:wgt_config',
'package:sdk'
]);

Expand All @@ -218,6 +257,7 @@ module.exports = function (grunt) {
'uglify:perf',
'inline',
'copy:wgt',
'copy:wgt_config',
'package:wgt'
]);

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion app/js/calc.js
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ $(function() {
{
script: "lib/peg-0.7.0.min/index.js",
success: function(resolve) {
$.get("js/peg-code.txt",function(data) {
$.get("data/peg-code.txt",function(data) {
try {
Calculator.parser = PEG.buildParser(data);
resolve();
Expand Down
6 changes: 3 additions & 3 deletions data/manifest.json → data/chrome-crx/manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "Calculator",
"version": "2.0",
"name": "<%= packageInfo.name %>",
"version": "<%= packageInfo.version %>",
"default_locale": "en_US",
"description": "A scientific calculator",
"description": "<%= packageInfo.description %>",
"icons": {
"128": "icon_128.png"
},
Expand Down
4 changes: 2 additions & 2 deletions data/config.xml → data/tizen-wgt/config.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="https://github.com/01org/webapps-scientific-calculator" version="1.1.0" viewmodes="fullscreen">
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="https://github.com/01org/webapps-scientific-calculator" version="<%= packageInfo.version %>" viewmodes="fullscreen">
<tizen:application id="UaW22rtxQw.calculator" package="UaW22rtxQw" required_version="2.1"/>
<content src="index.html"/>
<icon src="icon_128.png"/>
<name>calculator</name>
<name><%= packageInfo.name %></name>
</widget>
17 changes: 17 additions & 0 deletions data/tizen-xpk/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "<%= packageInfo.name %>",
"version": "<%= packageInfo.version %>",
"default_locale": "en_US",
"description": "<%= packageInfo.description %>",
"icons": {
"128": "icon_128.png"
},
"app": {
"launch": {
"local_path": "index.html"
}
},
"manifest_version": 2,
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'; style-src 'self' 'unsafe-inline'"
}

15 changes: 15 additions & 0 deletions data/tizen-xpk/signature
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-----BEGIN RSA PRIVATE KEY-----
MIICXgIBAAKBgQDPNDdHYc/RWxhzvJJtInOTcKc5wkbK9Kb2bIeRDCAMaiodcjBO
gV78AZurh4vV0Fw2324O5FDPhAVRK45OJxtbawkntkkmI2bkEAocNDHPC8LOVHV+
1/5uVFiktmToFx+HE9Jgl3fSX/4onTNR8okmhL/Dax7VU6ZjN2KNqAP3KQIDAQAB
AoGBAKNphOcxBtsPwvsUD08uyoPPZrMwuvA5fqv97/S+4U+pMsnCUsK3WRfalND0
t53LE87a60unWOwwLJlVhoewY+uLNB4EUQVyYzNvZVrhsZWB5wr7FB/2HQVCfti2
qxzkG3ndL7OR4vvoEU34FpPLrLuYS72xYOZIxD9w9bDt7rYBAkEA185PLSU5g0+t
CXNHlPeGaeTc5jyi2r1kckkAQmyYekTyL8LgHsqfJVM3DNyqQqpSZ73+cwNdOv2y
vMlYs22bCQJBAPXLw58+zOZC6Tsvm+Ur4me8arqDLb34SEh9AhtAwWqW0KPw/NpR
JRui4UWBjvDNK3qXhyZ+eJfg8cDWCjua4yECQQCgg9mscKWon9jK0K4LhVi65vnP
XoabQIe34ciJn5CCUUn6cG6XOIrLDmxB6tfRIjKM62qZTYVI3W7WsMSDISFRAkEA
nxp02EHYdDxfqJYavW94sFmAZJbBJzTt5S42DNoP2SUijNxTcCYSdR8r3sgMdMb6
G/K14y7+dKGBG6fxG8AYwQJAQSpjHy+BMxkmnMRGh/9rLMAZFPiwdu9w60P1rENs
NF35jnVL29uKBAbAHGYgYSVNc/bSj8wSLAa9dLaH1htuzg==
-----END RSA PRIVATE KEY-----

0 comments on commit 237bdc5

Please sign in to comment.