Skip to content

typst-io/spigradle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

573 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spigradle

License Gradle Plugin Portal TeamCity build status

Maven Central Version Maven Central Version Maven Central Version Maven Central Version

An intelligent Gradle plugin for developing plugins for Spigot, BungeeCord, and NukkitX.

Migration Guide | Google Code Wiki | Samples

Features

  • Auto-generate plugin.yml with main class detection
  • Debug task with server download and IDEA integration
  • Repository and dependency shortcuts

Quick Start

settings.gradle.kts (to apply Gradle Version Catalog)

dependencyResolutionManagement {
    repositories {
        mavenCentral()
    }
    versionCatalogs {
        // apply the version catalog to use the new dependency shortcut
        create("spigots") {
            from("io.typst:spigot-catalog:1.0.0")
            // if you need to override the version:
            // version("spigot-api", "1.21.10-R0.1-SNAPSHOT")
            // to see the catalog declaration, double tab shift in IDE, search spigot-catalog
        }
        create("commons") {
            from("io.typst:common-catalog:1.1.0")
        }
    }
}

// ...

build.gradle.kts

plugins {
    java
    alias(spigots.plugins.spigot)
    alias(commons.plugins.ideaExt) // optional, allows Spigradle generates Run Configurations for debug
}

repositories {
    mavenCentral()
    spigotRepos {
        spigotmc()
        jitpack() // for vault
    }
}

dependencies {
    compileOnly(spigots.paper.api)
    compileOnly(spigots.protocolLib)
    compileOnly(spigots.vault) {
        isTransitive = false
    }
}

spigot {
    depend = listOf("ProtocolLib", "Vault")
    apiVersion = "1.21"
}

debugSpigot { // extension for debugProjectName task
    version = "1.21.8"
    eula = true
}

Table of contents

Plugins

Requirements

All the plugins require Gradle 9.0+, the latest version is recommended.

To update your gradle wrapper:

gradlew wrapper --gradle-version 9.2.1 --distribution-type all

Repositories

Spigradle provides convenient shortcuts for adding Maven repositories commonly used in Minecraft plugin development. These repository shortcuts can be used in both Groovy and Kotlin DSL.

Relations column indicates which popular plugins/libraries are hosted in each repository.

Repository shortcuts

Repository shortcuts are now available via platform-specific blocks: spigotRepos {}, bungeeRepos {}, nukkitRepos {}.

Spigot repositories (via spigotRepos {})

Name URL Relations
spigotmc() https://hub.spigotmc.org/nexus/content/repositories/snapshots/ Spigot API
papermc() https://repo.papermc.io/repository/maven-public/ Paper API
purpurmc() https://repo.purpurmc.org/snapshots Purpur API
protocolLib() https://repo.dmulloy2.net/nexus/repository/public/ ProtocolLib
enginehub() https://maven.enginehub.org/repo/ worldguard, worldedit, commandhelper...
codemc() https://repo.codemc.org/repository/maven-public/ bStats
essentialsX() https://repo.essentialsx.net/releases/ EssentialsX
frostcast() https://ci.frostcast.net/plugin/repository/everything BanManager

Bungee repositories (via bungeeRepos {})

Name URL Relations
bungeecord() https://oss.sonatype.org/content/repositories/snapshots/ BungeeCord API
sonatype() https://oss.sonatype.org/content/repositories/snapshots/ (alias for bungeecord)
minecraftLibraries() https://libraries.minecraft.net Brigadier

Nukkit repositories (via nukkitRepos {})

Name URL Relations
nukkitX() https://repo.opencollab.dev/maven-snapshots NukkitX
openCollabRelease() https://repo.opencollab.dev/maven-releases
openCollabSnapshot() https://repo.opencollab.dev/maven-snapshots

Common repositories (via Repositories)

Name URL Relations
sonatype() https://oss.sonatype.org/content/repositories/snapshots/
jitpack() https://jitpack.io Vault

Groovy usage

repositories {
    mavenCentral()
    spigotRepos {
        papermc()
        protocolLib()
    }
}

Kotlin usage

repositories {
    mavenCentral()
    spigotRepos {
        papermc()
        protocolLib()
    }
}

Dependencies

Spigradle provides shortcuts for common Minecraft plugin dependencies. Each shortcut automatically resolves the correct Maven coordinates and uses a sensible default version (which you can override).

Important: Make sure to add the corresponding repository (see Repositories) before using these dependencies. The "Official repository" column indicates which repository function provides access to each dependency.

Dependency shortcuts

Dependencies are now available via Version Catalogs. See Quick Start for setup.

Catalog Alias Signature Default version Official repository
spigot-api org.spigotmc:spigot-api:$version 1.21.8-R0.1-SNAPSHOT spigotmc()
spigot-server org.spigotmc:spigot:$version 1.21.8-R0.1-SNAPSHOT mavenLocal(), BuildTools
paper-api io.papermc.paper:paper-api:$version 1.21.8-R0.1-SNAPSHOT papermc()
purpur-api org.purpurmc.purpur:purpur-api:$version 1.21.8-R0.1-SNAPSHOT purpurmc()
bungeecord-api net.md-5:bungeecord-api:$version 1.21-R0.4 sonatype()
minecraftServer org.spigotmc:minecraft-server:$version 1.21.8-SNAPSHOT mavenLocal(), BuildTools
bukkit org.bukkit:bukkit:$version 1.21.8-R0.1-SNAPSHOT mavenLocal(), BuildTools
craftbukkit org.bukkit:craftbukkit:$version 1.21.8-R0.1-SNAPSHOT mavenLocal(), BuildTools
protocolLib net.dmulloy2:ProtocolLib:$version 5.4.0 mavenCentral()
vault-api com.github.MilkBowl:VaultAPI:$version 1.7 jitpack()
luckperms net.luckperms:api:$version 5.5 mavenCentral()
worldedit com.sk89q.worldedit:worldedit-bukkit:$version 7.3.17 enginehub()
worldguard com.sk89q.worldguard:worldguard-bukkit:$version 7.0.14 enginehub()
essentialsX net.essentialsx:EssentialsX:$version 2.21.1 essentialsX()
banManager me.confuser.banmanager:BanManagerBukkit:$version 7.7.0-SNAPSHOT frostcast()
commandHelper com.sk89q:commandhelper:$version 3.3.4-SNAPSHOT enginehub()
bStats org.bstats:bstats-bukkit:$version 3.0.2 codemc()
mockBukkit org.mockbukkit.mockbukkit:mockbukkit-v1.21:$ver 4.98.0 mavenCentral()
nukkit cn.nukkit:nukkit:$version 1.0-SNAPSHOT openCollabSnapshot()

Groovy usage

dependencies {
    compileOnly spigots.spigot.api
}

Kotlin usage

dependencies {
    compileOnly(spigots.spigot.api)
}

All docs

Supporters

JetBrains OS License

Packages

 
 
 

Contributors