Skip to content

Commit

Permalink
Merge pull request #35 from damyanpetev/build-files
Browse files Browse the repository at this point in the history
Build pakcage files
  • Loading branch information
kdinev authored Jul 1, 2016
2 parents 978ac5e + 7ba4442 commit 5019894
Show file tree
Hide file tree
Showing 6 changed files with 187 additions and 12 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,10 @@ bower_components

# Optional REPL history
.node_repl_history

#Build output
dist/js
dist/css
dist/bower.json
dist/README.md
dist/LICENSE
16 changes: 14 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,17 @@ language: node_js
node_js:
- "4"
script:
- grunt verify
- grunt coveralls
- grunt verify
- grunt coveralls
after_success:
- grunt build
before_deploy: "cd dist"
deploy:
provider: npm
skip_cleanup: true
email: [email protected]
api_key:
secure: JeRvlOs2mLvzJHqtpVLvEtTVrZZqB4kufmz7+4RNk9XgzcSwXVbp5ZCpdYkZy/2HypJTjyryN98FuqCQo4cnmnkVS2phiejA9b9YVl3uFtCeFxGJJ4st/98UT3f7OrDgqFIh4v+MtzIS76+Erv2YmV8RBtEgoOpfCpuO5aBpi3oJR49iw8TN2dZwfyvUtb2ytMfzyR1q7xsl+Q0qYzwhX00BxVxGY6UkKF1VaRjsfGYrfC4FkpAT4u5mD+KtUMwRHGpMyQm1LYusS99+ugwOloq4gFArham/J/06tLwCXXjW/xhVH4HyQRiMZE649rl7TI/j88vZrGUKw16SQT+K/0+3sw4/BtwwlEjNiD1UIr97lRL7oFTZp/NYBs1PgNHd+xYGLnWA34NuUWlo9pviUz5U/mVaRVPZ5u1oLKHjPYX2VElE/GgqjQuj08il8rtRr7UHP0O5y0MPJ+t1WgWnivc0ISs+AHe+edLPoGAMHiK7vEcsM10y8z7Lfx7BbuWLFfv2eoWeruO1B0kEP+jeuognOBcyjSD/zKMfmosW/L+muhHCCPI1yDSmtutq24HVzktq0ggF9i5g4jTpH9kORBGKOirXuMP1Hf412IvzeQ71LK4A9W9z+mKje+9ygqrPDrbyYaclDiCrwOrAi3IGrpoi5F5ACdY13ObZpKG71RA=
on:
tags: true
repo: IgniteUI/ignite-ui
68 changes: 58 additions & 10 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
var config = {
var buildVersion = require("./package.json").version,
year = new Date().getFullYear(),
config = {
scripts: "src/js/**/*.js",
scriptsDir: "src/js",
modulesDir: "src/js/modules",
Expand Down Expand Up @@ -59,26 +61,65 @@ module.exports = function (grunt) {
clean: {
jshint: ["jshint"],
jscs: ["jscs"],
tests: ["qunit", "coverage", "instrumentedFiles"]
tests: ["qunit", "coverage", "instrumentedFiles"],
build: ["dist/js/**/*", "dist/css/**/*", "dist/bower.json"]
},
coveralls: {
// LCOV coverage file (can be string, glob or array)
src: './coverage/reportLCOV/*.info',
// Options relevant to all targets
options: {
// When true, grunt-coveralls will only print a warning rather than
// an error, to prevent CI builds from failing unnecessarily (e.g. if
// coveralls.io is down). Optional, defaults to false.
force: false
src: './coverage/reportLCOV/*.info'
},
copy: {
js: {
expand: true,
cwd: './src/',
src: 'js/**/*.js',
dest: './dist/',
options: {
process: function (content, srcpath) {
return content.replace("<build_number>", buildVersion).replace("<year>", year);
}
},
},
css: {
expand: true,
cwd: './src/',
src: 'css/**',
dest: './dist/',
},
resources: {
src: ['bower.json', "README.md", "LICENSE"],
dest: './dist/'
}
}
},
cssmin: {
all: {
files: [{
expand: true,
cwd: 'dist/css/',
src: ['**/*.css', '!**/*.min.css'],
dest: 'dist/css'
}]
},
structure: {
options: {
rebase: true
},
files: [{
'dist/css/structure/infragistics.css': ['dist/css/structure/modules/*.css']
}]
}
},
uglify: require('./build/config/all/combined-files.js')
});

grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-jscs");
grunt.loadNpmTasks("grunt-qunit-istanbul");
grunt.loadNpmTasks("grunt-coveralls");
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');

grunt.task.registerTask("hint", "A sample task to run JSHINT", function(control) {
var config;
Expand Down Expand Up @@ -162,4 +203,11 @@ module.exports = function (grunt) {
grunt.task.run("hint", "jscs", "test");
}
});

grunt.task.registerTask("build", "Combine output files and prepare output", function() {
grunt.task.run("clean:build");
grunt.task.run("copy");
grunt.task.run("uglify");
grunt.task.run("cssmin");
});
};
66 changes: 66 additions & 0 deletions build/config/all/combined-files.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
var locales = ["bg", "de", "en", "es", "fr", "ja", "ru"], newFiles = {}, i;

