Switch to gradle

This commit is contained in:
Len 2026-07-26 01:39:02 -05:00
parent 110caa9d3f
commit 9aa3993f56
6 changed files with 69 additions and 60 deletions

3
.gitignore vendored
View File

@ -37,3 +37,6 @@ target/
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid* hs_err_pid*
.gradle/
build/
!gradle/wrapper/gradle-wrapper.jar

27
build.gradle.kts Normal file
View File

@ -0,0 +1,27 @@
plugins {
java
}
group = "com.alttd.destro174.custommotd"
version = System.getenv("BUILD_NUMBER") ?: "DEV"
description = "Allows setting custom MOTD in-game."
dependencies {
compileOnly("com.alttd.cosmos:cosmos-api:26.2.build.17-stable")
compileOnly("me.clip:placeholderapi:2.12.3")
}
tasks {
withType<JavaCompile> {
options.encoding = Charsets.UTF_8.name()
}
withType<Javadoc> {
options.encoding = Charsets.UTF_8.name()
}
jar {
archiveFileName.set("${rootProject.name}.jar")
}
}

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

60
pom.xml
View File

@ -1,60 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.alttd.destro174.custommotd</groupId>
<artifactId>CustomMOTD</artifactId>
<version>1.0</version>
<build>
<finalName>${project.artifactId}</finalName>
<defaultGoal>clean package</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>plugin.yml</include>
<include>MOTD.yml</include>
<include>counter.yml</include>
<include>config.yml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</build>
<repositories>
<repository>
<id>placeholderapi</id>
<url>http://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.destroystokyo.paper</groupId>
<artifactId>paper</artifactId>
<version>1.16.3-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.10.9</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

34
settings.gradle.kts Normal file
View File

@ -0,0 +1,34 @@
rootProject.name = "CustomMOTD"
val nexusUser = providers.gradleProperty("alttdSnapshotUsername").orNull ?: System.getenv("NEXUS_USERNAME")
val nexusPass = providers.gradleProperty("alttdSnapshotPassword").orNull ?: System.getenv("NEXUS_PASSWORD")
dependencyResolutionManagement {
repositories {
mavenLocal()
mavenCentral()
maven {
url = uri("https://repo.alttd.com/repository/alttd-snapshot/")
credentials {
username = nexusUser
password = nexusPass
}
}
maven {
url = uri("https://repo.alttd.com/repository/alttd/")
credentials {
username = nexusUser
password = nexusPass
}
}
maven("https://repo.extendedclip.com/releases/")
maven("https://repo.destro.xyz/snapshots")
}
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
}
pluginManagement {
repositories {
gradlePluginPortal()
}
}