[Groonga-commit] groonga/groonga-admin at cf7452d [master] Add package task to install without npm and bower

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Nov 17 14:21:45 JST 2014


Kouhei Sutou	2014-11-17 14:21:45 +0900 (Mon, 17 Nov 2014)

  New Revision: cf7452d2abe69f730f9e1673bced2631dc2229b6
  https://github.com/groonga/groonga-admin/commit/cf7452d2abe69f730f9e1673bced2631dc2229b6

  Message:
    Add package task to install without npm and bower

  Modified files:
    .gitignore
    Gruntfile.js
    package.json

  Modified: .gitignore (+2 -0)
===================================================================
--- .gitignore    2014-11-17 12:53:37 +0900 (5dcddc5)
+++ .gitignore    2014-11-17 14:21:45 +0900 (1a475b9)
@@ -3,3 +3,5 @@
 /.tmp/
 .sass-cache/
 /bower_components/
+/app/styles/*.css
+/*.tar.gz

  Modified: Gruntfile.js (+57 -2)
===================================================================
--- Gruntfile.js    2014-11-17 12:53:37 +0900 (dd2772d)
+++ Gruntfile.js    2014-11-17 14:21:45 +0900 (5dbb258)
@@ -1,6 +1,8 @@
 // Generated on 2014-10-21 using generator-angular 0.9.8
 'use strict';
 
+var shell = require('shelljs');
+
 // # Globbing
 // for performance reasons we're only matching one level down:
 // 'test/spec/{,*/}*.js'
@@ -15,10 +17,14 @@ module.exports = function (grunt) {
   // Time how long tasks take. Can help when optimizing build times
   require('time-grunt')(grunt);
 
+  var pkg = grunt.file.readJSON('package.json');
+  var archiveBaseName = pkg.name + '-' + pkg.version;
+
   // Configurable paths for the application
   var appConfig = {
     app: require('./bower.json').appPath || 'app',
-    dist: 'dist'
+    dist: 'dist',
+    archive: archiveBaseName
   };
 
   // Define the configuration for all the tasks
@@ -152,7 +158,8 @@ module.exports = function (grunt) {
           ]
         }]
       },
-      server: '.tmp'
+      server: '.tmp',
+      archive: '<%= yeoman.archive %>'
     },
 
     // Add vendor prefixed styles
@@ -370,6 +377,42 @@ module.exports = function (grunt) {
         cwd: '<%= yeoman.app %>/styles',
         dest: '.tmp/styles/',
         src: '{,*/}*.css'
+      },
+      archive: {
+        files: [{
+          expand: true,
+          dot: true,
+          cwd: '<%= yeoman.dist %>',
+          dest: '<%= yeoman.archive %>/html',
+          src: [
+            '*'
+          ]
+        }, {
+          expand: true,
+          dot: true,
+          cwd: '.',
+          dest: '<%= yeoman.archive %>',
+          src: [
+            'LICENSE',
+            'README.md',
+            'doc/**/*'
+          ]
+        }, {
+          expand: true,
+          dot: true,
+          cwd: '.',
+          dest: '<%= yeoman.archive %>/source',
+          src: [
+            '.bowerrc',
+            '.jshintrc',
+            'Gruntfile.js',
+            'bower.json',
+            'package.json',
+            '<%= yeoman.app %>/**/*',
+            '!<%= yeoman.app %>/styles/*.css',
+            '!<%= yeoman.app %>/styles/.sass-cache/'
+          ]
+        }]
       }
     },
 
@@ -459,4 +502,16 @@ module.exports = function (grunt) {
     'test',
     'build'
   ]);
+
+  grunt.registerTask('archive', 'Archive distributed files', function (target) {
+    shell.exec('tar cvzf ' + archiveBaseName + '.tar.gz ' + archiveBaseName);
+  });
+
+  grunt.registerTask('package', 'Create package', [
+    'build',
+    'clean:archive',
+    'copy:archive',
+    'archive',
+    'clean:archive'
+  ]);
 };

  Modified: package.json (+2 -1)
===================================================================
--- package.json    2014-11-17 12:53:37 +0900 (8a5be76)
+++ package.json    2014-11-17 14:21:45 +0900 (df99e56)
@@ -47,7 +47,8 @@
     "grunt-release": "^0.7.0",
     "jshint-stylish": "^0.2.0",
     "load-grunt-tasks": "^0.4.0",
-    "time-grunt": "^0.3.1"
+    "time-grunt": "^0.3.1",
+    "shelljs": "^0.3.0"
   },
   "engines": {
     "node": ">=0.10.0"
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index