Skip to content
Igor Maznitsa edited this page Jun 18, 2023 · 2 revisions

Since 1.3.0 it is possible to use special Gradle plugin to convert JBBP scripts into source files. The Example build.gradle script for a java project

plugins {
  id "com.igormaznitsa.gradle.jbbp" version "2.0.5"
}
apply plugin: 'java'

repositories {
    mavenCentral()
}

dependencies {
    compile 'com.igormaznitsa:jbbp:1.3.0' // generated sources desire the dependency!
}

jbbp { // JBBP task parameters
 headComment = 'Free license' // provide text for class top comment
 addGettersSetters = true // force getters setters for fields in result class
 interfaces = ['java.lang.Runnable'] // mark the result class as implementing Runnable
 customText = 'public void run () {}' // provide the Runnable interface method into generated class body
}

compileJava.dependsOn(jbbpGenerate) // call JBP generate source task before Java compilation task

The Result Java sources will be placed in build/generated-jbbp-dir (it can be redefined).

Clone this wiki locally