Skip to content

Commit

Permalink
Merge pull request #65 from QuiltMC/develop/1.7.0
Browse files Browse the repository at this point in the history
Release Quiltflower 1.7.0
  • Loading branch information
jaskarth authored Dec 6, 2021
2 parents e0e8026 + 2a91875 commit d7e31bc
Show file tree
Hide file tree
Showing 271 changed files with 17,861 additions and 4,144 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Publish Snapshot
on: [push, pull_request]
jobs:
publish:
if: ${{ github.repository_owner == 'QuiltMC' && contains(github.ref_name, 'develop') }}
runs-on: ubuntu-20.04
container:
image: openjdk:15-jdk
options: --user root
steps:
- uses: actions/checkout@v1
- uses: gradle/wrapper-validation-action@v1
- run: ./gradlew publish --stacktrace
env:
SNAPSHOTS_URL: ${{ secrets.SNAPSHOTS_URL }}
SNAPSHOTS_USERNAME: ${{ secrets.SNAPSHOTS_USERNAME }}
SNAPSHOTS_PASSWORD: ${{ secrets.SNAPSHOTS_PASSWORD }}
29 changes: 22 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,50 @@
### Quiltflower

Quiltflower is a fork of Fernflower and ForgeFlower adding additional features for use with the Quilt toolchain.
Quiltflower is a modern, general purpose decompiler focused on improving code quality, speed, and usability. Quiltflower is a fork of Fernflower and Forgeflower.

Changes include:
- New language features (Try with resources, switch expressions, pattern matching, and more)
- Better control flow generation (loops, try-catch, and switch, etc.)
- More configurability
- Better error messages
- Javadoc application
- Multithreading
- Handful of other fixes
- Optimization
- Many other miscellaneous features and fixes

When pulling from upstream, use https://github.com/fesh0r/fernflower
### Use
Want to use Quiltflower? There are a few ways! For Fabric and Architectury projects, [Loom Quiltflower](https://github.com/Juuxel/LoomQuiltflower) allows you to run genSources with Quiltflower.
The [Quiltflower Intellij IDEA plugin](https://plugins.jetbrains.com/plugin/18032-quiltflower) replaces Fernflower in IDEA with Quiltflower, and allows you to modify its settings.
Or, if you want to run Quiltflower from the commandline, head over to the [Releases tab](https://github.com/QuiltMC/quiltflower/releases) and grab the latest, and then follow the instructions further down the readme.
Make sure to report any issues to the [Issues tab!](https://github.com/QuiltMC/quiltflower/issues)

For support or questions, please join the [Quilt toolchain discord.](https://discord.quiltmc.org/toolchain)

### Contributing
To contribute, please check out [CONTRIBUTING.md](./CONTRIBUTING.md) and [ARCHITECTURE.md](./ARCHITECTURE.md)!

When pulling from upstream, use https://github.com/fesh0r/fernflower

#### Special Thanks
* Jetbrains- For maintaining Fernflower
* Forge Team- For maintaining ForgeFlower
* CFR- For it's large suite of very useful tests

Fernflower's readme is preserved below:
### About Fernflower

Fernflower is the first actually working analytical decompiler for Java and
probably for a high-level programming language in general. Naturally it is still
under development, please send your bug reports and improvement suggestions to the
[issue tracker](https://youtrack.jetbrains.com/newIssue?project=IDEA&clearDraft=true&c=Subsystem+Decompiler).
[issue tracker](https://github.com/QuiltMC/quiltflower/issues).

### Licence

Fernflower is licenced under the [Apache Licence Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).

### Running from command line

`java -jar fernflower.jar [-<option>=<value>]* [<source>]+ <destination>`
`java -jar quiltflower.jar [-<option>=<value>]* [<source>]+ <destination>`

\* means 0 or more times\
\+ means 1 or more times
Expand All @@ -45,11 +59,12 @@ Fernflower is licenced under the [Apache Licence Version 2.0](http://www.apache.

##### Examples:

`java -jar fernflower.jar -hes=0 -hdc=0 c:\Temp\binary\ -e=c:\Java\rt.jar c:\Temp\source\`
`java -jar quiltflower.jar -hes=0 -hdc=0 c:\Temp\binary\ -e=c:\Java\rt.jar c:\Temp\source\`

`java -jar fernflower.jar -dgs=1 c:\Temp\binary\library.jar c:\Temp\binary\Boot.class c:\Temp\source\`
`java -jar quiltflower.jar -dgs=1 c:\Temp\binary\library.jar c:\Temp\binary\Boot.class c:\Temp\source\`

### Command-line options
To force saving as a file or folder, `--file` and `--folder` can be provided. If not specified, Quiltflower will try to guess based on the file name.

With the exception of mpm, urc, ind, thr and log, the value of 1 means the option is activated, 0 - deactivated. Default
value, if any, is given between parentheses.
Expand Down
17 changes: 15 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ compileJava {
group = 'org.quiltmc'
archivesBaseName = 'quiltflower'

version = '1.6.0'
version = '1.7.0'

def ENV = System.getenv()
version = version + (ENV.GITHUB_ACTIONS ? "" : "+local")
Expand All @@ -44,6 +44,7 @@ dependencies {
testDataGroovyImplementation 'org.codehaus.groovy:groovy:3.0.8'
testDataKotlinImplementation platform('org.jetbrains.kotlin:kotlin-bom')
testDataKotlinImplementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
testRuntimeOnly 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
}

test {
Expand Down Expand Up @@ -138,6 +139,9 @@ publishing {
publications {
mavenJava(MavenPublication) {
from components.java
if (ENV.SNAPSHOTS_URL) {
version = project.version + "-SNAPSHOT"
}
artifact(sourceJar)
}
}
Expand All @@ -153,5 +157,14 @@ publishing {
}
}
}
if (ENV.SNAPSHOTS_URL) {
maven {
url ENV.SNAPSHOTS_URL
credentials {
username ENV.SNAPSHOTS_USERNAME
password ENV.SNAPSHOTS_PASSWORD
}
}
}
}
}
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kotlin.stdlib.default.dependency = false
8 changes: 8 additions & 0 deletions src/org/jetbrains/java/decompiler/code/BytecodeVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public boolean hasIfPatternMatching() {
return major >= MAJOR_16;
}

public boolean hasSwitchExpressions() {
return major >= MAJOR_16;
}

public boolean hasSealedClasses() {
return previewReleased(MAJOR_15, MAJOR_17);
}
Expand All @@ -50,6 +54,10 @@ public boolean hasNewTryWithResources() {
return major >= MAJOR_11;
}

public boolean predatesJava() {
return major <= MAJOR_1_0_2 && minor <= 2;
}

private boolean previewFrom(int previewStart) {
return major >= previewStart && minor == PREVIEW;
}
Expand Down
11 changes: 11 additions & 0 deletions src/org/jetbrains/java/decompiler/code/cfg/ControlFlowGraph.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public class ControlFlowGraph implements CodeConstants {

private final Set<BasicBlock> finallyExits = new HashSet<>();
private final InstructionSequence sequence;
public Set<String> commentLines = null;
public boolean addErrorComment = false;

// *****************************************************************************
// constructors
Expand Down Expand Up @@ -821,4 +823,13 @@ public Set<BasicBlock> getFinallyExits() {
public InstructionSequence getSequence() {
return sequence;
}

// Wrapper to add to root statement
public void addComment(String comment) {
if (commentLines == null) {
commentLines = new LinkedHashSet<>();
}

commentLines.add(comment);
}
}
Loading

0 comments on commit d7e31bc

Please sign in to comment.