mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-04 06:28:53 +00:00
build(velocity): remove blossom usage
This commit is contained in:
6 files changed
+53
-44
No files matched your search
@@ -1,10 +1,27 @@
|
|||||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||||
import net.kyori.indra.git.IndraGitExtension
|
import net.kyori.indra.git.IndraGitExtension
|
||||||
|
import org.apache.tools.ant.filters.ReplaceTokens
|
||||||
import org.gradle.accessors.dm.LibrariesForLibs
|
import org.gradle.accessors.dm.LibrariesForLibs
|
||||||
import org.gradle.api.Project
|
import org.gradle.api.Project
|
||||||
import org.gradle.api.Task
|
import org.gradle.api.Task
|
||||||
import org.gradle.api.provider.Provider
|
import org.gradle.api.provider.Provider
|
||||||
|
import org.gradle.kotlin.dsl.filter
|
||||||
import org.gradle.kotlin.dsl.the
|
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>
|
val Project.releaseNotes: Provider<String>
|
||||||
get() = providers.environmentVariable("RELEASE_NOTES")
|
get() = providers.environmentVariable("RELEASE_NOTES")
|
||||||
|
|||||||
+3
-13
@@ -1,5 +1,3 @@
|
|||||||
import org.apache.tools.ant.filters.ReplaceTokens
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("carbon.shadow-platform")
|
id("carbon.shadow-platform")
|
||||||
id("quiet-fabric-loom")
|
id("quiet-fabric-loom")
|
||||||
@@ -63,21 +61,13 @@ tasks {
|
|||||||
relocateGuice()
|
relocateGuice()
|
||||||
}
|
}
|
||||||
processResources {
|
processResources {
|
||||||
val props = mapOf(
|
replace("fabric.mod.json", mapOf(
|
||||||
"modId" to rootProject.name.toLowerCase(),
|
"modId" to rootProject.name.lowercase(),
|
||||||
"name" to rootProject.name,
|
"name" to rootProject.name,
|
||||||
"version" to project.version,
|
"version" to project.version,
|
||||||
"description" to project.description,
|
"description" to project.description,
|
||||||
"github_url" to GITHUB_REPO_URL
|
"github_url" to GITHUB_REPO_URL
|
||||||
)
|
))
|
||||||
inputs.properties(props)
|
|
||||||
filesMatching("fabric.mod.json") {
|
|
||||||
filter<ReplaceTokens>(
|
|
||||||
"beginToken" to "\${",
|
|
||||||
"endToken" to "}",
|
|
||||||
"tokens" to props
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
runServer {
|
runServer {
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ metadata:
|
|||||||
- plugins
|
- plugins
|
||||||
|
|
||||||
plugins:
|
plugins:
|
||||||
net.kyori.blossom: 1.3.0
|
|
||||||
org.spongepowered.gradle.plugin: 2.1.1
|
org.spongepowered.gradle.plugin: 2.1.1
|
||||||
xyz.jpenilla.run-paper: &run-task 2.1.0
|
xyz.jpenilla.run-paper: &run-task 2.1.0
|
||||||
xyz.jpenilla.run-velocity: *run-task
|
xyz.jpenilla.run-velocity: *run-task
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
import java.util.Locale
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("carbon.shadow-platform")
|
id("carbon.shadow-platform")
|
||||||
id("net.kyori.blossom")
|
|
||||||
id("xyz.jpenilla.run-velocity")
|
id("xyz.jpenilla.run-velocity")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -10,7 +7,6 @@ dependencies {
|
|||||||
implementation(projects.carbonchatCommon)
|
implementation(projects.carbonchatCommon)
|
||||||
|
|
||||||
compileOnly(libs.velocityApi)
|
compileOnly(libs.velocityApi)
|
||||||
annotationProcessor(libs.velocityApi)
|
|
||||||
|
|
||||||
implementation(libs.cloudVelocity)
|
implementation(libs.cloudVelocity)
|
||||||
compileOnly(libs.miniplaceholders)
|
compileOnly(libs.miniplaceholders)
|
||||||
@@ -36,17 +32,14 @@ tasks {
|
|||||||
runVelocity {
|
runVelocity {
|
||||||
velocityVersion(libs.versions.velocityApi.get())
|
velocityVersion(libs.versions.velocityApi.get())
|
||||||
}
|
}
|
||||||
}
|
processResources {
|
||||||
|
replace("velocity-plugin.json", mapOf(
|
||||||
blossom {
|
"id" to rootProject.name.lowercase(),
|
||||||
mapOf(
|
"name" to rootProject.name,
|
||||||
"ID" to rootProject.name.lowercase(Locale.ROOT),
|
"version" to project.version,
|
||||||
"NAME" to rootProject.name,
|
"description" to project.description,
|
||||||
"VERSION" to version,
|
"url" to GITHUB_REPO_URL
|
||||||
"DESCRIPTION" to description,
|
))
|
||||||
"URL" to GITHUB_REPO_URL
|
|
||||||
).forEach { (k, v) ->
|
|
||||||
replaceToken("$[$k]", v)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,8 +24,6 @@ import com.google.inject.Injector;
|
|||||||
import com.velocitypowered.api.event.Subscribe;
|
import com.velocitypowered.api.event.Subscribe;
|
||||||
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
|
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
|
||||||
import com.velocitypowered.api.event.proxy.ProxyShutdownEvent;
|
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.PluginContainer;
|
||||||
import com.velocitypowered.api.plugin.annotation.DataDirectory;
|
import com.velocitypowered.api.plugin.annotation.DataDirectory;
|
||||||
import com.velocitypowered.api.proxy.ProxyServer;
|
import com.velocitypowered.api.proxy.ProxyServer;
|
||||||
@@ -33,19 +31,6 @@ import java.nio.file.Path;
|
|||||||
import net.draycia.carbon.common.util.CarbonDependencies;
|
import net.draycia.carbon.common.util.CarbonDependencies;
|
||||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
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 {
|
public final class CarbonVelocityBootstrap {
|
||||||
|
|
||||||
private final Injector parentInjector;
|
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"
|
||||||
|
}
|
||||||
Reference in new issue
Block a user