| @@ -1,5 +1,5 | |||
|
|
1 | 1 | plugins { |
|
|
2 |
id "org.implab.gradle-typescript" version "1. |
|
|
|
2 | id "org.implab.gradle-typescript" version "1.1.0" | |
|
|
3 | 3 | id "org.implab.gradle-hg" |
|
|
4 | 4 | id "ivy-publish" |
|
|
5 | 5 | } |
| @@ -12,7 +12,7 if (!flavour in ['browser', 'node']) | |||
|
|
12 | 12 | |
|
|
13 | 13 | ext { |
|
|
14 | 14 | packageName = flavour == 'browser' ? "@$npmScope/$name-amd" : "@$npmScope/$name" |
|
|
15 | lint = project.hasProperty('lint') ? project.lint : false | |
|
|
15 | lint = project.hasProperty('lint') ? project.lint ?: true : false | |
|
|
16 | 16 | } |
|
|
17 | 17 | |
|
|
18 | 18 | sources { |
| @@ -68,7 +68,10 typescript { | |||
|
|
68 | 68 | tscCmd = "$projectDir/node_modules/.bin/tsc" |
|
|
69 | 69 | tsLintCmd = "$projectDir/node_modules/.bin/tslint" |
|
|
70 | 70 | esLintCmd = "$projectDir/node_modules/.bin/eslint" |
|
|
71 | npmCmd = "npm" | |
|
|
71 | } | |
|
|
72 | ||
|
|
73 | npm { | |
|
|
74 | npmCmd = "npm" | |
|
|
72 | 75 | } |
|
|
73 | 76 | |
|
|
74 | 77 | tasks.matching{ it.name =~ /^lint/ }.configureEach { |
| @@ -85,13 +88,13 if (symbols == 'local') { | |||
|
|
85 | 88 | |
|
|
86 | 89 | task printVersion { |
|
|
87 | 90 | doLast { |
|
|
88 |
println "packageName: $ |
|
|
|
89 |
println "version: $ |
|
|
|
90 |
println "flavour: $ |
|
|
|
91 |
println "target: $ |
|
|
|
92 |
println "module: $ |
|
|
|
93 |
println "lint: $ |
|
|
|
94 |
println "symbols: $ |
|
|
|
91 | println "packageName: $packageName"; | |
|
|
92 | println "version: $version"; | |
|
|
93 | println "flavour: $flavour"; | |
|
|
94 | println "target: $typescript.compilerOptions.target"; | |
|
|
95 | println "module: $typescript.compilerOptions.module"; | |
|
|
96 | println "lint: $lint"; | |
|
|
97 | println "symbols: $symbols"; | |
|
|
95 | 98 | } |
|
|
96 | 99 | } |
|
|
97 | 100 | |
| @@ -130,10 +133,12 assemble { | |||
|
|
130 | 133 | if (flavour == 'browser') { |
|
|
131 | 134 | dependsOn sources.amd.output |
|
|
132 | 135 | from sources.amd.output.compiledDir |
|
|
136 | from sources.amd.resources | |
|
|
133 | 137 | } |
|
|
134 | 138 | if (flavour == 'node') { |
|
|
135 | 139 | dependsOn sources.cjs.output |
|
|
136 | 140 | from sources.cjs.output.compiledDir |
|
|
141 | from sources.cjs.resources | |
|
|
137 | 142 | } |
|
|
138 | 143 | } |
|
|
139 | 144 | |
| @@ -143,17 +148,32 assembleTest { | |||
|
|
143 | 148 | |
|
|
144 | 149 | from sources.amd.output.compiledDir |
|
|
145 | 150 | from sources.testAmd.output.compiledDir |
|
|
151 | from sources.amd.resources | |
|
|
152 | from sources.testAmd.resources | |
|
|
146 | 153 | } |
|
|
147 | 154 | if (flavour == 'node') { |
|
|
148 | 155 | dependsOn sources.cjs.output, sources.testCjs.output |
|
|
149 | 156 | |
|
|
150 | 157 | from sources.cjs.output.compiledDir |
|
|
151 | 158 | from sources.testCjs.output.compiledDir |
|
|
159 | from sources.cjs.resources | |
|
|
160 | from sources.testCjs.resources | |
|
|
161 | } | |
|
|
162 | } | |
|
|
163 | ||
|
|
164 | typings { | |
|
|
165 | if (flavour == 'browser') { | |
|
|
166 | dependsOn sources.amd.output | |
|
|
167 | from sources.amd.output.typingsDir | |
|
|
168 | } | |
|
|
169 | if (flavour == 'node') { | |
|
|
170 | dependsOn sources.cjs.output | |
|
|
171 | from sources.cjs.output.typingsDir | |
|
|
152 | 172 | } |
|
|
153 | 173 | } |
|
|
154 | 174 | |
|
|
155 | 175 | task npmPackTypings(type: Copy) { |
|
|
156 | npmPack.dependsOn it | |
|
|
176 | npmPackContents.dependsOn it | |
|
|
157 | 177 | dependsOn sources.main.output |
|
|
158 | 178 | |
|
|
159 | 179 | from sources.main.output.typingsDir |
| @@ -167,11 +187,14 task npmPackTypings(type: Copy) { | |||
|
|
167 | 187 | from sources.cjs.output.typingsDir |
|
|
168 | 188 | } |
|
|
169 | 189 | |
|
|
170 | into "${->buildDir}/npm/pack" | |
|
|
190 | into npm.packageDir | |
|
|
171 | 191 | } |
|
|
172 | 192 | |
|
|
173 | 193 | task npmPackSources(type: Copy) { |
|
|
174 | 194 | from sources.main.ts |
|
|
195 | if (symbols == 'pack') { | |
|
|
196 | npmPackContents.dependsOn npmPackSources | |
|
|
197 | } | |
|
|
175 | 198 | |
|
|
176 | 199 | if (flavour == 'browser') { |
|
|
177 | 200 | from sources.amd.ts |
| @@ -180,14 +203,10 task npmPackSources(type: Copy) { | |||
|
|
180 | 203 | from sources.cjs.ts |
|
|
181 | 204 | } |
|
|
182 | 205 | |
|
|
183 | into "${->buildDir}/npm/pack/_src" | |
|
|
206 | into npm.packageDir.dir("_src") | |
|
|
184 | 207 | } |
|
|
185 | 208 | |
|
|
186 | if (symbols == 'pack') { | |
|
|
187 | npmPack { | |
|
|
188 | dependsOn npmPackSources | |
|
|
189 | } | |
|
|
190 | } | |
|
|
209 | ||
|
|
191 | 210 | |
|
|
192 | 211 | task packJsTar(type: Tar) { |
|
|
193 | 212 | dependsOn assemble; |
General Comments 0
You need to be logged in to leave comments.
Login now
