fernflowerplugin: Add annotations (#1854)
This commit is contained in:
@@ -25,7 +25,6 @@
|
|||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
`kotlin-dsl`
|
`kotlin-dsl`
|
||||||
groovy
|
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
@@ -35,7 +34,6 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(gradleApi())
|
implementation(gradleApi())
|
||||||
implementation(localGroovy())
|
|
||||||
implementation(group = "net.runelite", name = "fernflower", version = "07082019")
|
implementation(group = "net.runelite", name = "fernflower", version = "07082019")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,26 +1,43 @@
|
|||||||
import org.gradle.api.DefaultTask
|
import org.gradle.api.DefaultTask
|
||||||
|
import org.gradle.api.tasks.CacheableTask
|
||||||
|
import org.gradle.api.tasks.Input
|
||||||
|
import org.gradle.api.tasks.InputFile
|
||||||
|
import org.gradle.api.tasks.Optional
|
||||||
|
import org.gradle.api.tasks.OutputDirectory
|
||||||
|
import org.gradle.api.tasks.PathSensitive
|
||||||
|
import org.gradle.api.tasks.PathSensitivity
|
||||||
import org.gradle.api.tasks.TaskAction
|
import org.gradle.api.tasks.TaskAction
|
||||||
import org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler
|
import org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler
|
||||||
import java.io.File
|
|
||||||
|
|
||||||
|
@CacheableTask
|
||||||
open class FernflowerTask: DefaultTask() {
|
open class FernflowerTask: DefaultTask() {
|
||||||
|
|
||||||
|
@Input
|
||||||
|
@Optional
|
||||||
var extraArgs: List<String>? = null
|
var extraArgs: List<String>? = null
|
||||||
|
|
||||||
|
@Input
|
||||||
|
@Optional
|
||||||
var inputJar: String? = null
|
var inputJar: String? = null
|
||||||
|
|
||||||
|
@Input
|
||||||
|
@Optional
|
||||||
var outputDir: String? = null
|
var outputDir: String? = null
|
||||||
|
|
||||||
fun getInputJar(): File {
|
@InputFile
|
||||||
return project.file(inputJar ?: project.buildDir.toString() + "/libs/" + project.name + '-' + project.version + ".jar")
|
@PathSensitive(PathSensitivity.ABSOLUTE)
|
||||||
}
|
var getInputJar = project.file(inputJar ?: project.buildDir.toString() + "/libs/" + project.name + '-'
|
||||||
|
+ project.version + ".jar")
|
||||||
|
|
||||||
|
@OutputDirectory
|
||||||
|
@PathSensitive(PathSensitivity.ABSOLUTE)
|
||||||
|
var getOutputDir = project.file(outputDir ?: project.buildDir.toString() + "/decompiled-sources")
|
||||||
|
|
||||||
fun getOutputDir(): File {
|
|
||||||
return project.file(outputDir ?: project.buildDir.toString() + "/decompiled-sources")
|
|
||||||
}
|
|
||||||
|
|
||||||
@TaskAction
|
@TaskAction
|
||||||
fun decompile() {
|
fun decompile() {
|
||||||
getOutputDir().mkdirs()
|
getOutputDir.mkdirs()
|
||||||
val args = mutableListOf(getInputJar().toString(), getOutputDir().toString())
|
val args = mutableListOf(getInputJar.toString(), getOutputDir.toString())
|
||||||
if (extraArgs != null) {
|
if (extraArgs != null) {
|
||||||
args.addAll(extraArgs!!)
|
args.addAll(extraArgs!!)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
implementation-class=kt
|
|
||||||
Reference in New Issue
Block a user