gpt4 book ai didi

java - 闭包编译器 : create_name_map_files from Java API

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:07:14 26 4
gpt4 key购买 nike

从命令行我可以获得从 compiler.jar 重命名的函数的别名列表

帮助说:

java -jar compiler.jar --help
[...]
--create_name_map_files : If true, variable renaming and
property renaming map files will be
produced as {binary name}_vars_map.out
and {binary name}_props_map.out. Note
that this flag cannot be used in
conjunction with either variableMapOut
putFile or property_map_output_file
--create_source_map VAL : If specified, a source map file
mapping the generated source files
back to the original source file will
be output to the specified path. The
%outname% placeholder will expand to
the name of the output file that the
source map corresponds to.
[...]

那么,如何从内联 java 中获取“create_name_map_files”?我查看了 AbstractCommandLineRunner.java,但与此命令行选项相关的所有类/方法都是私有(private)的,无法从我的代码中访问。

我的代码:

CompilerOptions opt = new CompilerOptions();

// decide mode
compilationLevel.ADVANCED_OPTIMIZATIONS.setOptionsForCompilationLevel(opt);
opt.prettyPrint = false;

Compiler.setLoggingLevel(Level.OFF);

Compiler compressor = new Compiler();
compressor.disableThreads();

List<SourceFile> inputs = ...;
List<SourceFile> externs = ...;

compressor.compile(externs, inputs, opt);

最佳答案

您可以只使用选项:variable_map_output_file filename, Prop 也是如此。

请注意:标志 variable_map_output_file 和 create_name_map_files 不能同时使用。

关于java - 闭包编译器 : create_name_map_files from Java API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19875654/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com