From 65eb82ba971186d8758262b248dfa51db7891ea9 Mon Sep 17 00:00:00 2001 From: Ted Xie Date: Fri, 5 Apr 2024 08:14:21 -0700 Subject: [PATCH] Handle desugared_lib_config in src/tools/ak/dex Part of #122 PiperOrigin-RevId: 622183260 Change-Id: Iaa4ad14faa99acd0743a8e1d5387401a916c44b9 --- src/tools/ak/dex/dex.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tools/ak/dex/dex.go b/src/tools/ak/dex/dex.go index 3d3b2ee3d..7e688bdb3 100644 --- a/src/tools/ak/dex/dex.go +++ b/src/tools/ak/dex/dex.go @@ -61,6 +61,7 @@ var ( desugar, androidJar, dexbuilder, in string classpaths, outs, outputDir flags.StringList desugarCoreLibs bool + desugaredLibConfig string minSdkVersion int initOnce sync.Once @@ -73,6 +74,7 @@ func Init() { flag.StringVar(&androidJar, "android_jar", "", "Required for desugar, path to android.jar") flag.Var(&classpaths, "classpath", "(Optional) Path to library resource(s) for desugar") flag.BoolVar(&desugarCoreLibs, "desugar_core_libs", false, "Desugar Java 8 core libs, default false") + flag.StringVar(&desugaredLibConfig, "desugared_lib_config", "", "Path to desugared lib config") flag.StringVar(&dexbuilder, "dexbuilder", "", "Path to dexbuilder") flag.StringVar(&in, "in", "", "Path to input") flag.Var(&outs, "out", "Path to output, if more than one specified, output is sharded across files.") @@ -185,6 +187,10 @@ func desugarJar(in, out string) error { } if desugarCoreLibs { args = append(args, "--desugar_supported_core_libs") + + if desugaredLibConfig != "" { + args = append(args, "--desugared_lib_config", desugaredLibConfig) + } } for _, cp := range classpaths { args = append(args, "--classpath_entry", cp)