##// END OF EJS Templates
working on build.gradle
cin -
r92:a4a8e6f7b095 ts-plugin
parent child
Show More
@@ -1,5 +1,5
1 plugins {
1 plugins {
2 id "org.implab.gradle-typescript" version "1.0.1-rc1"
2 id "org.implab.gradle-typescript" version "1.0.1-rc2"
3 }
3 }
4
4
5 // если версия явно не заданы вычисляем ее из тэга ревизии v.{num}***
5 // если версия явно не заданы вычисляем ее из тэга ревизии v.{num}***
@@ -34,17 +34,10 if (hasProperty('versionSuffix') && vers
34 version += "-$versionSuffix"
34 version += "-$versionSuffix"
35 }
35 }
36
36
37 if(! jsmodule in ["amd", "commonjs", "system", "umd", "es6", "esnext"])
38 throw new Exception("Invalid jsmodule specified: $jsmodule");
39 if(! target in ["es3", "es5", "es6", "es2016", "es2017", "esnext"])
40 throw new Exception("Invalid target specified: $target")
41
42 ext {
37 ext {
43 packageName = "@$npmScope/$npmName"
38 packageName = "@$npmScope/$npmName"
44 }
39 }
45
40
46 def jstarget = target;
47
48 sources {
41 sources {
49 amd {
42 amd {
50 typings {
43 typings {
@@ -77,16 +70,9 sources {
77
70
78 typescript {
71 typescript {
79 compilerOptions {
72 compilerOptions {
80 lib = [target, "dom", "scripthost"]
81 if (jstarget in ["es5", "es3"])
82 lib += ["es2015.promise", "es2015.symbol", "es2015.iterable"]
83
84 target = jstarget
85 module = jsmodule
86 types = []
73 types = []
87 declaration = true
74 declaration = true
88 listFiles = true
75 listFiles = true
89
90 }
76 }
91 tscCmd = "$projectDir/node_modules/.bin/tsc"
77 tscCmd = "$projectDir/node_modules/.bin/tsc"
92 tsLintCmd = "$projectDir/node_modules/.bin/tslint"
78 tsLintCmd = "$projectDir/node_modules/.bin/tslint"
@@ -94,13 +80,19 typescript {
94 npmCmd = "npm"
80 npmCmd = "npm"
95 }
81 }
96
82
83 task prepare {
84
85 }
86
97 task printVersion {
87 task printVersion {
88 dependsOn prepare
89
98 doLast {
90 doLast {
99 println "version: $version";
91 println "version: ${-> version}";
100 println "tagDistance: $tagDistance";
92 println "tagDistance: ${-> tagDistance}";
101 println "packageName: $packageName";
93 println "packageName: ${-> packageName}";
102 println "target: $jstarget";
94 println "target: ${-> typescript.compilerOptions.target}";
103 println "module: $jsmodule";
95 println "module: ${-> typescript.compilerOptions.module}";
104 }
96 }
105 }
97 }
106
98
@@ -116,11 +108,12 npmPackMeta {
116 }
108 }
117 }
109 }
118
110
119 compileTsAmd {
111 configureTsCjs {
120 dependsOn sources.main.output
112 dependsOn sources.main.output
121 }
113 }
122
114
123 configureTsAmd {
115 configureTsAmd {
116 dependsOn sources.main.output
124 compilerOptions {
117 compilerOptions {
125 types += [ "requirejs", "dojo-typings" ]
118 types += [ "requirejs", "dojo-typings" ]
126 }
119 }
@@ -131,12 +124,71 test {
131 commandLine "node", "tests/index.js"
124 commandLine "node", "tests/index.js"
132 }
125 }
133
126
134 assembleTest {
127 task assembleTestAmd {
135 dependsOn sources.main.output
136 dependsOn sources.amd.output
128 dependsOn sources.amd.output
137 dependsOn sources.testAmd.output
129 dependsOn sources.testAmd.output
138
130
139 from(sources.main.output.compiledDir)
131 doLast {
132 assembleTest {
140 from(sources.amd.output.compiledDir)
133 from(sources.amd.output.compiledDir)
141 from(sources.testAmd.output.compiledDir)
134 from(sources.testAmd.output.compiledDir)
135 }
136 }
137 }
138
139 assembleTest {
140 mustRunAfter assembleTestAmd
141 dependsOn sources.main.output
142 from(sources.main.output.compiledDir)
143 }
144
145
146
147 task prepareTargetEs5 {
148 doLast {
149 typescript {
150 compilerOptions {
151 target = "es5"
152 lib = ["es5", "dom", "scripthost", "es2015.promise", "es2015.symbol", "es2015.iterable"]
153 }
154 }
155 }
156 }
157
158 task prepareTargetEsNext {
159 doLast {
160 typescript {
161 compilerOptions {
162 target = "esnext"
163 lib = ["esnext", "dom", "scripthost"]
164 }
165 }
166 }
167 }
168
169 task prepareNode {
170 dependsOn prepareTargetEsNext
171 doLast {
172 typescript {
173 compilerOptions {
174 target = "esnext"
175 module = "commonjs"
176 }
177 }
178 }
179 }
180
181 task prepareBrowser {
182 dependsOn prepareTargetEs5
183 doLast {
184 typescript {
185 compilerOptions {
186 module = "requirejs"
187 }
188 }
189 }
190 }
191
192 prepare {
193 mustRunAfter prepareNode, prepareBrowser
142 } No newline at end of file
194 }
@@ -1,7 +1,5
1 version=
1 version=
2 author=Implab team
2 author=Implab team
3 jsmodule=amd
4 target=es5
5 description=Dependency injection, logging, simple and fast text template engine
3 description=Dependency injection, logging, simple and fast text template engine
6 license=BSD-2-Clause
4 license=BSD-2-Clause
7 repository=https://bitbucket.org/implab/implabjs-core
5 repository=https://bitbucket.org/implab/implabjs-core
General Comments 0
You need to be logged in to leave comments. Login now