build(velocity): remove blossom usage

This commit is contained in:
Jason Penilla committed 2023-08-01 16:55:56 -07:00
1 parent 8241e6091b
commit c0761b7cea
6 files changed
+53 -44

No files matched your search

+17
View File
@@ -1,10 +1,27 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import net.kyori.indra.git.IndraGitExtension
import org.apache.tools.ant.filters.ReplaceTokens
import org.gradle.accessors.dm.LibrariesForLibs
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.provider.Provider
import org.gradle.kotlin.dsl.filter
import org.gradle.kotlin.dsl.the
import org.gradle.language.jvm.tasks.ProcessResources
fun ProcessResources.replace(
pattern: String,
tokens: Map<String, Any?>
) {
inputs.properties(tokens)
filesMatching(pattern) {
filter<ReplaceTokens>(
"beginToken" to "\${",
"endToken" to "}",
"tokens" to tokens
)
}
}
val Project.releaseNotes: Provider<String>
get() = providers.environmentVariable("RELEASE_NOTES")
+3 -13
View File
@@ -1,5 +1,3 @@
import org.apache.tools.ant.filters.ReplaceTokens
plugins {
id("carbon.shadow-platform")
id("quiet-fabric-loom")
@@ -63,21 +61,13 @@ tasks {
relocateGuice()
}
processResources {
val props = mapOf(
"modId" to rootProject.name.toLowerCase(),
replace("fabric.mod.json", mapOf(
"modId" to rootProject.name.lowercase(),
"name" to rootProject.name,
"version" to project.version,
"description" to project.description,
"github_url" to GITHUB_REPO_URL
)
inputs.properties(props)
filesMatching("fabric.mod.json") {
filter<ReplaceTokens>(
"beginToken" to "\${",
"endToken" to "}",
"tokens" to props
)
}
))
}
runServer {
-1
View File
@@ -4,7 +4,6 @@ metadata:
- plugins
plugins:
net.kyori.blossom: 1.3.0
org.spongepowered.gradle.plugin: 2.1.1
xyz.jpenilla.run-paper: &run-task 2.1.0
xyz.jpenilla.run-velocity: *run-task
+8 -15
View File
@@ -1,8 +1,5 @@
import java.util.Locale
plugins {
id("carbon.shadow-platform")
id("net.kyori.blossom")
id("xyz.jpenilla.run-velocity")
}
@@ -10,7 +7,6 @@ dependencies {
implementation(projects.carbonchatCommon)
compileOnly(libs.velocityApi)
annotationProcessor(libs.velocityApi)
implementation(libs.cloudVelocity)
compileOnly(libs.miniplaceholders)
@@ -36,17 +32,14 @@ tasks {
runVelocity {
velocityVersion(libs.versions.velocityApi.get())
}
}
blossom {
mapOf(
"ID" to rootProject.name.lowercase(Locale.ROOT),
"NAME" to rootProject.name,
"VERSION" to version,
"DESCRIPTION" to description,
"URL" to GITHUB_REPO_URL
).forEach { (k, v) ->
replaceToken("$[$k]", v)
processResources {
replace("velocity-plugin.json", mapOf(
"id" to rootProject.name.lowercase(),
"name" to rootProject.name,
"version" to project.version,
"description" to project.description,
"url" to GITHUB_REPO_URL
))
}
}
@@ -24,8 +24,6 @@ import com.google.inject.Injector;
import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
import com.velocitypowered.api.event.proxy.ProxyShutdownEvent;
import com.velocitypowered.api.plugin.Dependency;
import com.velocitypowered.api.plugin.Plugin;
import com.velocitypowered.api.plugin.PluginContainer;
import com.velocitypowered.api.plugin.annotation.DataDirectory;
import com.velocitypowered.api.proxy.ProxyServer;
@@ -33,19 +31,6 @@ import java.nio.file.Path;
import net.draycia.carbon.common.util.CarbonDependencies;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
@Plugin(
id = "$[ID]",
name = "$[NAME]",
version = "$[VERSION]",
description = "$[DESCRIPTION]",
url = "$[URL]",
authors = {"Draycia"},
dependencies = {
@Dependency(id = "luckperms"),
@Dependency(id = "miniplaceholders", optional = true),
@Dependency(id = "unsignedvelocity", optional = true)
}
)
public final class CarbonVelocityBootstrap {
private final Injector parentInjector;
@@ -0,0 +1,25 @@
{
"id": "${id}",
"name": "${name}",
"version": "${version}",
"description": "${description}",
"url": "${url}",
"authors": [
"Draycia"
],
"dependencies": [
{
"id": "luckperms",
"optional": false
},
{
"id": "miniplaceholders",
"optional": true
},
{
"id": "unsignedvelocity",
"optional": true
}
],
"main": "net.draycia.carbon.velocity.CarbonVelocityBootstrap"
}