-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
71 changed files
with
402 additions
and
2,134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import org.gradle.api.DefaultTask | ||
import org.gradle.api.file.RegularFileProperty | ||
import org.gradle.api.provider.Property | ||
import org.gradle.api.tasks.Input | ||
import org.gradle.api.tasks.OutputDirectory | ||
import org.gradle.api.tasks.TaskAction | ||
import org.gradle.kotlin.dsl.get | ||
import org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler | ||
import org.jetbrains.java.decompiler.main.decompiler.PrintStreamLogger | ||
import java.io.File | ||
|
||
private class Decompiler(output: File) : ConsoleDecompiler(output, mapOf(), PrintStreamLogger(System.out)) | ||
|
||
@Suppress("LeakingThis") | ||
abstract class DecompileDependenciesTask : DefaultTask() { | ||
|
||
@get:Input | ||
abstract val configuration: Property<String> | ||
|
||
@get:OutputDirectory | ||
abstract val output: RegularFileProperty | ||
|
||
init { | ||
group = "megane" | ||
|
||
configuration.convention("decompile") | ||
output.convention(project.layout.buildDirectory.file(name)) | ||
} | ||
|
||
@TaskAction | ||
fun decompile() { | ||
val decompiler = Decompiler(output.get().asFile) | ||
|
||
project.configurations[configuration.get()].resolvedConfiguration.resolvedArtifacts.forEach { | ||
decompiler.addSource(it.file) | ||
} | ||
|
||
decompiler.decompileContext() | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.