Gradle plugin for LWJGL 3

Overview

lwjgl

The idea is to easier the lwjgl dependency management

Let's say you want to include everything, as on the website with the preset

This:

val lwjglVersion = "3.2.3"
val lwjglNatives = "natives-linux"

repositories {
	mavenCentral()
}

dependencies {
	implementation(platform("org.lwjgl:lwjgl-bom:$lwjglVersion"))

	implementation("org.lwjgl", "lwjgl")
	implementation("org.lwjgl", "lwjgl-assimp")
	implementation("org.lwjgl", "lwjgl-bgfx")
	implementation("org.lwjgl", "lwjgl-cuda")
	implementation("org.lwjgl", "lwjgl-egl")
	implementation("org.lwjgl", "lwjgl-glfw")
	implementation("org.lwjgl", "lwjgl-jawt")
	implementation("org.lwjgl", "lwjgl-jemalloc")
	implementation("org.lwjgl", "lwjgl-libdivide")
	implementation("org.lwjgl", "lwjgl-llvm")
	implementation("org.lwjgl", "lwjgl-lmdb")
	implementation("org.lwjgl", "lwjgl-lz4")
	implementation("org.lwjgl", "lwjgl-meow")
	implementation("org.lwjgl", "lwjgl-nanovg")
	implementation("org.lwjgl", "lwjgl-nfd")
	implementation("org.lwjgl", "lwjgl-nuklear")
	implementation("org.lwjgl", "lwjgl-odbc")
	implementation("org.lwjgl", "lwjgl-openal")
	implementation("org.lwjgl", "lwjgl-opencl")
	implementation("org.lwjgl", "lwjgl-opengl")
	implementation("org.lwjgl", "lwjgl-opengles")
	implementation("org.lwjgl", "lwjgl-openvr")
	implementation("org.lwjgl", "lwjgl-opus")
	implementation("org.lwjgl", "lwjgl-par")
	implementation("org.lwjgl", "lwjgl-remotery")
	implementation("org.lwjgl", "lwjgl-rpmalloc")
	implementation("org.lwjgl", "lwjgl-shaderc")
	implementation("org.lwjgl", "lwjgl-sse")
	implementation("org.lwjgl", "lwjgl-stb")
	implementation("org.lwjgl", "lwjgl-tinyexr")
	implementation("org.lwjgl", "lwjgl-tinyfd")
	implementation("org.lwjgl", "lwjgl-tootle")
	implementation("org.lwjgl", "lwjgl-vma")
	implementation("org.lwjgl", "lwjgl-vulkan")
	implementation("org.lwjgl", "lwjgl-xxhash")
	implementation("org.lwjgl", "lwjgl-yoga")
	implementation("org.lwjgl", "lwjgl-zstd")
	runtimeOnly("org.lwjgl", "lwjgl", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-assimp", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-bgfx", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-glfw", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-jemalloc", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-libdivide", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-llvm", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-lmdb", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-lz4", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-meow", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-nanovg", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-nfd", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-nuklear", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-openal", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-opengl", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-opengles", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-openvr", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-opus", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-par", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-remotery", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-rpmalloc", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-shaderc", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-sse", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-stb", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-tinyexr", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-tinyfd", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-tootle", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-vma", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-xxhash", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-yoga", classifier = lwjglNatives)
	runtimeOnly("org.lwjgl", "lwjgl-zstd", classifier = lwjglNatives)
}

becomes

plugins {
    id("org.lwjgl.plugin") version "0.0.17"
}
dependencies {
    Lwjgl { implementation(Preset.everything) }
}

The corresponding natives will be loaded under the hood

The default version is the latest stable, that is 3.2.3, if you want to override this

Lwjgl { version = ".." }

Or you can use the available DSL accessors

Lwjgl { 
   release.`3_2_3` // down to 3.1.0
   snapshot
}

Presets are ArrayLists in oder to give the option to modify them as you wish

    enum class Preset(val modules: ArrayList<Module>) {
        none(arrayListOf<Module>()),
        everything(Module.values().toCollection(ArrayList())),
        gettingStarted(arrayListOf(core, assimp, bgfx, glfw, nanovg, nuklear, openal, opengl, par, stb, vulkan)),
        minimalOpenGL(arrayListOf(core, assimp, glfw, openal, opengl, stb)),
        minimalOpenGLES(arrayListOf(core, assimp, egl, glfw, openal, opengles, stb)),
        minimalVulkan(arrayListOf(core, assimp, glfw, openal, stb, vulkan))
    }

You can of course pass the wished Modules directly

Lwjgl { implementation(core, assimp, bgfx, glfw, nanovg, nuklear, openal, opengl, par, stb, vulkan) }

core may be skipped since it's added by default

You might also like...
A Gradle Plugin to determine which modules were affected by a set of files in a commit.
A Gradle Plugin to determine which modules were affected by a set of files in a commit.

A Gradle Plugin to determine which modules were affected by a set of files in a commit. One use case for this plugin is for developers who would like to only run tests in modules which have changed in a given commit.

EasyVersion is a Gradle plugin that manage your app or library version.

EasyVersion EasyVersion is a Gradle plugin that manage your app or library version. Before Downloading Create easy_version.json in your root project d

A Gradle plugin to help analyse the dependency between modules and run tasks only on modules impacted by specific set of changes.
A Gradle plugin to help analyse the dependency between modules and run tasks only on modules impacted by specific set of changes.

Change Tracker Plugin A Gradle plugin to help analyse the dependency between modules and run tasks only on modules impacted by specific set of changes

Android Gradle Plugin -- Auto Check big image and compress image in building.

McImage I will continue to update, please rest assured to use 中文文档 Android优雅的打包时自动化获取全部res资源 McImage is a Non-invasive plugin for compress all res in

Gradle plugin that generates a Swift Package Manager manifest and an XCFramework to distribute a Kotlin Multiplatform library for Apple platforms.

Multiplatform Swift Package This is a Gradle plugin for Kotlin Multiplatform projects that generates an XCFramework for your native Apple targets and

A Gradle plugin helps to proxy all the BuildConfig fields in the Android project.
A Gradle plugin helps to proxy all the BuildConfig fields in the Android project.

Readme A Gradle plugin helps to proxy all the BuildConfig fields in the Android project. Background In android BuildConfig, We might have different co

Gradle Plugin for publishing artifacts to Sonatype and Nexus

Introduction Due to Sonatype's strict validation rules, the publishing requirement must be satisfied by every artifact which wants to be published to

Gradle-i18n-plugin is meant for generating a JSON file with internationalized texts, based on a Google Sheet.
Gradle-i18n-plugin is meant for generating a JSON file with internationalized texts, based on a Google Sheet.

Gradle-i18n-plugin Gradle-i18n-plugin is meant for generating a JSON file with internationalized texts, based on a Google Sheet. The plugin assumes th

Gradle plugin that parses version updates and assigns them to groups of people.

Notifier Gradle Plugin This gradle plugin serves the need of automating how dependencies are handles in a project. More specifically, it functions usi

Comments
  • Invalid classifiers when

    Invalid classifiers when "allNatives" is true.

    I tried the plugin and it threw an error, after checking the source I found out that it's a bug - The strings in the allNative list don't have the "native-" prefix, and it isn't prepended later when adding the dependency either.

    https://github.com/LWJGL/lwjgl3-gradle/blob/4a5c30f1ca50210bd5a07375b2da2995c152d2d0/plugin/src/main/kotlin/org/lwjgl/lwjglUtil.kt#L132-L134 https://github.com/LWJGL/lwjgl3-gradle/blob/4a5c30f1ca50210bd5a07375b2da2995c152d2d0/plugin/src/main/kotlin/org/lwjgl/lwjglUtil.kt#L45-L48

    opened by aemogie 1
  • Huh, something is not working

    Huh, something is not working

    plugins {
        id('org.jetbrains.kotlin.jvm')
        id("org.lwjgl.plugin") version "0.0.20"
    }
    dependencies {
    
        Lwjgl { implementation(Preset.everything) }
    }
    

    it is not recognized

     Could not find method Lwjgl() for arguments [build_47r8pcqtz5jnglf4effz199kk$_run_closure1$_closure2@30d33f8b] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
    
    opened by igr 12
Owner
Lightweight Java Game Library
LWJGL is a Java library that enables cross-platform access to graphics, audio and parallel computing APIs.
Lightweight Java Game Library
A Gradle plugin that generates plugin.yml for Bukkit/BungeeCord/Nukkit plugins based on the Gradle project

plugin-yml is a simple Gradle plugin that generates the plugin.yml plugin description file for Bukkit plugins, bungee.yml for Bungee plugins or nukkit.yml for Nukkit plugins based on the Gradle project. Various properties are set automatically (e.g. project name, version or description) and additional properties can be added using a simple DSL.

Plexus 0 Apr 10, 2022
Gradle Plugin to automatically upgrade your gradle project dependencies and send a GitHub pull request with the changes

Gradle Plugin to automatically upgrade your gradle project dependencies and send a GitHub pull request with the changes

Dipien 142 Dec 29, 2022
Gradle Plugin that allows you to decompile bytecode compiled with Jetpack Compose Compiler Plugin into Java and check it

decomposer Gradle Plugin that allows you to decompile bytecode compiled with Jetpack Compose Compiler Plugin into Java and check it How to use Run bui

Takahiro Menju 56 Nov 18, 2022
Gradle Plugin to enable auto-completion and symbol resolution for all Kotlin/Native platforms.

CompleteKotlin Gradle Plugin to enable auto-completion and symbol resolution for all Kotlin/Native platforms. What this plugin provides This zero-conf

Louis CAD 235 Jan 3, 2023
A Gradle plugin that improves the experience when developing Android apps, especially system tools, that use hidden APIs.

A Gradle plugin that improves the experience when developing Android apps, especially system tools, that use hidden APIs.

Rikka apps 124 Dec 31, 2022
Grazel is a Gradle plugin to automate generation of valid Bazel files for a given Android/Kotlin/Java project.

Grazel Grazel stands for Gradle to Bazel. It is a Gradle plugin that enables you to migrate Android projects to Bazel build system in an incremental a

Grab 228 Jan 2, 2023
Gradle Plugin for Continuous Integration of AppSweep App Testing.

This Gradle plugin can be used to continuously integrate app scanning using AppSweep into your Android app build process

Guardsquare 28 Nov 13, 2022
Gradle plugin which validates the licenses of your dependency graph match what you expect

Gradle plugin which validates the licenses of your dependency graph match what you expect

Cash App 502 Dec 31, 2022
Artifactory is a gradle plugin to assist in developing Minecraft mods that can target different modloaders.

Artifactory Artifactory is a gradle plugin to assist in developing Minecraft mods that can target different modloaders. Currently, Fabric and Forge ar

Zach Kozar 3 Dec 29, 2021
Graphfity is a Gradle Plugin which creates a dependency node diagram graph about your internal modules dependencies, specially useful if you are developing a multi-module application

Graphfity creates a dependency nodes diagram graph about your internal modules dependencies, specially useful if you are developing a multi-module app

Iván Carrasco 27 Dec 20, 2022