@@ -58,7 +58,7 @@ export class TypingsCommand implements ICommand {
5858 const gradleHome = path . resolve (
5959 process . env . GRADLE_USER_HOME ?? path . join ( homedir ( ) , `/.gradle` )
6060 ) ;
61- const gradleFiles = path . resolve ( gradleHome , "caches/modules-2/files-2.1/" ) ;
61+ const gradleFiles = this . $options . lookupPath ?? path . resolve ( gradleHome , "caches/modules-2/files-2.1/" ) ;
6262
6363 if ( ! this . $fs . exists ( gradleFiles ) ) {
6464 this . $logger . warn ( "No gradle files found" ) ;
@@ -160,21 +160,30 @@ export class TypingsCommand implements ICommand {
160160 path . resolve ( this . $projectData . projectDir , "typings" , "android" )
161161 ) ;
162162
163- const dtsGeneratorPath = path . resolve (
163+ const dtsGeneratorPath = this . $options . dtsGeneratorPath ?? path . resolve (
164164 this . $projectData . projectDir ,
165165 this . $projectData . getBuildRelativeDirectoryPath ( ) ,
166166 "android" ,
167167 "build-tools" ,
168168 "dts-generator.jar"
169169 ) ;
170170 if ( ! this . $fs . exists ( dtsGeneratorPath ) ) {
171- this . $logger . warn ( "No platforms folder found, preparing project now..." ) ;
172- await this . $childProcess . spawnFromEvent (
173- this . $hostInfo . isWindows ? "ns.cmd" : "ns" ,
174- [ "prepare" , "android" ] ,
175- "exit" ,
176- { stdio : "inherit" , shell : this . $hostInfo . isWindows }
177- ) ;
171+ if ( this . $options . dtsGeneratorPath ) {
172+ this . $logger . warn (
173+ [
174+ `dts-generator.jar not found at ${ this . $options . dtsGeneratorPath } used with --dtsGeneratorPath` ,
175+ ] . join ( "\n" )
176+ ) ;
177+ return false ;
178+ } else {
179+ this . $logger . warn ( "No platforms folder found, preparing project now..." ) ;
180+ await this . $childProcess . spawnFromEvent (
181+ this . $hostInfo . isWindows ? "ns.cmd" : "ns" ,
182+ [ "prepare" , "android" ] ,
183+ "exit" ,
184+ { stdio : "inherit" , shell : this . $hostInfo . isWindows }
185+ ) ;
186+ }
178187 }
179188
180189 const asArray = ( input : string | string [ ] ) => {
@@ -194,12 +203,13 @@ export class TypingsCommand implements ICommand {
194203 ...asArray ( this . $options . aar ) ,
195204 ...paths ,
196205 ] ;
197-
198206 await this . $childProcess . spawnFromEvent (
199207 "java" ,
200208 [
201209 "-jar" ,
202210 dtsGeneratorPath ,
211+ ...( this . $options . skipDeclarations ?[ "--skip-declarations" ] :[ ] ) ,
212+ ...( this . $options . super ?[ "-super" , this . $options . super ] :[ ] ) ,
203213 "-input" ,
204214 ...inputs ,
205215 "-output" ,
0 commit comments