Skip to content

Commit

Permalink
Configuration property to customize the directory where decompilation…
Browse files Browse the repository at this point in the history
… output gets stored
  • Loading branch information
yrodiere committed Sep 6, 2024
1 parent 8fe13b7 commit fd58e50
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,19 @@ public static JarType fromString(String value) {
@ConfigGroup
interface DecompilerConfig {
/**
* Enable decompilation of generated and transformed bytecode into the `decompiled` directory.
* Enable decompilation of generated and transformed bytecode into a filesystem.
*/
@WithDefault("false")
boolean enabled();

/**
* The directory into which to save the decompilation output.
* <p>
* A relative path is understood as relative to the build directory.
*/
@WithDefault("decompiler")
String outputDirectory();

/**
* The directory into which to save the decompilation tool if it doesn't exist locally.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ private JarBuildItem buildThinJar(CurateOutcomeBuildItem curateOutcomeBuildItem,
Decompiler decompiler = null;
PackageConfig.DecompilerConfig decompilerConfig = packageConfig.jar().decompiler();
if (decompilerConfig.enabled()) {
decompiledOutputDir = buildDir.getParent().resolve("decompiled");
decompiledOutputDir = buildDir.getParent().resolve(decompilerConfig.outputDirectory());
FileUtil.deleteDirectory(decompiledOutputDir);
Files.createDirectory(decompiledOutputDir);
decompiler = new Decompiler.VineflowerDecompiler();
Expand Down
1 change: 1 addition & 0 deletions docs/src/main/asciidoc/writing-extensions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2259,6 +2259,7 @@ Quarkus generates a lot of classes during the build phase and in many cases also
It is often extremely useful to see the generated bytecode and transformed classes during the development of an extension.

If you set the `quarkus.package.jar.decompiler.enabled` property to `true` then Quarkus will download and invoke the https://github.com/Vineflower/vineflower[Vineflower decompiler] and dump the result in the `decompiled` directory of the build tool output (`target/decompiled` for Maven for example).

Check warning on line 2261 in docs/src/main/asciidoc/writing-extensions.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.TermsWarnings] Consider using 'that is' rather than 'i.e.' unless updating existing content that uses the term. Raw Output: {"message": "[Quarkus.TermsWarnings] Consider using 'that is' rather than 'i.e.' unless updating existing content that uses the term.", "location": {"path": "docs/src/main/asciidoc/writing-extensions.adoc", "range": {"start": {"line": 2261, "column": 293}}}, "severity": "WARNING"}
The output directory can be changed with `quarkus.package.jar.decompiler.output-dir`.

NOTE: This property only works during a normal production build (i.e. not for dev mode/tests) and when `fast-jar` packaging type is used (the default behavior).

Check warning on line 2264 in docs/src/main/asciidoc/writing-extensions.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.TermsWarnings] Consider using 'through', 'by', 'from', 'on', or 'by using' rather than 'via' unless updating existing content that uses the term. Raw Output: {"message": "[Quarkus.TermsWarnings] Consider using 'through', 'by', 'from', 'on', or 'by using' rather than 'via' unless updating existing content that uses the term.", "location": {"path": "docs/src/main/asciidoc/writing-extensions.adoc", "range": {"start": {"line": 2264, "column": 152}}}, "severity": "WARNING"}

Expand Down

0 comments on commit fd58e50

Please sign in to comment.