Skip to content

Minimal library for generating bytecode implemented methods.

License

Notifications You must be signed in to change notification settings

burningtnt/BytecodeImplGenerator

Repository files navigation

BCIG: Bytecode Implementation Generator

Minimal library for generating bytecode implemented methods.

Knowledge Required

Please make sure that you have learnt Java Bytecode and ASM.

Usage

Gradle

Declare this maven.

maven(url = "https://libraries.minecraft.net")

Import Bytecode Implementation.

Add the following codes in your build.gradle.kts configuration file.

tasks.compileJava {
    val bytecodeClasses = listOf(
            "org/example/project/YourClassName"
    )
    val sourceSet = "main"

    doLast {
        javaexec {
            classpath(rootProject.sourceSets[sourceSet].runtimeClasspath)
            mainClass.set("net.burningtnt.bcigenerator.BytecodeImplGenerator")
            args(bytecodeClasses.stream().map { s -> project.layout.buildDirectory.file("classes/java/$sourceSet/$s.class").get().asFile.path }.toList())
        }
    }
}

Here, the bytecodeClasses are the white list of classes that Bytecode Implementation Generator should process. The classes that is not declared here would NOT be processed by Bytecode Implementation Generator.

Grammar Reference

Here is the full grammar reference.

Here is the guild for you to make your first bytecode implemented method.

About

Minimal library for generating bytecode implemented methods.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages