##// END OF EJS Templates
working on multiplaftorm support (node, browser)
cin -
r47:4a34b9d6df70 di-typescript
parent child
Show More
@@ -0,0 +1,23
1 {
2 "name": "${packageName}",
3 "version": "${verstion}",
4 "description": "${description}",
5 "main": "main.js",
6 "keywords": [
7 "di",
8 "ioc",
9 "logging",
10 "template engine",
11 "dependency injection"
12 ],
13 "author": "${author}",
14 "license": "${license}",
15 "repository": "$repository",
16 "publishConfig": {
17 "access": "public"
18 },
19 "peerDependencies": {
20 "dojo": "^1.10.0"
21 }
22 }
23 No newline at end of file
@@ -0,0 +1,16
1 {
2 "compilerOptions": {
3 "target": "es3",
4 "module": "amd",
5 "sourceMap": true,
6 "declaration": true,
7 "lib": [
8 "es5",
9 "es2015.promise",
10 "es2015.symbol"
11 ]
12 },
13 "include" : [
14 "ts/**/*.ts"
15 ]
16 } No newline at end of file
@@ -0,0 +1,14
1 {
2 "compilerOptions": {
3 "target": "es3",
4 "module": "amd",
5 "sourceMap": true,
6 "moduleResolution": "node",
7 "lib": [
8 "es2015"
9 ]
10 },
11 "include" : [
12 "ts/**/*.ts"
13 ]
14 } No newline at end of file
@@ -1,94 +1,105
1 if (release != 'rtm') {
1 if (release != 'rtm') {
2 version += "-$release"
2 version += "-$release"
3 }
3 }
4
4
5 println "version: $version"
5 if(!npmName)
6 npmName = name;
7
8 ext.packageName="$npmScope/$npmName";
6
9
7 def distDir = "$buildDir/dist"
10 def packageDir = "$buildDir/dist"
8 def testDir = "$buildDir/test"
11 def distDir = "$packageDir/$platform"
12 def testDir = "$packageDir/$platform"
13
14 task printVersion {
15 println "version: $version"
16 println "packageName: $packageName"
17 println "platform: $platform"
18 }
19
9
20
10 task clean {
21 task clean {
11 doLast {
22 doLast {
12 delete buildDir
23 delete buildDir
13 delete 'node_modules/@implab'
24 delete "node_modules/$packageName"
14 }
25 }
15 }
26 }
16
27
17 task cleanNpm {
28 task cleanNpm {
18 doLast {
29 doLast {
19 delete 'node_modules'
30 delete 'node_modules'
20 }
31 }
21 }
32 }
22
33
23 task _npmInstall() {
34 task _npmInstall() {
24 inputs.file("package.json")
35 inputs.file("package.json")
25 outputs.dir("node_modules")
36 outputs.dir("node_modules")
26 doLast {
37 doLast {
27 exec {
38 exec {
28 commandLine 'npm', 'install'
39 commandLine 'npm', 'install'
29 }
40 }
30 }
41 }
31 }
42 }
32
43
33 task _legacyJs(type:Copy) {
44 task _legacyJs(type:Copy) {
34 from 'src/js/'
45 from 'src/js/'
35 into distDir
46 into distDir
36 }
47 }
37
48
38 task _buildTs(dependsOn: _npmInstall, type:Exec) {
49 task _buildTs(dependsOn: _npmInstall, type:Exec) {
39 inputs.dir('src/ts')
50 inputs.dir('src/ts')
40 inputs.file('tsconfig.json')
51 inputs.file('tsconfig.json')
41 outputs.dir(distDir)
52 outputs.dir(distDir)
42
53
43 commandLine 'node_modules/.bin/tsc', '-p', 'tsconfig.json'
54 commandLine 'node_modules/.bin/tsc', '-p', 'src/tsconfig.json', '--outDir', distDir
44 }
55 }
45
56
46 task _packageMeta(type: Copy) {
57 task _packageMeta(type: Copy) {
47 inputs.property("version", version)
58 inputs.property("version", version)
48 from('.') {
59 from('.') {
49 include 'package.json', '.npmignore', 'readme.md', 'license', 'history.md'
60 include 'package.json', '.npmignore', 'readme.md', 'license', 'history.md'
50 }
61 }
51 into distDir
62 into distDir
52 doLast {
63 doLast {
53 exec {
64 exec {
54 workingDir distDir
65 workingDir distDir
55 commandLine 'npm', 'version', version
66 commandLine 'npm', 'version', version
56 }
67 }
57 }
68 }
58 }
69 }
59
70
60 task build(dependsOn: [_legacyJs, _npmInstall, _buildTs, _packageMeta]) {
71 task build(dependsOn: [_legacyJs, _npmInstall, _buildTs, _packageMeta]) {
61
72
62 }
73 }
63
74
64 task _localInstall(dependsOn: build, type: Exec) {
75 task _localInstall(dependsOn: build, type: Exec) {
65 inputs.file("$distDir/package.json")
76 inputs.file("$distDir/package.json")
66 outputs.upToDateWhen {
77 outputs.upToDateWhen {
67 new File("$projectDir/node_modules/@implab/core").exists()
78 new File("$projectDir/node_modules/$packageName").exists()
68 }
79 }
69
80
70 commandLine 'npm', 'install', '--no-save', '--force', distDir
81 commandLine 'npm', 'install', '--no-save', '--force', distDir
71 }
82 }
72
83
73 task copyJsTests(type: Copy) {
84 task copyJsTests(type: Copy) {
74 from 'test/js'
85 from 'test/js'
75 into testDir
86 into testDir
76 }
87 }
77
88
78 task buildTests(dependsOn: _localInstall, type: Exec) {
89 task buildTests(dependsOn: _localInstall, type: Exec) {
79 inputs.dir('test/ts')
90 inputs.dir('test/ts')
80 inputs.file('tsconfig.test.json')
91 inputs.file('test/tsconfig.json')
81 outputs.dir(testDir)
92 outputs.dir(testDir)
82
93
83 commandLine 'node_modules/.bin/tsc', '-p', 'tsconfig.test.json'
94 commandLine 'node_modules/.bin/tsc', '-p', 'test/tsconfig.json', '--outDir', distDir
84 }
95 }
85
96
86 task test(dependsOn: [copyJsTests, buildTests], type: Exec) {
97 task test(dependsOn: [copyJsTests, buildTests], type: Exec) {
87 commandLine 'node', 'run-amd-tests.js'
98 commandLine 'node', 'run-amd-tests.js'
88 }
99 }
89
100
90 task pack(dependsOn: build, type: Exec) {
101 task pack(dependsOn: build, type: Exec) {
91 workingDir = distDir
102 workingDir = distDir
92
103
93 commandLine 'npm', 'pack'
104 commandLine 'npm', 'pack'
94 } No newline at end of file
105 }
@@ -1,2 +1,8
1 version=1.2.0
1 version=1.2.0
2 release=rc No newline at end of file
2 release=rc
3 platform=amd
4 descriptrion=Dependency injection, logging, simple and fast text template engine
5 license=BSD-2-Clause
6 repository=https://bitbucket.org/implab/implabjs
7 npmScope=@implab
8 npmName=core No newline at end of file
@@ -1,15 +1,15
1 /*
1 /*
2 * This settings file was generated by the Gradle 'init' task.
2 * This settings file was generated by the Gradle 'init' task.
3 *
3 *
4 * The settings file is used to specify which projects to include in your build.
4 * The settings file is used to specify which projects to include in your build.
5 * In a single project build this file can be empty or even removed.
5 * In a single project build this file can be empty or even removed.
6 *
6 *
7 * Detailed information about configuring a multi-project build in Gradle can be found
7 * Detailed information about configuring a multi-project build in Gradle can be found
8 * in the user guide at https://docs.gradle.org/3.5/userguide/multi_project_builds.html
8 * in the user guide at https://docs.gradle.org/3.5/userguide/multi_project_builds.html
9 */
9 */
10
10
11 // To declare projects as part of a multi-project build use the 'include' method
11 // To declare projects as part of a multi-project build use the 'include' method
12
12
13 //include 'sub-project-name'
13 //include 'sub-project-name'
14
14
15 rootProject.name = 'implab-core' No newline at end of file
15 rootProject.name = 'core' No newline at end of file
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now