Skip to content

Commit dbc3e0f

Browse files
committed
ASM-API: Initial
The assembly transformer api goal is to provide a flexible way to transform classes. The current one doesn't help the mod to support multiple versions. And, It has many duplicates to maintain and other issues. The new api takes the class node as input. And, changes the node by the transformers.
1 parent f01dfe7 commit dbc3e0f

4 files changed

Lines changed: 51 additions & 17 deletions

File tree

asm-api/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dependencies {
2+
implementation('org.ow2.asm:asm:9.0-beta')
3+
implementation('org.ow2.asm:asm-tree:9.0-beta')
4+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package codes.biscuit.skyblockaddons.asm.api;
2+
3+
import org.objectweb.asm.tree.ClassNode;
4+
5+
/**
6+
* Manage the transformers and transform any class node.
7+
*
8+
* @author iHDeveloper
9+
*/
10+
public abstract class TransformerEngine {
11+
12+
/**
13+
* Transform the class node through the transformers
14+
*
15+
* @param node The class to transform
16+
*/
17+
public void transform(ClassNode node) {
18+
throw new UnsupportedOperationException();
19+
}
20+
21+
}

build.gradle

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,39 @@ group = 'codes.biscuit'
1010
// The below line is for version checkers <= 1.4.2
1111
//version = "1.5.2"
1212

13-
// Java plugin settings
14-
sourceCompatibility = JavaVersion.VERSION_1_8
15-
targetCompatibility = JavaVersion.VERSION_1_8
16-
compileJava.options.encoding = 'UTF-8'
17-
18-
repositories {
19-
mavenCentral()
20-
maven {
21-
name 'JitPack'
22-
url 'https://jitpack.io'
13+
allprojects {
14+
apply plugin: 'java'
15+
16+
// Java plugin settings
17+
sourceCompatibility = JavaVersion.VERSION_1_8
18+
targetCompatibility = JavaVersion.VERSION_1_8
19+
compileJava.options.encoding = 'UTF-8'
20+
21+
repositories {
22+
mavenCentral()
23+
maven {
24+
name 'JitPack'
25+
url 'https://jitpack.io'
26+
}
27+
}
28+
}
29+
30+
sourceSets {
31+
main {
32+
output.resourcesDir = java.outputDir
2333
}
2434
}
2535

2636
dependencies {
37+
// Assembly Transformer API
38+
implementation(project('asm-api'))
2739
// Discord RPC for Java https://github.com/jagrosh/DiscordIPC
2840
implementation('com.github.jagrosh:DiscordIPC:e29d6d8') {
2941
exclude module: 'log4j'
3042
}
3143
testImplementation('org.junit.jupiter:junit-jupiter:5.6.2')
3244
}
3345

34-
sourceSets {
35-
main {
36-
output.resourcesDir = java.outputDir
37-
}
38-
}
39-
4046
minecraft {
4147
version = "${project.minecraftVersion}-${project.forgeVersion}"
4248
runDir = "run"

settings.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@ pluginManagement {
1313
}
1414
}
1515
}
16-
}
16+
}
17+
18+
// Assembly Transformer API
19+
include 'asm-api'

0 commit comments

Comments
 (0)