Skip to content

Commit d4eeb57

Browse files
author
Jelte Lagendijk
committed
Fix development files
1 parent 05b2b78 commit d4eeb57

File tree

3 files changed

+109
-243
lines changed

3 files changed

+109
-243
lines changed

Gruntfile.js

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

Gulpfile.js

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
// Generated on 2017-02-02 using generator-mendix 2.0.4 :: 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+
jsValidate = require("gulp-jsvalidate");
23+
24+
var pkg = require("./package.json"),
25+
paths = widgetBuilderHelper.generatePaths(pkg),
26+
xmlversion = widgetBuilderHelper.xmlversion;
27+
28+
gulp.task("default", function() {
29+
gulp.watch("./src/**/*", ["compress"]);
30+
gulp.watch("./src/**/*.js", ["copy:js"]);
31+
});
32+
33+
gulp.task("clean", function () {
34+
return del([
35+
paths.WIDGET_TEST_DEST,
36+
paths.WIDGET_DIST_DEST
37+
], { force: true });
38+
});
39+
40+
gulp.task("compress", ["clean"], function () {
41+
return gulp.src("src/**/*")
42+
.pipe(zip(pkg.name + ".mpk"))
43+
.pipe(gulp.dest(paths.TEST_WIDGETS_FOLDER))
44+
.pipe(gulp.dest("dist"));
45+
});
46+
47+
gulp.task("copy:js", function () {
48+
return gulp.src(["./src/**/*.js"])
49+
.pipe(jsValidate())
50+
.pipe(newer(paths.TEST_WIDGETS_DEPLOYMENT_FOLDER))
51+
.pipe(gulp.dest(paths.TEST_WIDGETS_DEPLOYMENT_FOLDER));
52+
});
53+
54+
gulp.task("version:xml", function () {
55+
return gulp.src(paths.PACKAGE_XML)
56+
.pipe(xmlversion(argv.n))
57+
.pipe(gulp.dest("./src/"));
58+
});
59+
60+
gulp.task("version:json", function () {
61+
return gulp.src("./package.json")
62+
.pipe(gulpif(typeof argv.n !== "undefined", jsonTransform(function(data) {
63+
data.version = argv.n;
64+
return data;
65+
}, 2)))
66+
.pipe(gulp.dest("./"));
67+
});
68+
69+
gulp.task("icon", function (cb) {
70+
var icon = (typeof argv.file !== "undefined") ? argv.file : "./icon.png";
71+
console.log("\nUsing this file to create a base64 string: " + gutil.colors.cyan(icon));
72+
gulp.src(icon)
73+
.pipe(intercept(function (file) {
74+
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");
75+
cb();
76+
}));
77+
});
78+
79+
gulp.task("folders", function () {
80+
paths.showPaths(); return;
81+
});
82+
83+
gulp.task("modeler", function (cb) {
84+
widgetBuilderHelper.runmodeler(MODELER_PATH, MODELER_ARGS, paths.TEST_PATH, cb);
85+
});
86+
87+
gulp.task("build", ["compress"]);
88+
gulp.task("version", ["version:xml", "version:json"]);

package.json

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,34 @@
55
"license": "",
66
"author": "",
77
"private": true,
8-
"dependencies": {},
9-
"devDependencies": {
10-
"grunt": "0.4.5",
11-
"grunt-contrib-clean": "^0.6.0",
12-
"grunt-contrib-compress": "^0.14.0",
13-
"grunt-contrib-copy": "^0.8.2",
14-
"grunt-contrib-watch": "^0.6.1",
15-
"grunt-newer": "^1.1.1",
16-
"node-base64-image": "^0.1.0",
17-
"shelljs": "^0.5.3",
18-
"xml2js": "^0.4.15",
19-
"semver": "^5.1.0",
20-
"node-mendix-modeler-path": "https://github.com/JelteMX/node-mendix-modeler-path/archive/v1.0.0.tar.gz"
8+
"dependencies": {
219
},
22-
"repository": {
23-
"type": "git",
24-
"url": "http://github.com/mendix/CustomString"
10+
"devDependencies": {
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+
"gulp-jsvalidate": "^3.0.0",
20+
"widgetbuilder-gulp-helper": "https://github.com/JelteMX/widgetbuilder-gulp-helper/archive/1.0.1.tar.gz",
21+
"yargs": "^6.0.0"
2522
},
2623
"engines": {
27-
"node": ">=0.12.0"
24+
"node": ">=5"
2825
},
29-
"generatorVersion": "1.3.3",
26+
"generatorVersion": "2.0.4",
3027
"paths": {
3128
"testProjectFolder": "./test/",
3229
"testProjectFileName": "CustomStringTest.mpr"
3330
},
3431
"scripts": {
35-
"test": "grunt test"
32+
"build": "node ./node_modules/gulp/bin/gulp build",
33+
"version": "node ./node_modules/gulp/bin/gulp version",
34+
"icon": "node ./node_modules/gulp/bin/gulp icon",
35+
"folders": "node ./node_modules/gulp/bin/gulp folders",
36+
"modeler": "node ./node_modules/gulp/bin/gulp modeler"
3637
}
37-
}
38+
}

0 commit comments

Comments
 (0)