update gradle configuration and wrapper

This commit is contained in:
UrAvgCode 2025-11-05 23:44:31 +01:00
parent 9828227f41
commit 84ee6ac378
No known key found for this signature in database
GPG key ID: 8A76A22B2CDDD634
8 changed files with 77 additions and 56 deletions

5
.gitignore vendored
View file

@ -4,7 +4,7 @@
# log file # log file
*.log *.log
# package files # # package files
*.jar *.jar
*.war *.war
*.nar *.nar
@ -24,3 +24,6 @@ gradle-app.setting
# intellij # intellij
.idea/ .idea/
# server
run/

View file

@ -1,52 +0,0 @@
plugins {
id("java")
id("org.jetbrains.gradle.plugin.idea-ext") version "1.3"
id("xyz.jpenilla.run-velocity") version "3.0.0"
}
group = 'com.uravgcode'
version = '1.0'
repositories {
mavenCentral()
maven {
name = "papermc-repo"
url = "https://repo.papermc.io/repository/maven-public/"
}
}
dependencies {
compileOnly("com.velocitypowered:velocity-api:3.4.0-SNAPSHOT")
annotationProcessor("com.velocitypowered:velocity-api:3.4.0-SNAPSHOT")
}
tasks {
runVelocity {
velocityVersion("3.4.0-SNAPSHOT")
}
}
def targetJavaVersion = 21
java {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.release.set(targetJavaVersion)
}
def templateSource = file('src/main/templates')
def templateDest = layout.buildDirectory.dir('generated/sources/templates')
def generateTemplates = tasks.register('generateTemplates', Copy) { task ->
def props = ['version': project.version]
task.inputs.properties props
task.from templateSource
task.into templateDest
task.expand props
}
sourceSets.main.java.srcDir(generateTemplates.map { it.outputs })
project.idea.project.settings.taskTriggers.afterSync generateTemplates

45
build.gradle.kts Normal file
View file

@ -0,0 +1,45 @@
plugins {
java
alias(libs.plugins.run.velocity)
}
group = "com.uravgcode"
version = "1.0"
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}
dependencies {
compileOnly(libs.velocity.api)
annotationProcessor(libs.velocity.api)
}
tasks {
withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
options.release.set(21)
}
runVelocity {
velocityVersion("3.4.0-SNAPSHOT")
}
}
val templateSource = file("src/main/templates")
val templateDest = layout.buildDirectory.dir("generated/sources/templates")
val generateTemplates by tasks.registering(Copy::class) {
val props = mapOf("version" to project.version)
inputs.properties(props)
from(templateSource)
into(templateDest)
expand(props)
}
sourceSets {
named("main") {
java.srcDir(generateTemplates.map { it.outputs })
}
}

View file

@ -0,0 +1,9 @@
[versions]
velocity-api = "3.4.0-SNAPSHOT"
run-task = "3.0.2"
[libraries]
velocity-api = { module = "com.velocitypowered:velocity-api", version.ref = "velocity-api" }
[plugins]
run-velocity = { id = "xyz.jpenilla.run-velocity", version.ref = "run-task" }

Binary file not shown.

View file

@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionSha256Sum=a17ddd85a26b6a7f5ddb71ff8b05fc5104c0202c6e64782429790c933686c806 distributionSha256Sum=df67a32e86e3276d011735facb1535f64d0d88df84fa87521e90becc2d735444
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

View file

@ -1 +0,0 @@
rootProject.name = 'global-whitelist'

17
settings.gradle.kts Normal file
View file

@ -0,0 +1,17 @@
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
}
}
@Suppress("UnstableApiUsage")
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven(uri("https://repo.papermc.io/repository/maven-public/"))
}
}
rootProject.name = "global-whitelist"