Skip to content

Commit

Permalink
synchronize decompiler args with paperweight
Browse files Browse the repository at this point in the history
  • Loading branch information
Machine-Maker committed Apr 20, 2024
1 parent b497948 commit 3c65a50
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,33 +37,43 @@ open class MacheExtension(objects: ObjectFactory) {
init {
decompilerArgs.convention(
listOf(
// Synthetic Not Set: Treat some known structures as synthetic even when not explicitly set
"-nns=true",
// Ternary Constant Simplification:
// Treat some known structures as synthetic even when not explicitly set
"--synthetic-not-set=true",
// Fold branches of ternary expressions that have boolean true and false constants
"-tcs=true",
// Override Annotation: Display override annotations for methods known to the decompiler
"-ovr=false",
// [Experimental] Verify Variable Merges:
// Double checks to make sure the validity of variable merges
"-vvm=true",
// Include Entire Classpath: Give the decompiler information about every jar on the classpath
"-iec=true",
// Include Java Runtime: Give the decompiler information about the Java runtime
"-jrt=current",
// Indent String
"-ind= ",
// JAD-Style Variable Naming: Use JAD-style variable naming for local variables
"-jvn=false",
"--ternary-constant-simplification=true",
// Give the decompiler information about the Java runtime
"--include-runtime=current",
// Decompile complex constant-dynamic expressions:
// Some constant-dynamic expressions can't be converted to a single Java expression with
// identical run-time behaviour. This decompiles them to a similar non-lazy expression,
// marked with a comment
"-dcc=true",
// Skip Extra Files: Skip copying non-class files from the input folder or file to the output
"-sef=true",
// New Line Seperator: Character that seperates lines in the decompiled output.
"-nls=1",
"--decompile-complex-constant-dynamic=true",
// Indent String
"--indent-string= ",
// Process inner classes and add them to the decompiled output.
"--decompile-inner=true", // default
// Removes any methods that are marked as bridge from the decompiled output.
"--remove-bridge=true", // default
// Decompile generics in classes, methods, fields, and variables.
"--decompile-generics=true", // default
// Encode non-ASCII characters in string and character literals as Unicode escapes.
"--ascii-strings=false", // default
// Removes any methods and fields that are marked as synthetic from the decompiled output.
"--remove-synthetic=true", // default
// Give the decompiler information about every jar on the classpath.
"--include-classpath=true",
// Remove braces on simple, one line, lambda expressions.
"--inline-simple-lambdas=true", // default
// Ignore bytecode that is malformed.
"--ignore-invalid-bytecode=false", // default
// Map Bytecode to source lines.
"--bytecode-source-mapping=true",
// Dump line mappings to output archive zip entry extra data.
"--dump-code-lines=true",
// Display override annotations for methods known to the decompiler
"--override-annotation=false",
// Skip copying non-class files from the input folder or file to the output
"--skip-extra-files=true",
),
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ abstract class DecompileJar : DefaultTask() {
val cfgFile = layout.buildDirectory.file(DECOMP_CFG).convertToPath().ensureClean()
val cfgText = buildString {
for (file in minecraftClasspath.files) {
append("-e=")
append("--add-external=")
append(file.toPath().absolutePathString())
append(System.lineSeparator())
}
Expand Down

0 comments on commit 3c65a50

Please sign in to comment.