Skip to content

Commit

Permalink
Create obfuscation-explorer project
Browse files Browse the repository at this point in the history
This is a separate plugin to support all different Java mapping
formats. This plugin will provide a extension points for the Minecraft
Development plugin to hook into and provide mapping information. It
will also provide a generic settings page to allow users to configure
their own mappings for the project.
  • Loading branch information
DenWav committed Sep 4, 2024
1 parent 63c93fe commit fa9b07f
Show file tree
Hide file tree
Showing 233 changed files with 16,125 additions and 0 deletions.
3 changes: 3 additions & 0 deletions obfuscation-explorer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.sandbox/
build/
gen/
128 changes: 128 additions & 0 deletions obfuscation-explorer/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
/*
* Minecraft Development for IntelliJ
*
* https://mcdev.io/
*
* Copyright (C) 2024 minecraft-dev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, version 3.0 only.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

plugins {
java
groovy
idea
id(libs.plugins.kotlin.get().pluginId)
id(libs.plugins.intellij.get().pluginId)
id(libs.plugins.licenser.get().pluginId)
id(libs.plugins.ktlint.get().pluginId)
`mcdev-core`
`mcdev-parsing`
`mcdev-publishing`
}

val ideaVersion: String by project
val ideaVersionName: String by project
val coreVersion: String by project
val downloadIdeaSources: String by project

val jflex by configurations
val jflexSkeleton by configurations
val grammarKit by configurations

group = "io.mcdev.obfex"
version = "$ideaVersionName-$coreVersion"

intellij {
plugins.addProvider(libs.versions.psiPlugin.map { "PsiViewer:$it" })

pluginName.set("Obfuscation Explorer")
}

val generateSrgLexer by lexer("SrgLexer", "io/mcdev/obfex/formats/srg/gen")
val generateSrgParser by parser("SrgParser", "io/mcdev/obfex/formats/srg/gen")

val generateCSrgLexer by lexer("CSrgLexer", "io/mcdev/obfex/formats/csrg/gen")
val generateCSrgParser by parser("CSrgParser", "io/mcdev/obfex/formats/csrg/gen")

val generateTSrgLexer by lexer("TSrgLexer", "io/mcdev/obfex/formats/tsrg/gen")
val generateTSrgParser by parser("TSrgParser", "io/mcdev/obfex/formats/tsrg/gen")

val generateTSrg2Lexer by lexer("TSrg2Lexer", "io/mcdev/obfex/formats/tsrg2/gen")
val generateTSrg2Parser by parser("TSrg2Parser", "io/mcdev/obfex/formats/tsrg2/gen")

val generateJamLexer by lexer("JamLexer", "io/mcdev/obfex/formats/jam/gen")
val generateJamParser by parser("JamParser", "io/mcdev/obfex/formats/jam/gen")

val generateEnigmaLexer by lexer("EnigmaLexer", "io/mcdev/obfex/formats/enigma/gen")
val generateEnigmaParser by parser("EnigmaParser", "io/mcdev/obfex/formats/enigma/gen")

val generateTinyV1Lexer by lexer("TinyV1Lexer", "io/mcdev/obfex/formats/tinyv1/gen")
val generateTinyV1Parser by parser("TinyV1Parser", "io/mcdev/obfex/formats/tinyv1/gen")

val generateTinyV2Lexer by lexer("TinyV2Lexer", "io/mcdev/obfex/formats/tinyv2/gen")
val generateTinyV2Parser by parser("TinyV2Parser", "io/mcdev/obfex/formats/tinyv2/gen")

val generateProGuardLexer by lexer("ProGuardLexer", "io/mcdev/obfex/formats/proguard/gen")
val generateProGuardParser by parser("ProGuardParser", "io/mcdev/obfex/formats/proguard/gen")

val generate by tasks.registering {
group = "minecraft"
description = "Generates sources needed to compile the plugin."
outputs.dir(layout.buildDirectory.dir("gen"))
dependsOn(
generateSrgLexer,
generateSrgParser,
generateCSrgLexer,
generateCSrgParser,
generateTSrgLexer,
generateTSrgParser,
generateTSrg2Lexer,
generateTSrg2Parser,
generateJamLexer,
generateJamParser,
generateEnigmaLexer,
generateEnigmaParser,
generateTinyV1Lexer,
generateTinyV1Parser,
generateTinyV2Lexer,
generateTinyV2Parser,
generateProGuardLexer,
generateProGuardParser,
)
}

sourceSets.main { java.srcDir(generate) }

// Remove gen directory on clean
tasks.clean { delete(generate) }

tasks.buildSearchableOptions {
enabled = false
}

license {
tasks {
register("gradle") {
files.from(
fileTree(project.projectDir) {
include("*.gradle.kts", "gradle.properties")
exclude("**/buildSrc/**", "**/build/**")
}
)
}
register("grammars") {
files.from(project.fileTree("src/main/grammars"))
}
}
}
22 changes: 22 additions & 0 deletions obfuscation-explorer/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# Minecraft Development for IntelliJ
#
# https://mcdev.io/
#
# Copyright (C) 2024 minecraft-dev
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, version 3.0 only.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#

# suppress inspection "UnusedProperty" for whole file
coreVersion = 0.0.1
78 changes: 78 additions & 0 deletions obfuscation-explorer/icons/csrg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 78 additions & 0 deletions obfuscation-explorer/icons/enigma.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 78 additions & 0 deletions obfuscation-explorer/icons/jam.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit fa9b07f

Please sign in to comment.