-
Notifications
You must be signed in to change notification settings - Fork 55
/
build.gradle
145 lines (129 loc) · 4.33 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
135
136
137
138
139
140
141
142
143
144
145
buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
}
//Gradle Plugins
plugins {
id "com.matthewprenger.cursegradle" version "1.4.0"
id 'java'
id 'idea'
id "com.modrinth.minotaur" version "2.+"
id 'com.github.johnrengelman.shadow' version '8.1.1+'
id 'net.neoforged.gradle.userdev' version '7.0.109'
}
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
//Build variables
version = "3.0.7"
group = "de.erdbeerbaerlp.dcintegration"
archivesBaseName = "dcintegration-neoforge"
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
//Gradle Repositories
repositories {
maven { url 'https://jitpack.io' }
maven {
name = 'sponge'
url = 'https://repo.spongepowered.org/maven'
}
maven { url "https://repository.dev.gotan.io/repository/gotan.os/" }
maven { url "https://repo.opencollab.dev/maven-snapshots" }
maven { url "https://repo.opencollab.dev/maven-releases" }
maven {
name = 'sonatype-oss'
url = 'https://oss.sonatype.org/content/repositories/snapshots/'
}
flatDir {
dirs 'libs'
}
maven { url "https://repo.erdbeerbaerlp.de/repository/maven-public/" }
}
//ShadowJar
configurations {
embed
compileOnly.extendsFrom(embed)
}
sourceSets.main.resources { srcDir 'src/generated/resources' }
task release {
}
shadowJar {
archiveClassifier = "${project.mcVersion}"
configurations = [project.configurations.embed]
relocate 'org.slf4j', 'dcshadow.org.slf4j'
}
artifacts {
archives tasks.shadowJar
}
configurations.all {
resolutionStrategy {
cacheChangingModulesFor 1, 'minutes'
}
}
//Dependencies
dependencies {
// ========= Common =====================
embed('de.erdbeerbaerlp:dcintegration.common:3.0.7') {
changing = true
transitive = false
}
// ========= NeoForge =============
implementation "net.neoforged:neoforge:20.6.48-beta"
//Dynmap-API
compileOnly('com.github.webbukkit:DynmapCoreAPI:2.5')
}
//Manifest attributes
jar {
archiveClassifier = "${project.mcVersion}"
manifest {
attributes([
'Maven-Artifact' : "${project.group}:${project.archivesBaseName}:${project.version}",
'Timestamp' : System.currentTimeMillis(),
"Specification-Title" : "dcintegration",
"Specification-Vendor" : "dcintegration",
"Specification-Version" : "1", // We are version 1 of ourselves
"Implementation-Title" : project.name,
"Implementation-Version" : "${project.version}",
"Implementation-Vendor" : "dcintegration",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'MixinConnector' : 'de.erdbeerbaerlp.dcintegration.forge.DCMixinConnector'
])
}
}
//Curseforge publishing
curseforge {
if (project.hasProperty('curseforge.apikey')) { // $GRADLE_USER_HOME/gradle.properties
apiKey = getProperty("curseforge.apikey")
project {
id = '324952'
changelog = project.changelog
releaseType = project.releaseType.toLowerCase()
addGameVersion "${project.mcVersion}"
mainArtifact(jar) {
displayName = "DiscordIntegration-NeoForge $version (MC ${project.mcVersion})"
}
relations {
optionalDependency("luckperms")
}
}
}
}
modrinth {
if (project.hasProperty('modrinth.apikey')) { // $GRADLE_USER_HOME/gradle.properties
token = getProperty("modrinth.apikey")
projectId = 'rbJ7eS5V'
versionNumber = version + "-${project.mcVersion}"
versionName = "DiscordIntegration-NeoForge $version (MC ${project.mcVersion})"
uploadFile = shadowJar
changelog = project.changelog
gameVersions = ["${project.mcVersion}"]
loaders = ['neoforge']
versionType = project.releaseType.toUpperCase()
dependencies {
optional.project "luckperms"
}
}
}
tasks.release.dependsOn(tasks.build, tasks.curseforge, tasks.modrinth)