Set up production build task

`grunt copy`

Closes #191
This commit is contained in:
lilia 2015-03-19 16:46:58 -07:00
parent 66fb673e6a
commit c526dbda5f
8 changed files with 35 additions and 8 deletions

View file

@ -109,6 +109,26 @@ module.exports = function(grunt) {
], ],
options: { jshintrc: '.jshintrc' }, options: { jshintrc: '.jshintrc' },
}, },
dist: {
src: [
'manifest.json',
'background.html',
'index.html',
'converesation.html',
'options.html',
'protos/*',
'js/**',
'stylesheets/*.css',
'images/**',
'fonts/*',
'!js/register.js'
]
},
copy: {
dist: {
files: [{ expand: true, dest: 'dist/', src: ['<%= dist.src %>'] }]
}
},
jscs: { jscs: {
all: { all: {
src: ['js/**/*.js', '!js/libtextsecure.js', '!js/components.js', 'test/**/*.js'] src: ['js/**/*.js', '!js/libtextsecure.js', '!js/components.js', 'test/**/*.js']
@ -130,7 +150,11 @@ module.exports = function(grunt) {
libaxolotl: { libaxolotl: {
files: ['./libaxolotl/*.js'], files: ['./libaxolotl/*.js'],
tasks: ['concat:libaxolotl'] tasks: ['concat:libaxolotl']
} },
dist: {
files: ['<%= dist.src %>'],
tasks: ['copy']
},
}, },
connect: { connect: {
server: { server: {
@ -155,7 +179,7 @@ module.exports = function(grunt) {
testname: 'TextSecure-Browser Tests' testname: 'TextSecure-Browser Tests'
} }
} }
} },
}); });
Object.keys(grunt.config.get('pkg').devDependencies).forEach(function(key) { Object.keys(grunt.config.get('pkg').devDependencies).forEach(function(key) {

1
images/twemoji/16x16 Symbolic link
View file

@ -0,0 +1 @@
../../components/twemoji/16x16

View file

@ -49,7 +49,7 @@
}) })
); );
twemoji.parse(this.el, { base: '/components/twemoji/', size: 16 }); twemoji.parse(this.el, { base: '/images/twemoji/', size: 16 });
var unread = this.model.get('unreadCount'); var unread = this.model.get('unreadCount');
if (unread > 0) { if (unread > 0) {

View file

@ -44,7 +44,7 @@
}) })
); );
twemoji.parse(this.el, { base: '/components/twemoji/', size: 16 }); twemoji.parse(this.el, { base: '/images/twemoji/', size: 16 });
var content = this.$el.find('.content'); var content = this.$el.find('.content');
content.html(this.autoLink(content.html())); content.html(this.autoLink(content.html()));

View file

@ -18,7 +18,7 @@
<title>TextSecure Options</title> <title>TextSecure Options</title>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="stylesheets/options.css"> <link rel="stylesheet" href="stylesheets/options.css">
<link rel="stylesheet" href="components/bootstrap/dist/css/bootstrap.css"> <link rel="stylesheet" href="stylesheets/bootstrap.css">
</head> </head>
<body> <body>
<div id='init-setup' class='collapse'> <div id='init-setup' class='collapse'>

View file

@ -8,12 +8,13 @@
"grunt-cli": "^0.1.13", "grunt-cli": "^0.1.13",
"grunt-contrib-concat": "^0.5.0", "grunt-contrib-concat": "^0.5.0",
"grunt-contrib-connect": "^0.9.0", "grunt-contrib-connect": "^0.9.0",
"grunt-contrib-copy": "^0.8.0",
"grunt-contrib-jshint": "^0.10.0", "grunt-contrib-jshint": "^0.10.0",
"grunt-contrib-sass": "^0.8.1", "grunt-contrib-sass": "^0.8.1",
"grunt-contrib-watch": "^0.6.1", "grunt-contrib-watch": "^0.6.1",
"grunt-jscs": "^1.1.0",
"grunt-preen": "^1.0.0", "grunt-preen": "^1.0.0",
"grunt-saucelabs": "^8.3.3", "grunt-saucelabs": "^8.3.3"
"grunt-jscs": "^1.1.0"
}, },
"scripts": { "scripts": {
"test": "grunt test", "test": "grunt test",

1
stylesheets/bootstrap.css vendored Symbolic link
View file

@ -0,0 +1 @@
../components/bootstrap/dist/css/bootstrap.css

View file

@ -71,7 +71,7 @@ describe('MessageView', function() {
view.render(); view.render();
var img = view.$el.find('.content img'); var img = view.$el.find('.content img');
assert.strictEqual(img.length, 1); assert.strictEqual(img.length, 1);
assert.strictEqual(img.attr('src'), '/components/twemoji/16x16/2764.png'); assert.strictEqual(img.attr('src'), '/images/twemoji/16x16/2764.png');
assert.strictEqual(img.attr('alt'), '\u2764\uFE0F'); assert.strictEqual(img.attr('alt'), '\u2764\uFE0F');
assert.strictEqual(img.attr('class'), 'emoji'); assert.strictEqual(img.attr('class'), 'emoji');
}); });