Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

roscopeco/jasm-gradle-plugin

Repository files navigation

JASM plugin for Gradle

note: This repository is archived and the plugin is discontinuted. Development of JASM itself will continue but I cannot commit to keeping the plugin up to date.

What?

JASM is an assembler for JVM bytecode.

This project contains a Gradle plugin that allows you to integrate JASM code into your Gradle builds alongside Java and other languages.

The plugin is available in the Gradle Plugin Repository and can be applied directly to your Gradle project without any additional download. Follow the link for latest version information.

It's very early days for this right now, and it's pretty much hacked together just enough to work. However, it does work well enough to assemble Jasm code as part of a Gradle project.

What is currently supported:

  • Adds source sets for JASM code (in src/main/jasm and src/test/jasm)
  • Hooks in to the Java lifecycle (if in use) to assemble JASM code before Java compile
  • Output goes into build/classes/jasm
  • Javac and runtime (for application plugin) classpaths include JASM assembled classes

However, as this is still a WIP, there's plenty still to do:

  • Allow configuration of the JASM task
  • Stop using deprecated Gradle features
  • Tidy up the code
  • and much more

Requirements

  • Java 11 or above (for the VM running Gradle)

How?

Add the following in your build.gradle.kts:

plugins {
    id("com.roscopeco.jasm") version "0.7.0"
}

There's an example project here which illustrates how things should be laid out: https://github.com/roscopeco/jasm-example

Who?

JASM is copyright 2022 Ross Bamford (roscopeco AT gmail DOT com).

See LICENSE.md for the gory legal stuff (spoiler: MIT).