Skip to content

Commit 9114331

Browse files
author
Jelte Lagendijk
committed
Update development files
1 parent 564562f commit 9114331

2 files changed

Lines changed: 30 additions & 8 deletions

File tree

Gulpfile.js

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Generated on 2016-11-10 using generator-mendix 2.0.1 :: git+https://github.com/mendix/generator-mendix.git
1+
// Generated on 2017-05-10 using generator-mendix 2.2.3 :: git+https://github.com/mendix/generator-mendix.git
22
/*jshint -W069,-W097*/
33
"use strict";
44

@@ -14,19 +14,22 @@ var gulp = require("gulp"),
1414
del = require("del"),
1515
newer = require("gulp-newer"),
1616
gutil = require("gulp-util"),
17+
plumber = require("gulp-plumber"),
1718
gulpif = require("gulp-if"),
1819
jsonTransform = require("gulp-json-transform"),
1920
intercept = require("gulp-intercept"),
2021
argv = require("yargs").argv,
21-
widgetBuilderHelper = require("widgetbuilder-gulp-helper");
22+
widgetBuilderHelper = require("widgetbuilder-gulp-helper"),
23+
jsValidate = require("gulp-jsvalidate");
2224

2325
var pkg = require("./package.json"),
2426
paths = widgetBuilderHelper.generatePaths(pkg),
2527
xmlversion = widgetBuilderHelper.xmlversion;
2628

27-
gulp.task("default", function() {
29+
gulp.task("default", ["build"], function() {
2830
gulp.watch("./src/**/*", ["compress"]);
2931
gulp.watch("./src/**/*.js", ["copy:js"]);
32+
gulp.watch("./src/**/*.html", ["copy:html"]);
3033
});
3134

3235
gulp.task("clean", function () {
@@ -45,6 +48,22 @@ gulp.task("compress", ["clean"], function () {
4548

4649
gulp.task("copy:js", function () {
4750
return gulp.src(["./src/**/*.js"])
51+
.pipe(plumber(function (error) {
52+
var msg = gutil.colors.red("Error");
53+
if (error.fileName) {
54+
msg += gutil.colors.red(" in ") + gutil.colors.cyan(error.fileName);
55+
}
56+
msg += " : " + gutil.colors.cyan(error.message);
57+
gutil.log(msg);
58+
this.emit("end");
59+
}))
60+
.pipe(jsValidate())
61+
.pipe(newer(paths.TEST_WIDGETS_DEPLOYMENT_FOLDER))
62+
.pipe(gulp.dest(paths.TEST_WIDGETS_DEPLOYMENT_FOLDER));
63+
});
64+
65+
gulp.task("copy:html", function () {
66+
return gulp.src(["./src/**/*.html"])
4867
.pipe(newer(paths.TEST_WIDGETS_DEPLOYMENT_FOLDER))
4968
.pipe(gulp.dest(paths.TEST_WIDGETS_DEPLOYMENT_FOLDER));
5069
});
@@ -69,7 +88,7 @@ gulp.task("icon", function (cb) {
6988
console.log("\nUsing this file to create a base64 string: " + gutil.colors.cyan(icon));
7089
gulp.src(icon)
7190
.pipe(intercept(function (file) {
72-
console.log("\nCopy the following to your " + pkg.name + ".xml (after description):\n\n" + gutil.colors.cyan("<icon>") + file.contents.toString("base64") + gutil.colors.cyan("<\\icon>") + "\n");
91+
console.log("\nCopy the following to your " + pkg.name + ".xml (after description):\n\n" + gutil.colors.cyan("<icon>") + file.contents.toString("base64") + gutil.colors.cyan("<\/icon>") + "\n");
7392
cb();
7493
}));
7594
});

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,29 @@
55
"license": "Apache License, Version 2",
66
"author": "Mendix",
77
"private": true,
8-
"dependencies": {},
8+
"dependencies": {
9+
},
910
"devDependencies": {
1011
"del": "^2.2.2",
1112
"gulp": "^3.9.1",
1213
"gulp-if": "^2.0.1",
1314
"gulp-intercept": "^0.1.0",
1415
"gulp-json-transform": "^0.4.2",
1516
"gulp-newer": "^1.3.0",
17+
"gulp-plumber": "^1.1.0",
1618
"gulp-util": "^3.0.7",
1719
"gulp-zip": "^3.2.0",
20+
"gulp-jsvalidate": "^3.0.0",
1821
"widgetbuilder-gulp-helper": "https://github.com/JelteMX/widgetbuilder-gulp-helper/archive/1.0.1.tar.gz",
1922
"yargs": "^6.0.0"
2023
},
2124
"engines": {
2225
"node": ">=5"
2326
},
24-
"generatorVersion": "2.0.1",
27+
"generatorVersion": "2.2.3",
2528
"paths": {
2629
"testProjectFolder": "./test/",
27-
"testProjectFileName": "[Test] ChartJS.mpr"
30+
"testProjectFileName": "Test.mpr"
2831
},
2932
"scripts": {
3033
"build": "node ./node_modules/gulp/bin/gulp build",
@@ -33,4 +36,4 @@
3336
"folders": "node ./node_modules/gulp/bin/gulp folders",
3437
"modeler": "node ./node_modules/gulp/bin/gulp modeler"
3538
}
36-
}
39+
}

0 commit comments

Comments
 (0)