-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
134 lines (110 loc) · 3.71 KB
/
build.gradle
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
plugins {
id 'java'
id 'application'
id("com.gradleup.shadow") version "9.0.0-beta6"
id 'net.neoforged.gradleutils' version '3.0.0'
id 'me.modmuss50.mod-publish-plugin' version '0.5.1'
}
group = 'net.neoforged.waifu'
gradleutils.version {
tags.includeFilters.add('2.0')
}
println("Version: ${project.version = gradleutils.version}")
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
repositories {
mavenCentral()
maven {
url 'https://maven.neoforged.net/'
mavenContent {
includeGroupAndSubgroups('net.neoforged')
includeGroupAndSubgroups('cpw')
}
}
maven {
url = 'https://m2.chew.pro/releases'
}
}
application {
mainClass = 'net.neoforged.waifu.Main'
}
dependencies {
implementation 'io.javalin:javalin:6.4.0'
implementation 'org.slf4j:slf4j-simple:2.0.16'
implementation 'org.ow2.asm:asm:9.7.1'
implementation 'com.electronwill.night-config:toml:3.6.6'
implementation 'com.electronwill.night-config:json:3.6.6'
implementation 'com.google.code.gson:gson:2.11.0'
implementation 'com.google.guava:guava:33.4.0-jre'
implementation 'org.apache.maven:maven-artifact:3.9.9'
implementation "net.dv8tion:JDA:5.2.3"
implementation 'pw.chew:jda-chewtils:2.0'
// we can't bump this because of https://github.com/neoforged/AutoRenamingTool/pull/13
implementation 'net.neoforged:AutoRenamingTool:2.0.3'
implementation 'net.neoforged.installertools:binarypatcher:2.1.2'
implementation 'io.github.matyrobbrt:curseforgeapi:2.3.2'
implementation 'org.flywaydb:flyway-core:11.3.0'
runtimeOnly 'org.flywaydb:flyway-database-postgresql:11.3.0'
implementation 'org.jdbi:jdbi3-core:3.32.0'
implementation 'org.jdbi:jdbi3-sqlobject:3.32.0'
implementation 'org.jdbi:jdbi3-postgres:3.32.0'
implementation 'org.xerial:sqlite-jdbc:3.41.2.2'
implementation 'org.postgresql:postgresql:42.7.2'
implementation 'com.graphql-java:graphql-java:22.3'
implementation 'com.graphql-java:graphql-java-extended-scalars:22.0'
compileOnly 'org.jetbrains:annotations:26.0.2'
}
abstract class Log extends DefaultTask {
@OutputFile
abstract RegularFileProperty getOutput()
Log() {
outputs.upToDateWhen { false }
}
@TaskAction
void exec() {
new ProcessBuilder('git', 'log', '-5', '--pretty=oneline')
.redirectOutput(getOutput().asFile.get())
.start().waitFor()
}
}
tasks.register('gitLog', Log) {
it.output.set(project.layout.buildDirectory.file('gitlog'))
}
jar {
manifest.attributes([
'Implementation-Version': project.version
])
}
shadowJar {
mergeServiceFiles()
archiveClassifier = 'all'
archiveFile.set(project.layout.buildDirectory.file("libs/waifu-all.jar"))
from(tasks.gitLog.output)
}
tasks.register('replacePluginVersion') {
doLast {
var file = file('neoforged-waifuvis-app/package.json')
file.text = file.text.replace("\"version\": \"1.0.0\"", "\"version\": \"${project.version}\"")
}
}
tasks.register('packagePlugin', Zip) {
from(project.file('neoforged-waifuvis-app/dist')) {
into 'neoforged-waifuvis-app'
}
archiveFileName = 'waifu-plugin.zip'
}
var lastCommitMessage = new ByteArrayOutputStream()
project.exec {
commandLine('git log -1 --pretty=%B'.split(' '))
standardOutput = lastCommitMessage
}
publishMods {
file = tasks.packagePlugin.archiveFile
modLoaders.addAll('neoforge')
getChangelog().set(lastCommitMessage.toString().trim())
type = STABLE
github {
accessToken = providers.environmentVariable('GITHUB_TOKEN')
repository = 'neoforged/WhatAmIForgingUp'
commitish = 'v2'
}
}