module.exports = {
"options": {

// use the general "keep some" regexp
"preserveComments": /(?:^!|@(?:license|preserve|cc_on))/,
"compress": false,
"mangle": false
},
"combine": {
"files": {
"./dist/js/infragistics.core-lite.js": [
"./dist/js/i18n/infragistics-en.js",
"./dist/js/modules/infragistics.util.js",
"./dist/js/modules/infragistics.dataSource.js",
"./dist/js/modules/infragistics.templating.js",
"./dist/js/modules/infragistics.ui.shared.js",
"./dist/js/modules/infragistics.ui.scroll.js"
],
"./dist/js/infragistics.lob-lite.js": [
"./dist/js/modules/infragistics.ui.combo.js",
"./dist/js/modules/infragistics.ui.dialog.js",
"./dist/js/modules/infragistics.ui.popover.js",
"./dist/js/modules/infragistics.ui.notifier.js",
"./dist/js/modules/infragistics.ui.editors.js",
"./dist/js/modules/infragistics.ui.tree.js",
"./dist/js/modules/infragistics.ui.layoutmanager.js",
"./dist/js/modules/infragistics.ui.splitter.js",
"./dist/js/modules/infragistics.ui.splitbutton.js",
"./dist/js/modules/infragistics.ui.rating.js",
"./dist/js/modules/infragistics.ui.toolbarbutton.js",
"./dist/js/modules/infragistics.ui.colorpicker.js",
"./dist/js/modules/infragistics.ui.colorpickersplitbutton.js",
"./dist/js/modules/infragistics.ui.toolbar.js",
"./dist/js/modules/infragistics.ui.tilemanager.js",
"./dist/js/modules/infragistics.ui.upload.js",
"./dist/js/modules/infragistics.ui.validator.js",
"./dist/js/modules/infragistics.ui.htmleditor.js",
"./dist/js/modules/infragistics.ui.videoplayer.js",
"./dist/js/modules/infragistics.ui.zoombar.js"
]
}
},
"all": {
files: [{
expand: true,
cwd: 'dist/',
src: ['**/*.js', '**/*-lite.js'],
dest: 'dist/'
}
]
}
};

/**
* Prepare bundles for each localization
*/
for (var i = 0; i < locales.length; i++) {
newFiles["./dist/js/i18n/infragistics-" + locales[i] + ".js"] = "./dist/js/modules/i18n/*-en.js";
}
// keep order
for (var key in module.exports.combine.files) {
newFiles[key] = module.exports.combine.files[key];
}
module.exports.combine.files = newFiles;
25 changes: 25 additions & 0 deletions dist/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "ignite-ui",
"version": "0.0.2-alpha.0",
"description": "Ignite UI by Infragistics",
"homepage": "http://www.igniteui.com/",
"repository": {
"type": "git",
"url": "https://github.com/IgniteUI/ignite-ui.git"
},
"keywords": [
"igniteui",
"ignite ui",
"infragistics",
"jquery controls",
"jquery widgets"
],
"bugs": {
"url": "https://github.com/IgniteUI/ignite-ui/issues"
},
"license": "Apache-2.0",
"peerDependencies": {
"jquery": "^2.2.4",
"jquery-ui": "^1.10.5"
}
}
17 changes: 17 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
{
"name": "ignite-ui",
"version": "0.0.1",
"description": "Ignite UI by Infragistics",
"homepage": "http://www.igniteui.com/",
"repository": {
"type": "git",
"url": "https://github.com/IgniteUI/ignite-ui.git"
},
"keywords": [
"igniteui",
"ignite ui",
"infragistics",
"jquery controls",
"jquery widgets"
],
"license": "Apache-2.0",
"scripts": {
"preinstall": "npm install -g bower",
"postinstall" : "npm install -g grunt-cli && bower install"
Expand All @@ -9,7 +23,10 @@
"devDependencies": {
"grunt": "^0.4.5",
"grunt-contrib-clean": "^1.0.0",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-cssmin": "^1.0.1",
"grunt-contrib-jshint": "^1.0.0",
"grunt-contrib-uglify": "^1.0.1",
"grunt-coveralls": "^1.0.1",
"grunt-jscs": "^3.0.1",
"grunt-qunit-istanbul": "^0.6.0"
Expand Down

0 comments on commit 5019894

Please sign in to comment.