Add support for Android D8 (8.1.56) (#5756)

Adds D8Compiler, which applies to the Android Java and Android Kotlin
languages. D8Compiler instantiates a JavaCompiler or KotlinCompiler
using the java/kotlin dependencies' paths for D8 in the infra repo.

compiler-finder.ts has been updated to allow for duplicate compiler IDs
for 'android-java' and 'android-kotlin', as it is expected that the
compilers used for these languages is the same.
This commit is contained in:
kevinjeon-g
2023-12-04 20:35:56 -05:00
committed by GitHub
parent 4d75c35a3c
commit 7efe253f5f
15 changed files with 384 additions and 4 deletions

10
app.ts
View File

@@ -73,6 +73,9 @@ import type {Language, LanguageKey} from './types/languages.interfaces.js';
// Used by assert.ts
global.ce_base_directory = new URL('.', import.meta.url);
// Used by d8.ts
global.handlerConfig = null;
(nopt as any).invalidHandler = (key, val, types) => {
logger.error(
`Command line argument type error for "--${key}=${val}", expected ${types.map(t => typeof t).join(' | ')}`,
@@ -562,7 +565,8 @@ async function main() {
const healthCheckFilePath = ceProps('healthCheckFilePath', false);
const handlerConfig = {
// Exported to allow compilers to refer to other existing compilers.
global.handlerConfig = {
compileHandler,
clientOptionsHandler,
storageHandler,
@@ -575,8 +579,8 @@ async function main() {
contentPolicyHeader,
};
const noscriptHandler = new NoScriptHandler(router, handlerConfig);
const routeApi = new RouteAPI(router, handlerConfig);
const noscriptHandler = new NoScriptHandler(router, global.handlerConfig);
const routeApi = new RouteAPI(router, global.handlerConfig);
async function onCompilerChange(compilers) {
if (JSON.stringify(prevCompilers) === JSON.stringify(compilers)) {