##// END OF EJS Templates
updated build script, added eslint
cin -
r63:fb1f84f91895 default
parent child
Show More
@@ -58,23 +58,29 task beforeBuild {
58 def createSoursetTasks = { String name, String outDir ->
58 def createSoursetTasks = { String name, String outDir ->
59 def setName = name.capitalize();
59 def setName = name.capitalize();
60
60
61 def destDir = "$buildDir/compile/$name"
61 def compileDir = "$buildDir/compile/$name"
62 def declDir = "$typingsDir/$name"
62 def declDir = "$typingsDir/$name"
63 def setDir = "$projectDir/src/$name"
63 def setDir = "$projectDir/src/$name"
64 def jsDir = outDir;
64
65
65 def beforeBuildTask = task "beforeBuild$setName"(dependsOn: beforeBuild) {
66 def beforeBuildTask = task "beforeBuild$setName"(dependsOn: beforeBuild) {
66 }
67 }
67
68
68 def copyJsTask = task "copyJs$setName"(dependsOn: beforeBuildTask, type: Copy) {
69 def copyJsTask = task "copyJs$setName"(dependsOn: beforeBuildTask, type: Copy) {
69 from "$setDir/js"
70 from "$setDir/js"
70 into outDir
71 into jsDir
72 }
73
74 def lintJsTask = task "lintJs$setName"(dependsOn: beforeBuildTask, type: Exec) {
75 inputs.dir("$setDir/js/").skipWhenEmpty();
76 commandLine "eslint", '--format', 'stylish', "$setDir/js/"
71 }
77 }
72
78
73 def compileTsTask = task "compileTs$setName"(dependsOn: beforeBuildTask, type: Exec) {
79 def compileTsTask = task "compileTs$setName"(dependsOn: beforeBuildTask, type: Exec) {
74 inputs.dir("$setDir/ts")
80 inputs.dir("$setDir/ts").skipWhenEmpty()
75 inputs.file("$srcDir/tsconfig.json")
81 inputs.file("$srcDir/tsconfig.json")
76 inputs.file("$setDir/tsconfig.json")
82 inputs.file("$setDir/tsconfig.json")
77 outputs.dir(destDir)
83 outputs.dir(compileDir)
78 outputs.dir(declDir)
84 outputs.dir(declDir)
79
85
80 commandLine 'node_modules/.bin/tsc',
86 commandLine 'node_modules/.bin/tsc',
@@ -82,7 +88,7 def createSoursetTasks = { String name,
82 '-t', target,
88 '-t', target,
83 '-m', jsmodule,
89 '-m', jsmodule,
84 '-d',
90 '-d',
85 '--outDir', destDir,
91 '--outDir', compileDir,
86 '--declarationDir', declDir
92 '--declarationDir', declDir
87
93
88 if (lib)
94 if (lib)
@@ -90,16 +96,26 def createSoursetTasks = { String name,
90 }
96 }
91
97
92 def copyTsOutputTask = task "copyTsOutput$setName"(dependsOn: compileTsTask, type: Copy) {
98 def copyTsOutputTask = task "copyTsOutput$setName"(dependsOn: compileTsTask, type: Copy) {
93 from destDir
99 from compileDir
94 into outDir
100 into jsDir
95 }
101 }
96
102
97 def copyTypingsTask = task "copyTypings$setName"(dependsOn: compileTsTask, type: Copy) {
103 def copyTypingsTask = task "copyTypings$setName"(dependsOn: compileTsTask, type: Copy) {
98 from declDir
104 from declDir
105 into jsDir
106 }
107
108 def copyResourcesTask = task "copyResources$setName"(dependsOn: beforeBuildTask, type: Copy) {
109 from "$setDir/resources"
99 into outDir
110 into outDir
100 }
111 }
101
112
102 task "build$setName"(dependsOn: [copyTypingsTask, copyTsOutputTask, copyJsTask]) {
113 task "build$setName" {
114 dependsOn copyTypingsTask,
115 copyTsOutputTask,
116 copyJsTask,
117 copyResourcesTask,
118 lintJsTask
103 }
119 }
104 }
120 }
105
121
@@ -4,7 +4,7 HISTORY
4 1.2.0
4 1.2.0
5 -----
5 -----
6
6
7 Major rafactoring, moving to support browser (rjs) and server (cjs) environments.
7 Major rafactoring, moving to support both browser (rjs) and server (cjs) environments.
8
8
9 - dependency injection container ported to typescript
9 - dependency injection container ported to typescript
10 - sources are split to several sets to provide the ability for the conditional build of the project.
10 - sources are split to several sets to provide the ability for the conditional build of the project.
@@ -90,7 +90,7
90 },
90 },
91 "duplexer": {
91 "duplexer": {
92 "version": "0.1.1",
92 "version": "0.1.1",
93 "resolved": "http://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz",
93 "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz",
94 "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=",
94 "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=",
95 "dev": true
95 "dev": true
96 },
96 },
@@ -144,7 +144,7
144 "dependencies": {
144 "dependencies": {
145 "tape": {
145 "tape": {
146 "version": "2.3.3",
146 "version": "2.3.3",
147 "resolved": "http://registry.npmjs.org/tape/-/tape-2.3.3.tgz",
147 "resolved": "https://registry.npmjs.org/tape/-/tape-2.3.3.tgz",
148 "integrity": "sha1-Lnzgox3wn41oUWZKcYQuDKUFevc=",
148 "integrity": "sha1-Lnzgox3wn41oUWZKcYQuDKUFevc=",
149 "dev": true,
149 "dev": true,
150 "requires": {
150 "requires": {
@@ -277,7 +277,7
277 },
277 },
278 "minimist": {
278 "minimist": {
279 "version": "0.0.5",
279 "version": "0.0.5",
280 "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.5.tgz",
280 "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.5.tgz",
281 "integrity": "sha1-16oye87PUY+RBqxrjwA/o7zqhWY=",
281 "integrity": "sha1-16oye87PUY+RBqxrjwA/o7zqhWY=",
282 "dev": true
282 "dev": true
283 },
283 },
@@ -316,7 +316,7
316 },
316 },
317 "readable-stream": {
317 "readable-stream": {
318 "version": "1.1.14",
318 "version": "1.1.14",
319 "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
319 "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
320 "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=",
320 "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=",
321 "dev": true,
321 "dev": true,
322 "requires": {
322 "requires": {
@@ -369,7 +369,7
369 },
369 },
370 "string_decoder": {
370 "string_decoder": {
371 "version": "0.10.31",
371 "version": "0.10.31",
372 "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
372 "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
373 "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=",
373 "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=",
374 "dev": true
374 "dev": true
375 },
375 },
@@ -432,7 +432,7
432 },
432 },
433 "through2": {
433 "through2": {
434 "version": "0.2.3",
434 "version": "0.2.3",
435 "resolved": "http://registry.npmjs.org/through2/-/through2-0.2.3.tgz",
435 "resolved": "https://registry.npmjs.org/through2/-/through2-0.2.3.tgz",
436 "integrity": "sha1-6zKE2k6jEbbMis42U3SKUqvyWj8=",
436 "integrity": "sha1-6zKE2k6jEbbMis42U3SKUqvyWj8=",
437 "dev": true,
437 "dev": true,
438 "requires": {
438 "requires": {
@@ -7,7 +7,7
7 _destination : null,
7 _destination : null,
8 _id : null,
8 _id : null,
9
9
10 constructor : function(session, destination, options) {
10 constructor : function(session, destination) {
11 this._destination = destination;
11 this._destination = destination;
12 this._session = session;
12 this._session = session;
13 },
13 },
@@ -35,7 +35,7
35 return options;
35 return options;
36 },
36 },
37
37
38 process : function(msg) {
38 process : function() {
39 this.warn("Messages are not acceped by this client");
39 this.warn("Messages are not acceped by this client");
40 },
40 },
41
41
@@ -76,19 +76,16
76 },
76 },
77 handleAs: 'json'
77 handleAs: 'json'
78 })
78 })
79 .then(
79 .then(function (id) {
80 function (id) {
80 me.log(
81 me
82 .log(
83 "CLIENT id=${0}, mode=${1}, destination=${2}",
81 "CLIENT id=${0}, mode=${1}, destination=${2}",
84 id,
82 id,
85 options.mode,
83 options.mode,
86 options.destination);
84 options.destination);
87 me._clients[id] = options.client ?
85 me._clients[id] = options.client ?
88 options.client :
86 options.client :
89 function (msg) {
87 function () {
90 me
88 me.warn(
91 .warn(
92 "The client id=${0}, mode=${1}, destination=${2} isn't accepting mesages",
89 "The client id=${0}, mode=${1}, destination=${2} isn't accepting mesages",
93 id,
90 id,
94 options.mode,
91 options.mode,
General Comments 0
You need to be logged in to leave comments. Login now