Skip to content

Commit d4af5a1

Browse files
author
Jelte Lagendijk
committed
Add development files
1 parent c92dfbd commit d4af5a1

File tree

4 files changed

+138
-2
lines changed

4 files changed

+138
-2
lines changed

.gitignore

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
test/javasource/
1+
test/javasource/**/proxies/
2+
test/javasource/com/
3+
test/javasource/system/
24
test/deployment/
35
test/.classpath
46
test/.project
5-
*.mws
67
*.launch
78
*.tmp
89
*.lock
910
.idea/
11+
*.bak
12+
settings/
13+
node_modules/
14+
dist/

Gruntfile.js

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
'use strict';
2+
3+
// In case you seem to have trouble starting Mendix through `grunt start-mendix`, you might have to set the path to the Mendix application.
4+
// If it works, leave MODELER_PATH at null
5+
var MODELER_PATH = null;
6+
var MODELER_ARGS = '/file:{path}';
7+
8+
var path = require('path'),
9+
mendixApp = require('node-mendix-modeler-path'),
10+
shelljs = require('shelljs');
11+
12+
// In case you have a different path to the test project (currently in ./test/Test.mpr) point TEST_PATH to the Test-project (full path). Otherwise, leave at null
13+
var TEST_PATH = path.join(shelljs.pwd(), './test/Test.mpr');
14+
15+
module.exports = function (grunt) {
16+
var pkg = grunt.file.readJSON("package.json");
17+
grunt.verbose;
18+
grunt.initConfig({
19+
watch: {
20+
autoDeployUpdate: {
21+
"files": [ "./src/**/*" ],
22+
"tasks": [ "newer:copy", "compress" ],
23+
options: {
24+
debounceDelay: 250,
25+
livereload: true
26+
}
27+
}
28+
},
29+
compress: {
30+
makezip: {
31+
options: {
32+
archive: "./dist/" + pkg.name + ".mpk",
33+
mode: "zip"
34+
},
35+
files: [{
36+
expand: true,
37+
date: new Date(),
38+
store: false,
39+
cwd: "./src",
40+
src: ["**/*"]
41+
}]
42+
}
43+
},
44+
copy: {
45+
deployment: {
46+
files: [
47+
{ dest: "./test/deployment/web/widgets", cwd: "./src/", src: ["**/*"], expand: true }
48+
]
49+
},
50+
mpks: {
51+
files: [
52+
{ dest: "./test/widgets", cwd: "./dist/", src: [ pkg.name + ".mpk"], expand: true }
53+
]
54+
}
55+
},
56+
clean: {
57+
build: [
58+
"./dist/" + pkg.name + "/*",
59+
"./test/deployment/web/widgets/" + pkg.name + "/*",
60+
"./test/widgets/" + pkg.name + ".mpk"
61+
]
62+
}
63+
});
64+
65+
grunt.loadNpmTasks("grunt-contrib-compress");
66+
grunt.loadNpmTasks("grunt-contrib-clean");
67+
grunt.loadNpmTasks("grunt-contrib-watch");
68+
grunt.loadNpmTasks("grunt-contrib-copy");
69+
grunt.loadNpmTasks("grunt-newer");
70+
71+
grunt.registerTask("start-modeler", function () {
72+
var done = this.async(),
73+
testProjectPath = TEST_PATH !== null ? TEST_PATH : path.join(shelljs.pwd(), '/test/Test.mpr');
74+
75+
if (MODELER_PATH !== null || (mendixApp.err === null && mendixApp.output !== null && mendixApp.output.cmd && mendixApp.output.arg)) {
76+
grunt.util.spawn({
77+
cmd: MODELER_PATH || mendixApp.output.cmd,
78+
args: [
79+
(MODELER_PATH !== null ? MODELER_ARGS : mendixApp.output.arg).replace('{path}', testProjectPath)
80+
]
81+
}, function () {
82+
done();
83+
});
84+
} else {
85+
console.error('Cannot start Modeler, see error:');
86+
console.log(mendixApp.err);
87+
done();
88+
}
89+
});
90+
91+
grunt.registerTask(
92+
"default",
93+
"Watches for changes and automatically creates an MPK file, as well as copying the changes to your deployment folder",
94+
[ "watch" ]
95+
);
96+
97+
grunt.registerTask(
98+
"clean build",
99+
"Compiles all the assets and copies the files to the build directory.",
100+
[ "clean", "compress", "copy" ]
101+
);
102+
103+
grunt.registerTask(
104+
"build",
105+
[ "clean build" ]
106+
);
107+
};

package.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "HTMLSnippet",
3+
"version": "1.3.0",
4+
"description": "This widget is useful to add a piece of HTML or JavaScript to a form. For example to embed a YouTube or Flash object. Furthermore it can be used to enhance styling by adding arbitrary HTML elements. ",
5+
"private": true,
6+
"dependencies": {
7+
},
8+
"devDependencies": {
9+
"grunt": "0.4.5",
10+
"grunt-contrib-clean": "^0.6.0",
11+
"grunt-contrib-compress": "^0.14.0",
12+
"grunt-contrib-copy": "^0.8.2",
13+
"grunt-contrib-watch": "^0.6.1",
14+
"grunt-newer": "^1.1.1",
15+
"shelljs": "^0.5.3",
16+
"node-mendix-modeler-path": "https://github.com/JelteMX/node-mendix-modeler-path/archive/v1.0.0.tar.gz"
17+
},
18+
"engines": {
19+
"node": ">=0.12.0"
20+
},
21+
"scripts": {
22+
"test": "grunt test"
23+
}
24+
}

test/widgets/HTMLSnippet.mpk

22.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)