@@ -36,12 +36,15 @@ import org.gradle.api.GradleException
36
36
import org.gradle.api.file.CopySpec
37
37
import org.gradle.api.provider.ListProperty
38
38
import org.gradle.api.tasks.CacheableTask
39
+ import org.gradle.api.tasks.Input
39
40
import org.gradle.api.tasks.InputDirectory
40
41
import org.gradle.api.tasks.InputFile
41
42
import org.gradle.api.tasks.Internal
42
43
import org.gradle.api.tasks.Optional
43
44
import org.gradle.api.tasks.OutputDirectory
44
45
import org.gradle.api.tasks.OutputFile
46
+ import org.gradle.api.tasks.PathSensitive
47
+ import org.gradle.api.tasks.PathSensitivity
45
48
import org.gradle.api.tasks.TaskAction
46
49
import org.gradle.api.tasks.options.Option
47
50
import org.gradle.internal.hash.HashUtil
@@ -88,12 +91,12 @@ class TranspileDependenciesTask extends DefaultTask {
88
91
private static final String RUN_WITH_INFO_FOR_MORE_INFORMATION = ' Run with --info to get more information.'
89
92
private static final String VAADIN_FLOW_PACKAGE = ' com.vaadin.flow'
90
93
91
- final File workingDir = project. file(VaadinClientDependenciesExtension . FRONTEND_BUILD_DIR )
92
- final VaadinYarnRunner yarnRunner = new VaadinYarnRunner (project, workingDir)
93
- final File srcDir = new File (workingDir, ' src' )
94
- final File webappGenDir = new File (project. buildDir, ' webapp-gen' )
95
- final File webappGenFrontendDir = new File (webappGenDir, FRONTEND )
96
- final Closure<File > configDir = {
94
+ protected final File workingDir = project. file(VaadinClientDependenciesExtension . FRONTEND_BUILD_DIR )
95
+ protected final VaadinYarnRunner yarnRunner = new VaadinYarnRunner (project, workingDir)
96
+ protected final File srcDir = new File (workingDir, ' src' )
97
+ protected final File webappGenDir = new File (project. buildDir, ' webapp-gen' )
98
+ protected final File webappGenFrontendDir = new File (webappGenDir, FRONTEND )
99
+ protected final Closure<File > configDir = {
97
100
File rootDir = SpringBootAction . isActive(project) ? webappGenDir :
98
101
Paths . get(project. buildDir. canonicalPath, ' resources' , ' main' ). toFile()
99
102
Paths . get(rootDir. canonicalPath, ' META-INF' , VAADIN , ' config' ). toFile()
@@ -109,20 +112,23 @@ class TranspileDependenciesTask extends DefaultTask {
109
112
@Deprecated
110
113
@Optional
111
114
@InputDirectory
115
+ @PathSensitive (PathSensitivity .ABSOLUTE )
112
116
final Closure<File > webappGenFrontendStylesDir = {
113
117
new File (webappGenFrontendDir, STYLES ). with { it. exists() ? it : null }
114
118
}
115
119
116
120
@Deprecated
117
121
@Optional
118
122
@InputDirectory
123
+ @PathSensitive (PathSensitivity .ABSOLUTE )
119
124
final Closure<File > webappGenFrontendTemplatesDir = {
120
125
new File (webappGenFrontendDir, TEMPLATES ). with { it. exists() ? it : null }
121
126
}
122
127
123
128
@Deprecated
124
129
@Optional
125
130
@InputDirectory
131
+ @PathSensitive (PathSensitivity .ABSOLUTE )
126
132
final Closure<File > webTemplatesDir = {
127
133
AssembleClientDependenciesTask assembleTask = project. tasks. findByName(AssembleClientDependenciesTask . NAME )
128
134
Paths . get(assembleTask. webappDir. canonicalPath, FRONTEND , TEMPLATES ). toFile(). with { it. exists() ? it : null }
@@ -131,12 +137,14 @@ class TranspileDependenciesTask extends DefaultTask {
131
137
@Deprecated
132
138
@Optional
133
139
@InputDirectory
140
+ @PathSensitive (PathSensitivity .ABSOLUTE )
134
141
final Closure<File > webStylesDir = {
135
142
AssembleClientDependenciesTask assembleTask = project. tasks. findByName(AssembleClientDependenciesTask . NAME )
136
143
Paths . get(assembleTask. webappDir. canonicalPath, FRONTEND , STYLES ). toFile(). with { it. exists() ? it : null }
137
144
}
138
145
139
146
@InputDirectory
147
+ @PathSensitive (PathSensitivity .ABSOLUTE )
140
148
final File nodeModules = new File (workingDir, NODE_MODULES )
141
149
142
150
@Optional
@@ -149,18 +157,21 @@ class TranspileDependenciesTask extends DefaultTask {
149
157
@Deprecated
150
158
@Optional
151
159
@InputDirectory
160
+ @PathSensitive (PathSensitivity .ABSOLUTE )
152
161
final Closure<File > bowerComponents = {
153
162
new File (workingDir, BOWER_COMPONENTS ). with { it. exists() ? it : null }
154
163
}
155
164
156
165
@Optional
157
166
@InputDirectory
167
+ @PathSensitive (PathSensitivity .ABSOLUTE )
158
168
final Closure<File > unpackedStaticResources = {
159
169
new File (workingDir, ' static' ). with { it. exists() ? it : null }
160
170
}
161
171
162
172
@Optional
163
173
@InputDirectory
174
+ @PathSensitive (PathSensitivity .ABSOLUTE )
164
175
final Closure<File > stylesheetsSources = {
165
176
Paths . get(project. projectDir. canonicalPath,
166
177
JavaPluginAction . STYLESHEETS_SOURCES . split(SLASH ))
@@ -169,13 +180,15 @@ class TranspileDependenciesTask extends DefaultTask {
169
180
170
181
@Optional
171
182
@InputDirectory
183
+ @PathSensitive (PathSensitivity .ABSOLUTE )
172
184
final Closure<File > javascriptSources = {
173
185
Paths . get(project. projectDir. canonicalPath,
174
186
JavaPluginAction . JAVASCRIPT_SOURCES . split(SLASH ))
175
187
.toFile(). with { it. exists() ? it : null }
176
188
}
177
189
178
190
@InputFile
191
+ @PathSensitive (PathSensitivity .ABSOLUTE )
179
192
final File packageJson = new File (workingDir, PACKAGE_JSON_FILE )
180
193
181
194
@Optional
@@ -286,7 +299,6 @@ class TranspileDependenciesTask extends DefaultTask {
286
299
}
287
300
}
288
301
289
- @Internal
290
302
@PackageScope
291
303
void bundle (ScanResult scan ) {
292
304
@@ -384,7 +396,6 @@ class TranspileDependenciesTask extends DefaultTask {
384
396
}
385
397
}
386
398
387
- @Internal
388
399
@PackageScope
389
400
void checkIdUsage (ScanResult scan ) {
390
401
if (! ignoreIdUsage) {
@@ -400,7 +411,6 @@ class TranspileDependenciesTask extends DefaultTask {
400
411
}
401
412
}
402
413
403
- @Internal
404
414
@PackageScope
405
415
void checkJsModulesInCompatibilityMode (ScanResult scan ) {
406
416
Map<String ,String > modules = ClassIntrospectionUtils
@@ -416,7 +426,6 @@ class TranspileDependenciesTask extends DefaultTask {
416
426
}
417
427
}
418
428
419
- @Internal
420
429
@PackageScope
421
430
void checkCssImportsInCompatibilityMode (ScanResult scan ) {
422
431
Map<String ,String > imports = ClassIntrospectionUtils
@@ -505,7 +514,6 @@ class TranspileDependenciesTask extends DefaultTask {
505
514
}
506
515
}
507
516
508
- @Internal
509
517
@PackageScope
510
518
void bundleInCompatibilityMode (ScanResult scan ) {
511
519
LOGGER . info(' Searching for HTML imports...' )
@@ -570,6 +578,7 @@ class TranspileDependenciesTask extends DefaultTask {
570
578
* @deprecated since 1.3 in favour of importExcludes
571
579
*/
572
580
@Deprecated
581
+ @Internal
573
582
List<String > getBundleExcludes () {
574
583
VaadinFlowPluginExtension vaadin = project. extensions. getByType(VaadinFlowPluginExtension )
575
584
if (vaadin. compatibilityMode) {
@@ -581,6 +590,7 @@ class TranspileDependenciesTask extends DefaultTask {
581
590
/**
582
591
* Get import exclusions
583
592
*/
593
+ @Input
584
594
List<String > getImportExcludes () {
585
595
importExcludes. getOrElse([])
586
596
}
0 commit comments