-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
90 lines (77 loc) · 2.28 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
plugins {
id 'java'
id 'maven-publish'
id 'fabric-loom'
id 'com.github.johnrengelman.shadow'
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
withSourcesJar()
}
test {
useJUnitPlatform()
}
group = maven_group
archivesBaseName = archives_base_name
version = "${library_version}+${minecraft_version}"
repositories {
mavenCentral()
maven { url = 'https://maven.fabricmc.net/' }
}
dependencies {
minecraft "com.mojang:minecraft:${minecraft_version}"
mappings loom.officialMojangMappings()
modCompileOnly "net.fabricmc:fabric-loader:${loader_version}"
shadow project(':core')
compileOnly 'com.google.code.findbugs:jsr305:3.0.2'
testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_version}"
testImplementation "org.junit.jupiter:junit-jupiter-engine:${junit_version}"
testImplementation "org.mockito:mockito-core:${mockito_version}"
testImplementation "org.mockito:mockito-junit-jupiter:${mockito_version}"
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
it.options.release = 21
}
shadowJar {
configurations = [project.configurations.shadow]
archiveClassifier = 'shadow-dev'
dependencies {
exclude(dependency('com.google.code.findbugs:jsr305'))
exclude(dependency('com.mojang:brigadier'))
}
}
remapJar {
dependsOn shadowJar
inputFile = shadowJar.archiveFile.get()
}
tasks.register('shadedSourcesJar', Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
from project(':core').sourceSets.main.allSource
}
tasks.shadedSourcesJar.dependsOn compileJava
tasks.shadedSourcesJar.dependsOn shadowJar
publishing {
publications {
admiralFabric(MavenPublication) {
artifactId archives_base_name
artifact(shadowJar) {
builtBy build
classifier null
}
artifact shadedSourcesJar
}
}
repositories {
maven {
name = 'henkelmax.public'
url = 'https://maven.maxhenkel.de/repository/public'
credentials {
username System.getenv('MAVEN_USERNAME')
password System.getenv('MAVEN_PASSWORD')
}
}
}
}