-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
119 lines (104 loc) · 3.2 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.util.*
plugins {
kotlin("jvm") version "1.9.20"
groovy
java
`java-gradle-plugin`
`maven-publish`
alias(libs.plugins.gradle.pluginPublish)
alias(libs.plugins.licenser)
}
group = "io.github.ladysnake"
version = project.properties["version"]!!
val functionalTest: SourceSet by sourceSets.creating
repositories {
mavenCentral()
gradlePluginPortal()
maven {
name = "Fabric"
setUrl("https://maven.fabricmc.net")
}
maven {
name = "Quilt"
setUrl("https://maven.quiltmc.org/repository/release")
}
}
dependencies {
implementation(kotlin("stdlib"))
implementation(gradleApi())
implementation(libs.artifactory)
implementation(libs.cursegradle)
implementation(libs.githubRelease)
implementation(libs.licenser)
implementation(libs.jgit)
implementation(libs.minotaur)
compileOnly(libs.loom)
runtimeOnly(libs.loom)
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
"functionalTestImplementation"(platform("org.spockframework:spock-bom:2.0-groovy-3.0"))
"functionalTestImplementation"("org.spockframework:spock-core")
}
license {
setHeader(file("src/main/resources/license_headers/LGPL.txt"))
newLine.set(false)
properties {
val currentYear = Calendar.getInstance().get(Calendar.YEAR)
val firstYear = 2022
val year = if (currentYear == firstYear) currentYear else "$firstYear-$currentYear"
ext["year"] = year
ext["projectDisplayName"] = project.properties["display_name"]
ext["projectOwners"] = project.properties["owners"]
ext["gplVersion"] = "3"
}
}
java {
withSourcesJar()
}
tasks.withType<KotlinCompile>().configureEach {
compilerOptions.freeCompilerArgs.add("-Xjvm-default=all")
}
tasks.withType<Test>().configureEach {
useJUnitPlatform()
maxHeapSize = "5G"
}
val functionalTestTask = tasks.register<Test>("functionalTest") {
description = "Runs the functional tests."
group = "verification"
testClassesDirs = functionalTest.output.classesDirs
classpath = functionalTest.runtimeClasspath
mustRunAfter(tasks.test)
}
tasks.check {
dependsOn(functionalTestTask)
}
gradlePlugin {
website.set("https://ladysnake.org/wiki/chenille")
vcsUrl.set("https://github.com/ladysnake/chenille")
testSourceSets(functionalTest)
plugins {
create("chenille") {
id = "io.github.ladysnake.chenille"
displayName = "Chenille"
description = "Helper plugin for Minecraft mods using the Fabric modloader"
implementationClass = "io.github.ladysnake.chenille.ChenilleGradlePlugin"
tags.set(listOf("fabricmc", "minecraft", "loom", "fabric-loom", "quilt-loom"))
}
}
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
publishing {
publications {
create<MavenPublication>("plugin") {
groupId = project.group.toString()
artifactId = project.name
version = project.version.toString()
from(components["java"])
}
}
}