-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
140 lines (111 loc) · 3.98 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
plugins {
id "com.modrinth.minotaur" version "2.+"
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'fabric-loom' version '1.7-SNAPSHOT'
id 'maven-publish'
}
version project.mod_version
group project.maven_group
var localProps = new Properties()
var localPropsFile = file("$projectDir/local.properties")
if (localPropsFile.exists()) localProps.load localPropsFile.newInputStream()
ext.localProps = localProps
apply from: 'scripts/modrinth.gradle'
apply from: 'scripts/index.gradle'
tasks.register 'publishMod'
publishMod.dependsOn tasks.named('modrinth')
processResources.dependsOn createIndex
repositories {
maven { url 'https://maven.terraformersmc.com/releases/' }
maven { url 'https://maven.isxander.dev/releases' }
maven { url 'https://jitpack.io' }
}
configurations.modApi {
// Excludes the Fabric API as otherwise the debugger will not work.
exclude group: 'net.fabricmc'
exclude group: 'net.fabricmc.fabric-api'
}
dependencies {
var apiModules = ['fabric-resource-loader-v0',
'fabric-command-api-v2',
'fabric-screen-api-v1',
'fabric-key-binding-api-v1',
'fabric-lifecycle-events-v1']
implementation "org.jetbrains:annotations:${project.jb_annotations_version}"
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
apiModules.forEach {
modImplementation(fabricApi.module(it, project.fabric_version))
}
// https://github.com/isXander/YetAnotherConfigLib/issues/111
modApi("dev.isxander:yet-another-config-lib:${project.yacl_version}") {
exclude group: 'com.twelvemonkeys.common'
exclude group: 'com.twelvemonkeys.imageio'
}
modApi "com.terraformersmc:modmenu:${project.modmenu_version}"
compileOnly "org.projectlombok:lombok:${project.lombok_version}"
annotationProcessor "org.projectlombok:lombok:${project.lombok_version}"
shadow "io.hotmoka:toml4j:${project.toml4j_version}"
shadow "net.andreinc:aleph:${project.aleph_version}"
shadow("com.github.zatrit:skinlib:${project.skinlib_version}") { transitive false }
// It is necessary to run the game client, because otherwise
// all dependencies of shadow type will not be loaded.
configurations.shadow.dependencies.forEach { implementation it }
}
processResources {
inputs.property "version", project.version
filesMatching('fabric.mod.json') {
expand 'version': project.version
}
}
remapJar {
dependsOn(shadowJar)
//noinspection GroovyAssignabilityCheck
inputFile = shadowJar.archiveFile
archiveAppendix = project.minecraft_version
}
shadowJar {
minimize()
dependencies {
exclude dependency('org.apache.commons:commons-lang3')
exclude dependency('com.google.code.gson:gson')
exclude dependency('org.jetbrains:annotations')
exclude 'META-INF/maven/**'
exclude 'META-INF/*.txt'
exclude '**/package-info.*'
}
from('license/APACHE.txt') {
rename { 'META-INF/LICENSE.txt' }
}
from('license/MIT.txt') {
rename { 'META-INF/MIT.txt' }
}
from('NOTICE.txt') {
rename { 'META-INF/NOTICE.txt' }
}
configurations = [project.configurations.shadow]
archiveBaseName = archive_base_name
archiveClassifier = 'dev'
archiveAppendix = project.minecraft_version
}
java {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
loom {
accessWidenerPath = file('src/main/resources/skins.accesswidener')
}
allprojects {
apply plugin: 'java-library'
apply plugin: 'maven-publish'
publishing {
publications {
//noinspection GroovyAssignabilityCheck
java(MavenPublication) {
//noinspection GroovyAssignabilityCheck
from components.java
}
}
}
}