Class Decompile

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
org.gradle.api.internal.ConventionTask
org.gradle.api.tasks.JavaExec
All Implemented Interfaces:
Comparable<org.gradle.api.Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.IConventionAware, org.gradle.api.internal.TaskInternal, org.gradle.api.Named, org.gradle.api.plugins.ExtensionAware, org.gradle.api.Task, org.gradle.process.BaseExecSpec, org.gradle.process.JavaExecSpec, org.gradle.process.JavaForkOptions, org.gradle.process.ProcessForkOptions, org.gradle.util.Configurable<org.gradle.api.Task>

@CacheableTask public abstract class Decompile extends MavenJarExec
Runs the Cleanflower decompiler. Decompiler options are passed as free-form key/value pairs through getOptions() rather than dedicated properties, since the tool can be swapped out and each tool version (may) define its own option set.

The default tool is com.cleanroommc:cleanflower:1.0.0, resolved through the decompiler configuration. Adding a dependency to that configuration replaces the default. The option names documented on getOptions() is the cleanflower v1.0.0 option set.

  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.gradle.api.Named

    org.gradle.api.Named.Namer
  • Field Summary

    Fields inherited from interface org.gradle.api.Task

    TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    abstract org.gradle.api.file.RegularFileProperty
     
    abstract org.gradle.api.file.RegularFileProperty
     
    abstract org.gradle.api.provider.ListProperty<String>
    Additional raw decompiler arguments, appended after getOptions()
    abstract org.gradle.api.file.ConfigurableFileCollection
     
    abstract org.gradle.api.provider.ListProperty<String>
    -only=<prefix>: only decompile classes matching these prefixes
    abstract org.gradle.api.provider.MapProperty<String,Object>
    Decompiler options, rendered as --<key>=<value> arguments in insertion order.
    abstract org.gradle.api.provider.Property<Boolean>
    --silent: suppress the decompiler's console output

    Methods inherited from class org.gradle.api.tasks.JavaExec

    bootstrapClasspath, classpath, copyTo, copyTo, debugOptions, executable, getAllJvmArgs, getArgs, getArgumentProviders, getBootstrapClasspath, getClasspath, getCommandLine, getDebug, getDebugOptions, getDefaultCharacterEncoding, getEnableAssertions, getEnvironment, getErrorOutput, getExecActionFactory, getExecutable, getExecutionResult, getJavaLauncher, getJavaToolchainService, getJavaVersion, getJvmArgs, getJvmArgumentProviders, getJvmArguments, getMainClass, getMainModule, getMaxHeapSize, getMinHeapSize, getModularity, getObjectFactory, getPropertyFactory, getProviderFactory, getStandardInput, getStandardOutput, getSystemProperties, getWorkingDir, isIgnoreExitValue, setAllJvmArgs, setArgs, setArgsString, setBootstrapClasspath, setClasspath, setDebug, setDefaultCharacterEncoding, setEnableAssertions, setErrorOutput, setExecutable, setExecutable, setIgnoreExitValue, setJvmArgs, setMaxHeapSize, setMinHeapSize, setStandardInput, setStandardOutput, setWorkingDir, setWorkingDir, workingDir

    Methods inherited from class org.gradle.api.internal.ConventionTask

    conventionMapping, conventionMapping, getConventionMapping

    Methods inherited from class org.gradle.api.DefaultTask

    compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService

    Methods inherited from class org.gradle.api.internal.AbstractTask

    acceptServiceReferences, appendParallelSafeAction, doNotTrackState, doNotTrackStateIf, getAsDynamicObject, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonsNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, restoreOnlyIf, restoreTaskActions, setImpliesSubProjects

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.gradle.api.Task

    doNotTrackState, notCompatibleWithConfigurationCache
  • Constructor Details

    • Decompile

      public Decompile()
  • Method Details

    • getCompiledJar

      @InputFile @PathSensitive(RELATIVE) public abstract org.gradle.api.file.RegularFileProperty getCompiledJar()
    • getLibraries

      @Optional @Classpath @InputFiles public abstract org.gradle.api.file.ConfigurableFileCollection getLibraries()
    • getOptions

      @Input public abstract org.gradle.api.provider.MapProperty<String,Object> getOptions()
      Decompiler options, rendered as --<key>=<value> arguments in insertion order. Booleans are rendered as 1/0; other values via toString(). Unset options fallback to the tool's own defaults. Values that only exist as bare flags (no =value form) belong in getExtraArgs() instead.

      Valid option keys for cleanflower v1.0.0. Overriding the tool through the decompiler configuration may void this list, consult the replacement tool's documentation instead.

      Core options:

      • remove-bridge: remove bridge methods from the output
      • remove-synthetic: remove synthetic methods and fields from the output
      • decompile-inner: process inner classes and add them to the output
      • decompile-java4: resugar the Java 1-4 class reference format
      • decompile-assert: decompile assert statements
      • hide-empty-super: hide super() calls with no parameters
      • hide-default-constructor: hide constructors with no parameters and no code
      • decompile-generics: decompile generics in classes, methods, fields and variables
      • incorporate-returns: integrate returns better in try-catch blocks
      • ensure-synchronized-monitors: deduce missing monitorexits for synchronized blocks
      • decompile-enums: decompile enums
      • decompile-preview: decompile preview/incubating Java features
      • remove-getclass: remove synthetic getClass() calls from obj.new Inner() constructs
      • keep-literals: keep NaN, infinities and pi values as is
      • boolean-as-int: represent integers 0 and 1 as booleans
      • ascii-strings: escape non-ASCII characters in string and character literals
      • synthetic-not-set: treat some known structures as synthetic even when not marked
      • undefined-as-object: treat nameless types as java.lang.Object
      • use-lvt-names: use LVT names for locals and parameters instead of var<index>_<version>
      • use-method-parameters: use names from the MethodParameters attribute
      • remove-empty-try-catch: remove try-catch blocks with no code
      • decompile-finally: decompile finally blocks
      • lambda-to-anonymous-class: decompile lambdas as anonymous classes
      • bytecode-source-mapping: map bytecode to source lines
      • dump-code-lines: dump line mappings to output archive zip entry extra data
      • ignore-invalid-bytecode: ignore malformed bytecode
      • verify-anonymous-classes: verify that anonymous classes are local
      • ternary-constant-simplification: fold ternary branches with boolean constants
      • pattern-matching: decompile with if and switch pattern matching
      • try-loop-fix: fix rare malformed decompilation of try blocks inside while loops
      • ternary-in-if: [experimental] collapse if statements with a ternary in their condition
      • decompile-switch-expressions: decompile switch expressions
      • show-hidden-statements: [debug] display hidden code blocks
      • override-annotation: display override annotations for methods known to the decompiler
      • simplify-stack: simplify variables across stack bounds to resugar complex statements
      • verify-merges: [experimental] verify the validity of variable merges harder
      • old-try-dedup: [experimental] use the old try deduplication algorithm
      • include-classpath: include the entire classpath when resolving references
      • include-runtime: '1' or 'current' for the current Java runtime, or a path to another runtime
      • explicit-generics: put explicit diamond generic arguments on method calls
      • inline-simple-lambdas: remove braces on simple one-line lambdas
      • log-level: one of 'info', 'debug', 'warn', 'error'
      • max-time-per-method: [deprecated] maximum time in seconds to process a method
      • rename-members: rename classes, fields and methods with a number suffix to help deobfuscation
      • user-renamer-class: path to a class implementing IIdentifierRenamer
      • new-line-separator: use \n line separators instead of the OS default
      • indent-string: indentation string
      • preferred-line-length: max line length before formatting is applied
      • banner: message to display at the top of each decompiled file
      • error-message: message to display when an error occurs in the decompiler
      • thread-count: decompilation thread count, -1 uses all available cores
      • skip-extra-files: skip copying non-class files to the output
      • warn-inconsistent-inner-attributes: warn about inconsistent inner class attributes
      • dump-bytecode-on-error: put the bytecode in the method body when an error occurs
      • dump-exception-on-error: put the exception message in the method body when an error occurs
      • decompiler-comments: add decompiler comments about odd bytecode or unfixable problems
      • sourcefile-comments: add debug comments showing the class SourceFile attribute
      • decompile-complex-constant-dynamic: decompile complex constant-dynamic expressions to a similar non-lazy expression
      • force-jsr-inline: force processing of JSR instructions even in Java 7+ class files
      • dump-text-tokens: dump text tokens on each class file
      • remove-imports: remove import statements from the decompiled code
      • mark-corresponding-synthetics: mark lambdas and anonymous/local classes with their synthetic constructs
      • excluded-classes: exclude classes whose fully qualified names match this regular expression
      • validate-inner-classes-names: skip inner classes whose names are not '$'-separated correctly

      Bundled plugin options:

      • kt-enable: enable the Kotlin plugin
      • kt-show-public: show public visibility in Kotlin output
      • kt-unknown-defaults: string to use for unknown Kotlin default arguments
      • kt-collapse-string-concat: collapse string concatenation in Kotlin output
      • variable-renaming: variable renamer to use (e.g. 'jad', 'tiny')
      • rename-parameters: rename parameters as well as locals
      • jad-style-variable-naming: use JAD-style variable naming
      • jad-style-parameter-naming: use JAD-style parameter naming
      • resugar-idea-notnull: resugar IntelliJ IDEA's @NotNull assertions
    • getOnlyClasses

      @Input @Optional public abstract org.gradle.api.provider.ListProperty<String> getOnlyClasses()
      -only=<prefix>: only decompile classes matching these prefixes
    • getSilent

      @Input @Optional public abstract org.gradle.api.provider.Property<Boolean> getSilent()
      --silent: suppress the decompiler's console output
    • getExtraArgs

      @Input public abstract org.gradle.api.provider.ListProperty<String> getExtraArgs()
      Additional raw decompiler arguments, appended after getOptions()
    • getDecompiledJar

      @OutputFile public abstract org.gradle.api.file.RegularFileProperty getDecompiledJar()
    • beforeExec

      protected void beforeExec()
      Overrides:
      beforeExec in class LazilyConstructedJavaExec