@@ -14,6 +14,15 @@ def cachedJarsFilePath = "$projectDir/cached.txt"
14
14
def jsParserP = " $projectDir /parser/js_parser.js"
15
15
def jsFilesParametersP = " $projectDir /jsFilesParameters.txt"
16
16
17
+ def webpackWorkersExcludePath = " $projectDir /../../src/main/assets/app/__worker-chunks.json"
18
+ def webpackWorkersExcludesList;
19
+
20
+ def workersExcludeFile = file(webpackWorkersExcludePath);
21
+ def filterWorkerFiles = false ;
22
+ if (workersExcludeFile. exists()) {
23
+ filterWorkerFiles = true ;
24
+ webpackWorkersExcludesList = new JsonSlurper (). parseText(workersExcludeFile. text)
25
+ }
17
26
18
27
19
28
// def absoluteOutDir = new File("./outDir")//project.outDir
@@ -113,10 +122,17 @@ traverseDirectory = { dir, traverseExplicitly ->
113
122
}
114
123
115
124
currentDir. eachFile(FileType . FILES ) { File f ->
116
- def file = f. getAbsolutePath();
117
- if (file. substring(file. length() - 3 , file. length()). equals(" .js" )) {
118
- logger. info(" Task: traverseDirectory: Visiting JavaScript file: " + f. getName())
119
- inputJsFiles. add(f. getAbsolutePath())
125
+ def currFile = f. getAbsolutePath();
126
+ if (currFile. substring(currFile. length() - 3 , currFile. length()). equals(" .js" )) {
127
+ // Read __worker-chunks.json file containing a list of webpacked workers
128
+ // ignore worker scripts, so as to not attempt to generate bindings for them
129
+ if (filterWorkerFiles) {
130
+ if (webpackWorkersExcludesList. any{element -> file(element). getAbsolutePath() == currFile}) {
131
+ return
132
+ }
133
+ }
134
+
135
+ inputJsFiles. add(currFile)
120
136
}
121
137
}
122
138
0 commit comments