| @@ -0,0 +1,27 | |||||
|
|
1 | { | |||
|
|
2 | "env": { | |||
|
|
3 | "browser": true, | |||
|
|
4 | "commonjs": true, | |||
|
|
5 | "amd": true, | |||
|
|
6 | "node": true | |||
|
|
7 | }, | |||
|
|
8 | "parserOptions": { | |||
|
|
9 | "ecmaFeatures": { | |||
|
|
10 | "jsx": true | |||
|
|
11 | }, | |||
|
|
12 | "sourceType": "module" | |||
|
|
13 | }, | |||
|
|
14 | "extends": "eslint:recommended", | |||
|
|
15 | "rules": { | |||
|
|
16 | "no-const-assign": "warn", | |||
|
|
17 | "no-this-before-super": "warn", | |||
|
|
18 | "no-undef": "error", | |||
|
|
19 | "no-unreachable": "warn", | |||
|
|
20 | "no-unused-vars": "warn", | |||
|
|
21 | "constructor-super": "warn", | |||
|
|
22 | "valid-typeof": "warn", | |||
|
|
23 | "semi" : "warn", | |||
|
|
24 | "no-invalid-this" : "error", | |||
|
|
25 | "no-console": "off" | |||
|
|
26 | } | |||
|
|
27 | } No newline at end of file | |||
| @@ -1,54 +1,59 | |||||
| 1 |
|
1 | |||
| 2 | println "version: $version" |
|
2 | println "version: $version" | |
| 3 |
|
3 | |||
| 4 | String makePackageName(String group, String name, String ver) { |
|
4 | def distDir = "$buildDir/dist" | |
| 5 | def sb = new StringBuilder(); |
|
5 | def testDir = "$buildDir/test" | |
| 6 | if(group) |
|
|||
| 7 | sb |
|
|||
| 8 | .append('@') |
|
|||
| 9 | .append(group) |
|
|||
| 10 | .append('/'); |
|
|||
| 11 |
|
||||
| 12 | sb.append(name); |
|
|||
| 13 |
|
6 | |||
| 14 | if (ver) |
|
7 | task clean { | |
| 15 | sb.append('@').append(ver); |
|
8 | doLast { | |
| 16 |
|
9 | delete buildDir | ||
| 17 | return sb.toString(); |
|
10 | } | |
| 18 | } |
|
|||
| 19 |
|
||||
| 20 | configurations { |
|
|||
| 21 | compile |
|
|||
| 22 | peer |
|
|||
| 23 | dev |
|
|||
| 24 | } |
|
11 | } | |
| 25 |
|
12 | |||
| 26 | dependencies { |
|
13 | task cleanNpm { | |
| 27 | compile ":eslint:1.x || >=2.5.0 || 5.0.0 - 7.2.3" |
|
14 | doLast { | |
| 28 | compile (name: 'foo') { |
|
15 | delete 'node_modules' | |
| 29 | ext.location = "http://some/package/location" |
|
|||
| 30 | } |
|
16 | } | |
| 31 | peer "dojo:core" |
|
|||
| 32 | } |
|
17 | } | |
| 33 |
|
18 | |||
| 34 | task prepare(type: Copy) { |
|
19 | task _npmInstall() { | |
| 35 | from('src/js/') |
|
20 | inputs.file("package.json") | |
| 36 | from('.') { |
|
21 | outputs.dir("node_modules") | |
| 37 | include 'readme.md', 'license', 'history.md', 'package.json' |
|
22 | doLast { | |
| 38 | } |
|
23 | exec { | |
| 39 | into(buildDir) |
|
24 | commandLine 'npm', 'install' | |
| 40 | } |
|
|||
| 41 |
|
||||
| 42 | task installDeps { |
|
|||
| 43 | configurations.compile.allDependencies.forEach { d -> |
|
|||
| 44 | println makePackageName(d.group, d.name, d.version); |
|
|||
| 45 | if(d.hasProperty('location')) { |
|
|||
| 46 | println d.location |
|
|||
| 47 | } |
|
25 | } | |
| 48 | } |
|
26 | } | |
| 49 | } |
|
27 | } | |
| 50 |
|
28 | |||
| 51 | task build(dependsOn: prepare) { |
|
29 | task _legacyJs(type:Copy) { | |
|
|
30 | from 'src/js/' | |||
|
|
31 | into distDir | |||
|
|
32 | } | |||
|
|
33 | ||||
|
|
34 | task _packageMeta(type: Copy) { | |||
|
|
35 | inputs.property("version", version) | |||
|
|
36 | from('.') { | |||
|
|
37 | include 'package.json', 'readme.md', 'license', 'history.md' | |||
|
|
38 | } | |||
|
|
39 | into distDir | |||
|
|
40 | doLast { | |||
|
|
41 | exec { | |||
|
|
42 | workingDir distDir | |||
|
|
43 | commandLine 'npm', 'version', version | |||
|
|
44 | } | |||
|
|
45 | } | |||
|
|
46 | } | |||
|
|
47 | ||||
|
|
48 | task build(dependsOn: [_npmInstall, _legacyJs, _packageMeta]) { | |||
|
|
49 | ||||
|
|
50 | } | |||
|
|
51 | ||||
|
|
52 | task _localInstall(dependsOn: build, type: Exec) { | |||
|
|
53 | inputs.file("$distDir/package.json") | |||
|
|
54 | outputs.upToDateWhen { true } | |||
|
|
55 | ||||
|
|
56 | commandLine 'npm', 'install', '--no-save', '--force', distDir | |||
| 52 | } |
|
57 | } | |
| 53 |
|
58 | |||
| 54 | task pack(dependsOn: build, type: Exec) { |
|
59 | task pack(dependsOn: build, type: Exec) { | |
| @@ -0,0 +1,22 | |||||
|
|
1 | Copyright 2017-2018 Implab team | |||
|
|
2 | ||||
|
|
3 | Redistribution and use in source and binary forms, with or without | |||
|
|
4 | modification, are permitted provided that the following conditions are met: | |||
|
|
5 | ||||
|
|
6 | 1. Redistributions of source code must retain the above copyright notice, this | |||
|
|
7 | list of conditions and the following disclaimer. | |||
|
|
8 | ||||
|
|
9 | 2. Redistributions in binary form must reproduce the above copyright notice, | |||
|
|
10 | this list of conditions and the following disclaimer in the documentation | |||
|
|
11 | and/or other materials provided with the distribution. | |||
|
|
12 | ||||
|
|
13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | |||
|
|
14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |||
|
|
15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
|
|
16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
|
|
17 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
|
|
18 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
|
|
19 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
|
|
20 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
|
|
21 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
|
|
22 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. No newline at end of file | |||
| @@ -1,6 +1,6 | |||||
| 1 | { |
|
1 | { | |
| 2 | "name": "@implab/core", |
|
2 | "name": "@implab/core", | |
| 3 |
"version": " |
|
3 | "version": "0.0.1-dev", | |
| 4 | "description": "Dependency injection, logging, simple and fast text template engine", |
|
4 | "description": "Dependency injection, logging, simple and fast text template engine", | |
| 5 | "main": "main.js", |
|
5 | "main": "main.js", | |
| 6 | "scripts": { |
|
6 | "scripts": { | |
| @@ -13,6 +13,7 | |||||
| 13 | "template engine", |
|
13 | "template engine", | |
| 14 | "dependency injection" |
|
14 | "dependency injection" | |
| 15 | ], |
|
15 | ], | |
| 16 |
"author": " |
|
16 | "author": "Implab team", | |
| 17 |
"license": " |
|
17 | "license": "BSD", | |
|
|
18 | "repository": "https://bitbucket.org/implab/implabjs" | |||
| 18 | } |
|
19 | } | |
| @@ -179,7 +179,7 define([], | |||||
| 179 | return wrapresult(fn.apply(thisArg, arguments)); |
|
179 | return wrapresult(fn.apply(thisArg, arguments)); | |
| 180 | } catch (e) { |
|
180 | } catch (e) { | |
| 181 | return wrapresult(null, e); |
|
181 | return wrapresult(null, e); | |
| 182 |
} |
|
182 | } | |
| 183 | }, |
|
183 | }, | |
| 184 |
|
184 | |||
| 185 | create: function () { |
|
185 | create: function () { | |
General Comments 0
You need to be logged in to leave comments.
Login now
