Skip to content

Repository files navigation

Processing Library Plugin

Processing Gradle

Gradle Plugin to build Processing Libraries.

Processing Library Reference

Usage

Download IntelliJ IDEA

Project Layout

LibraryName
β”œβ”€ settings.gradle.kts
β”œβ”€ build.gradle.kts
β”œβ”€ src/java/main
β€Šβ”‚β€Žβ€ƒβ€ƒβ””β”€ me.username
β€Šβ”‚β€Žβ€ƒβ€ƒβ€ƒβ€ƒ └─ ProcessingLibrary.java
└─ build/processingLibrary
β€ƒβ€ƒβ€ƒβ”œβ”€ LibraryName.pdex
β€ƒβ€ƒβ€ƒβ”œβ”€ LibraryName.zip
   └─ LibraryName.txt

Build Script

build.gradle.kts

group = "me.username"
version = "0.0.1"

plugins {
    java
    
    /** Apply the Processing Library Gradle Plugin */
    id("net.stephcraft.processing-library") version "0.0.1"
}

processingLibrary {

    /** Configure library.properties here */
    properties {
        /** The name of your library as you want it formatted. (defaults to project name) */
        name = "Cool Library"
        /** A web page for your library, NOT a direct link to where to download it. */
        url = "https://username.github.io/libraryName"
        /** The category (or categories) of your library. */
        categories = DATA + IO
        /** A short sentence to summarize the library's function. (defaults to project description) */
        sentence = ""
        /** Additional information suitable for the Processing website. */
        paragraph = ""
        /** A version number that increments once with each release. */
        version = 1
        /** The version as the user will see it. (defaults to project version) */
        prettyVersion = project.version.toString()
        /** The min and max revision of Processing compatible with your library. (optional) */
        revisionRange = 0..1000
    }

    /** Alternatively you can use a library.properties file */
    propertiesFile = file("library.properties")

    /** You can also customize the output directory */
    destinationDirectory = layout.buildDirectory.dir("processingLibrary")
}

repositories {
    mavenCentral()
}

dependencies {
    /**
     * Add Processing as a dependency
     * https://mvnrepository.com/artifact/org.processing/core
     */
    compileOnly("org.processing:core:4.5.5")
}

tasks {
    /**
     * :generateProcessingLibrary will run when you press Build in IntelliJ IDEA
     * The generated processing library files are in build/processingLibrary
     */
    generateProcessingLibrary {
        mustRunAfter("jar")
    }
}

settings.gradle.kts

pluginManagement {
    repositories {
        gradlePluginPortal()
        maven("https://jitpack.io")
    }
    resolutionStrategy {
        eachPlugin {
            if (requested.id.toString() == "net.stephcraft.processing-library") {
                useModule("com.github.Stephcraft:Processing-Library-Plugin:main-SNAPSHOT")
            }
        }
    }
}

Tasks

  • :generateProcessingLibrary β€” Generates the processing library artifacts in build/processingLibrary

Documentation

Processing Library Plugin Documentation

Template

processing-library-example