We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fun ZipFile.transform( output: OutputStream, entryFactory: (ZipEntry) -> ZipArchiveEntry = ::ZipArchiveEntry, transformer: (ByteArray) -> ByteArray = { it -> it } ) { val entries = mutableSetOf<String>() val creator = ParallelScatterZipCreator(ThreadPoolExecutor(NCPU, NCPU, 0L, TimeUnit.MILLISECONDS, LinkedBlockingQueue<Runnable>(), Executors.defaultThreadFactory(), RejectedExecutionHandler { runnable, _ -> runnable.run() })) entries().asSequence().filterNot { isJarSignatureRelatedFiles(it.name) }.forEach { entry -> if (!entries.contains(entry.name)) { val zae = entryFactory(entry) val stream = InputStreamSupplier { when (entry.name.substringAfterLast('.', "")) { "class" -> getInputStream(entry).use { src -> try { src.transform(transformer).inputStream() } catch (e: Throwable) { System.err.println("Broken class: ${this.name}!/${entry.name}") getInputStream(entry) } } else -> getInputStream(entry) } } creator.addArchiveEntry(zae, stream) entries.add(entry.name) } else { System.err.println("Duplicated jar entry: ${this.name}!/${entry.name}") } } ZipArchiveOutputStream(output).use(creator::writeTo) }
捕获了所有所有的transform阶段的所有异常,导致transform问题不会中断构建过程,只是在控制台输出 Broken class; 无法暴露编译期的存在的问题,以及无法看到原始异常堆栈(未打印错误堆栈),是否考虑取消catch 或者 仅catch部分异常,将原始异常 throw 出去
The text was updated successfully, but these errors were encountered:
可以具体说说遇到了什么问题吗?
Sorry, something went wrong.
就是我在tranaform方法中使用asm出现了问题,没办法直接在日志中看到异常的堆栈,因为被框架捕获了。
No branches or pull requests
捕获了所有所有的transform阶段的所有异常,导致transform问题不会中断构建过程,只是在控制台输出 Broken class;
无法暴露编译期的存在的问题,以及无法看到原始异常堆栈(未打印错误堆栈),是否考虑取消catch 或者 仅catch部分异常,将原始异常 throw 出去
The text was updated successfully, but these errors were encountered: