DataLock/build.gradle

72 lines
2.1 KiB
Groovy
Raw Normal View History

2025-06-28 02:40:23 +00:00
2022-05-09 00:58:27 +00:00
plugins {
id 'java'
id 'eclipse'
id "org.jetbrains.gradle.plugin.idea-ext" version "1.0.1"
}
group = 'com.alttd'
2025-06-28 02:40:23 +00:00
version = '1.1-SNAPSHOT'
2022-05-09 00:58:27 +00:00
repositories {
maven {
2025-06-28 02:40:23 +00:00
name = 'papermc'
url = 'https://repo.papermc.io/repository/maven-public/'
2022-05-09 00:58:27 +00:00
}
2025-06-28 02:40:23 +00:00
mavenCentral() // Add this to ensure access to JUnit libraries
2022-05-09 00:58:27 +00:00
}
dependencies {
2025-06-28 02:40:23 +00:00
compileOnly 'com.velocitypowered:velocity-api:3.4.0-SNAPSHOT'
annotationProcessor 'com.velocitypowered:velocity-api:3.4.0-SNAPSHOT'
implementation 'org.spongepowered:configurate-yaml:4.1.2'
implementation 'org.spongepowered:configurate-core:4.1.2'
// JUnit Jupiter dependencies
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.0'
// Enable JUnit tests
testImplementation 'org.junit.platform:junit-platform-launcher'
2022-05-09 00:58:27 +00:00
}
2025-06-28 02:40:23 +00:00
def targetJavaVersion = 21
2022-05-09 00:58:27 +00:00
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
}
tasks.withType(JavaCompile).configureEach {
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
options.release = targetJavaVersion
}
}
2025-06-28 02:40:23 +00:00
// Add this to run tests with JUnit Jupiter
test {
useJUnitPlatform()
}
2022-05-09 00:58:27 +00:00
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 })
rootProject.idea.project.settings.taskTriggers.afterSync generateTemplates
project.eclipse.synchronizationTasks(generateTemplates)