(
compiler: string,
options: string[],
inputFilename: string,
execOptions: ExecutionOptionsWithEnv,
filters?: ParseFiltersAndOutputOptions,
)
| 91 | } |
| 92 | |
| 93 | override async runCompiler( |
| 94 | compiler: string, |
| 95 | options: string[], |
| 96 | inputFilename: string, |
| 97 | execOptions: ExecutionOptionsWithEnv, |
| 98 | filters?: ParseFiltersAndOutputOptions, |
| 99 | ): Promise<CompilationResult> { |
| 100 | const preliminaryCompilePath = path.dirname(inputFilename); |
| 101 | let outputFilename = ''; |
| 102 | let initialResult: CompilationResult | null = null; |
| 103 | |
| 104 | const javaCompiler = this.env.findCompiler('java', this.javaId) as JavaCompiler | undefined; |
| 105 | if (!javaCompiler) { |
| 106 | return { |
| 107 | ...this.handleUserError( |
| 108 | {message: `Compiler ${this.lang.id} ${this.javaId} not configured correctly`}, |
| 109 | '', |
| 110 | ), |
| 111 | timedOut: false, |
| 112 | }; |
| 113 | } |
| 114 | |
| 115 | // Instantiate Java or Kotlin compiler based on the current language. |
| 116 | if (this.lang.id === 'android-java') { |
| 117 | outputFilename = javaCompiler.getOutputFilename(preliminaryCompilePath); |
| 118 | const javaOptions = _.compact( |
| 119 | javaCompiler.prepareArguments( |
| 120 | this.getClasspathArgument(), |
| 121 | javaCompiler.getDefaultFilters(), |
| 122 | {}, // backendOptions |
| 123 | inputFilename, |
| 124 | outputFilename, |
| 125 | [], // libraries |
| 126 | [], // overrides |
| 127 | ), |
| 128 | ); |
| 129 | initialResult = await javaCompiler.runCompiler( |
| 130 | javaCompiler.getInfo().exe, |
| 131 | javaOptions, |
| 132 | this.filename(inputFilename), |
| 133 | javaCompiler.getDefaultExecOptions(), |
| 134 | ); |
| 135 | } else if (this.lang.id === 'android-kotlin') { |
| 136 | const kotlinCompiler = unwrap(this.env.findCompiler('kotlin', this.kotlinId)) as KotlinCompiler; |
| 137 | outputFilename = kotlinCompiler.getOutputFilename(preliminaryCompilePath); |
| 138 | const kotlinOptions = _.compact( |
| 139 | kotlinCompiler.prepareArguments( |
| 140 | this.getClasspathArgument(), |
| 141 | kotlinCompiler.getDefaultFilters(), |
| 142 | {}, // backendOptions |
| 143 | inputFilename, |
| 144 | outputFilename, |
| 145 | [], // libraries |
| 146 | [], // overrides |
| 147 | ), |
| 148 | ); |
| 149 | initialResult = await kotlinCompiler.runCompiler( |
| 150 | kotlinCompiler.getInfo().exe, |
nothing calls this directly
no test coverage detected