Skip to content

Commit 89d9110

Browse files
author
Jelte Lagendijk
committed
Update development files
1 parent afe585a commit 89d9110

File tree

5 files changed

+106
-241
lines changed

5 files changed

+106
-241
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ test/.project
1010
*.tmp
1111
*.lock
1212
.idea/
13-
settings/
13+
1414
dist/
1515

1616
node_modules/

.jshintrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
"undef" : true,
1010
"globals" : {
1111
"mendix" : false,
12-
"mx" : false
12+
"mx" : false,
13+
"logger" : false
1314
},
14-
"evil" : true,
1515

1616
// Relaxing
1717
"laxbreak" : true,

Gruntfile.js

Lines changed: 0 additions & 223 deletions
This file was deleted.

Gulpfile.js

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
// Generated on 2016-11-11 using generator-mendix 2.0.1 :: git+https://github.com/mendix/generator-mendix.git
2+
/*jshint -W069,-W097*/
3+
"use strict";
4+
5+
// In case you seem to have trouble starting Mendix through `gulp modeler`, you might have to set the path to the Mendix application, otherwise leave both values as they are
6+
var MODELER_PATH = null;
7+
var MODELER_ARGS = "/file:{path}";
8+
9+
/********************************************************************************
10+
* Do not edit anything below, unless you know what you are doing
11+
********************************************************************************/
12+
var gulp = require("gulp"),
13+
zip = require("gulp-zip"),
14+
del = require("del"),
15+
newer = require("gulp-newer"),
16+
gutil = require("gulp-util"),
17+
gulpif = require("gulp-if"),
18+
jsonTransform = require("gulp-json-transform"),
19+
intercept = require("gulp-intercept"),
20+
argv = require("yargs").argv,
21+
widgetBuilderHelper = require("widgetbuilder-gulp-helper");
22+
23+
var pkg = require("./package.json"),
24+
paths = widgetBuilderHelper.generatePaths(pkg),
25+
xmlversion = widgetBuilderHelper.xmlversion;
26+
27+
gulp.task("default", function() {
28+
gulp.watch("./src/**/*", ["compress"]);
29+
gulp.watch("./src/**/*.js", ["copy:js"]);
30+
});
31+
32+
gulp.task("clean", function () {
33+
return del([
34+
paths.WIDGET_TEST_DEST,
35+
paths.WIDGET_DIST_DEST
36+
], { force: true });
37+
});
38+
39+
gulp.task("compress", ["clean"], function () {
40+
return gulp.src("src/**/*")
41+
.pipe(zip(pkg.name + ".mpk"))
42+
.pipe(gulp.dest(paths.TEST_WIDGETS_FOLDER))
43+
.pipe(gulp.dest("dist"));
44+
});
45+
46+
gulp.task("copy:js", function () {
47+
return gulp.src(["./src/**/*.js"])
48+
.pipe(newer(paths.TEST_WIDGETS_DEPLOYMENT_FOLDER))
49+
.pipe(gulp.dest(paths.TEST_WIDGETS_DEPLOYMENT_FOLDER));
50+
});
51+
52+
gulp.task("version:xml", function () {
53+
return gulp.src(paths.PACKAGE_XML)
54+
.pipe(xmlversion(argv.n))
55+
.pipe(gulp.dest("./src/"));
56+
});
57+
58+
gulp.task("version:json", function () {
59+
return gulp.src("./package.json")
60+
.pipe(gulpif(typeof argv.n !== "undefined", jsonTransform(function(data) {
61+
data.version = argv.n;
62+
return data;
63+
}, 2)))
64+
.pipe(gulp.dest("./"));
65+
});
66+
67+
gulp.task("icon", function (cb) {
68+
var icon = (typeof argv.file !== "undefined") ? argv.file : "./icon.png";
69+
console.log("\nUsing this file to create a base64 string: " + gutil.colors.cyan(icon));
70+
gulp.src(icon)
71+
.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");
73+
cb();
74+
}));
75+
});
76+
77+
gulp.task("folders", function () {
78+
paths.showPaths(); return;
79+
});
80+
81+
gulp.task("modeler", function (cb) {
82+
widgetBuilderHelper.runmodeler(MODELER_PATH, MODELER_ARGS, paths.TEST_PATH, cb);
83+
});
84+
85+
gulp.task("build", ["compress"]);
86+
gulp.task("version", ["version:xml", "version:json"]);

package.json

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,30 @@
88
"dependencies": {
99
},
1010
"devDependencies": {
11-
"grunt": "0.4.5",
12-
"grunt-contrib-clean": "^0.6.0",
13-
"grunt-contrib-compress": "^0.14.0",
14-
"grunt-contrib-copy": "^0.8.2",
15-
"grunt-contrib-watch": "^0.6.1",
16-
"grunt-newer": "^1.1.1",
17-
"node-base64-image": "^0.1.0",
18-
"shelljs": "^0.5.3",
19-
"xml2js": "^0.4.15",
20-
"semver": "^5.1.0",
21-
"node-mendix-modeler-path": "https://github.com/JelteMX/node-mendix-modeler-path/archive/v1.0.0.tar.gz"
11+
"del": "^2.2.2",
12+
"gulp": "^3.9.1",
13+
"gulp-if": "^2.0.1",
14+
"gulp-intercept": "^0.1.0",
15+
"gulp-json-transform": "^0.4.2",
16+
"gulp-newer": "^1.3.0",
17+
"gulp-util": "^3.0.7",
18+
"gulp-zip": "^3.2.0",
19+
"widgetbuilder-gulp-helper": "https://github.com/JelteMX/widgetbuilder-gulp-helper/archive/1.0.1.tar.gz",
20+
"yargs": "^6.0.0"
2221
},
23-
"repository": {"type":"git","url":"http://github.com/mendix/HTMLSnippet"},
2422
"engines": {
25-
"node": ">=0.12.0"
23+
"node": ">=5"
2624
},
27-
"generatorVersion": "1.3.3",
25+
"generatorVersion": "2.0.1",
2826
"paths": {
2927
"testProjectFolder": "./test/",
3028
"testProjectFileName": "Test.mpr"
3129
},
3230
"scripts": {
33-
"test": "grunt test"
31+
"build": "node ./node_modules/gulp/bin/gulp build",
32+
"version": "node ./node_modules/gulp/bin/gulp version",
33+
"icon": "node ./node_modules/gulp/bin/gulp icon",
34+
"folders": "node ./node_modules/gulp/bin/gulp folders",
35+
"modeler": "node ./node_modules/gulp/bin/gulp modeler"
3436
}
3537
}

0 commit comments

Comments
 (0)