-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
127 lines (109 loc) · 3.39 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
plugins {
id 'java'
id 'io.github.juuxel.loom-quiltflower' version '1.8.+'
id 'fabric-loom' version "1.3.+"
id 'maven-publish'
id 'com.modrinth.minotaur' version "2.+"
id 'io.freefair.lombok' version "8.1.+"
id 'org.quiltmc.gradle.licenser' version "1.+"
}
group = project.maven_group
version = project.version
archivesBaseName = "AxolotlClient-OldAnimations"
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
repositories {
maven {
url = "https://moehreag.duckdns.org/maven/releases"
}
maven {
name = "legacy-fabric"
url = "https://repo.legacyfabric.net/repository/legacyfabric/"
}
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
mavenCentral()
}
loom {
setIntermediaryUrl('https://maven.legacyfabric.net/net/fabricmc/intermediary/%1$s/intermediary-%1$s-v2.jar')
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_18}"
mappings "net.legacyfabric:yarn:${project.mappings_18}"
modImplementation "net.fabricmc:fabric-loader:${project.fabric_loader}"
modCompileOnly("io.github.axolotlclient:AxolotlClient:${project.client}+${project.minecraft_18}") {
transitive = false
}
modImplementation "io.github.axolotlclient:AxolotlClient-config:${project.config}+${project.minecraft_18}"
include "io.github.axolotlclient:AxolotlClient-config:${project.config}+${project.minecraft_18}"
modImplementation "io.github.axolotlclient.AxolotlClient-config:AxolotlClientConfig-common:${project.config}"
modImplementation "maven.modrinth:legacy-mod-menu:1.1.0"
}
processResources {
inputs.property 'version', version
filesMatching('fabric.mod.json') {
expand "version": version
}
}
java {
withSourcesJar()
}
license {
rule file('HEADER')
include '**/*.java'
}
// Configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = archivesBaseName
from components.java
}
}
repositories {
maven {
name = "owlMaven"
def repository = project.version.toString().contains("beta") || project.version.toString().contains("alpha") ? "snapshots" : "releases"
url = "https://moehreag.duckdns.org/maven/" + repository
credentials(PasswordCredentials)
authentication {
basic(BasicAuthentication)
}
}
}
}
modrinth {
token = System.getenv("MODRINTH_TOKEN")
projectId = "UD5CuiYt"
versionNumber = "${project.version}"
versionType = "release"
uploadFile = remapJar
gameVersions.set(["${project.minecraft_18}"])
loaders.set(["fabric", "quilt"])
additionalFiles.set([remapSourcesJar])
// Changelog fetching: Credit LambdAurora.
// https://github.com/LambdAurora/LambDynamicLights/blob/1ef85f486084873b5d97b8a08df72f57859a3295/build.gradle#L145
// License: MIT
def changelogText = file('CHANGELOG.md').text
def regexVersion = ((String) project.version).split("\\+")[0].replaceAll('\\.', /\\./).replaceAll('\\+', '\\+')
def changelogRegex = ~"###? ${regexVersion}\\n\\n(( *- .+\\n)+)"
def matcher = changelogText =~ changelogRegex
if (matcher.find()) {
def changelogContent = matcher.group(1)
def changelogLines = changelogText.split('\n')
def linkRefRegex = ~'^\\[([A-z0-9 _\\-/+.]+)]: '
for (int i = changelogLines.length - 1; i > 0; i--) {
def line = changelogLines[i]
if ((line =~ linkRefRegex).find())
changelogContent += '\n' + line
else break
}
changelog = changelogContent
} else {
afterEvaluate {
tasks.modrinth.setEnabled(false)
}
}
}