forked from CardboardPowered/cardboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
133 lines (106 loc) · 4.6 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
import org.gradle.api.internal.artifacts.dependencies.DefaultExternalModuleDependency
plugins {
id 'fabric-loom' version '0.8-SNAPSHOT'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '6.1.0'
id 'java-library'
id "com.peterabeles.gversion" version "1.8.3"
}
gversion {
srcDir = "src/main/java/"
classPackage = "com.javazilla.bukkitfabric"
className = "GitVersion"
}
project.compileJava.dependsOn(createVersionFile)
sourceCompatibility = JavaVersion.VERSION_16
targetCompatibility = JavaVersion.VERSION_16
archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group
configurations {
extraLibs
removeLibs
}
minecraft {
accessWidener = file("src/main/resources/bukkitfabric.accesswidener")
}
repositories {
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url = 'https://oss.sonatype.org/content/repositories/central' }
maven { url = 'https://jitpack.io' }
maven { url = 'https://repo.codemc.io/repository/maven-releases/' }
mavenCentral()
}
configurations.all {
// Check for updates every build
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
// include( modImplementation( fileTree(dir: 'libs', include: 'paper-api-1.16.4-416.jar') ) )
// Spigot API
extraLibs fileTree(dir: 'libs', include: 'paper-api-1.16.4-416.jar')
extraLibs fileTree(dir: 'libs', include: 'commons-lang-2.6.jar')
extraLibs fileTree(dir: 'libs', include: 'slf4j3.jar')
extraLibs fileTree(dir: 'libs', include: 'jline-3.19.jar')
extraLibs group: "org.jetbrains", name: "annotations", version: "18.0.0"
extraLibs group: "com.googlecode.json-simple", name: "json-simple", version: "1.1.1"
//extraLibs "org.yaml:snakeyaml:1.27"
//
compileOnly fileTree(dir: 'libs', include: 'paper-api-1.16.4-416.jar')
compileOnly fileTree(dir: 'libs', include: 'commons-lang-2.6.jar')
compileOnly fileTree(dir: 'libs', include: 'slf4j.jar')
compileOnly fileTree(dir: 'libs', include: 'jline-3.19.jar')
compileOnly group: "org.jetbrains", name: "annotations", version: "18.0.0"
compileOnly group: "com.googlecode.json-simple", name: "json-simple", version: "1.1.1"
// compileOnly "org.yaml:snakeyaml:1.27"
include(modImplementation("org.yaml:snakeyaml:1.27"))
// NMS Remapping
extraLibs group: "com.github.OrionMinecraft", name: "SrgLib", version: "master-SNAPSHOT"
compileOnly group: "com.github.OrionMinecraft", name: "SrgLib", version: "master-SNAPSHOT"
include(modImplementation("com.github.IsaiahPatton:SpecialSource:master-SNAPSHOT"))
// (Optional) Fabric Permissions API.
modImplementation "com.javazilla.mods:permissions:1.1"
// Remove parts that are included with Minecraft or Downloaded
removeLibs group: "com.google.guava", name: "guava", version: "21.0"
removeLibs group: 'org.apache.commons', name: 'commons-lang3', version: '3.8.1'
removeLibs group: 'org.apache.commons', name: 'commons-collections4', version: '4.2'
removeLibs group: 'commons-collections', name: 'commons-collections', version: '3.2.2'
removeLibs group: 'commons-lang', name: 'commons-lang', version: '2.6'
removeLibs group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
removeLibs group: "com.github.IsaiahPatton", name: "SpecialSource", version: "31af248ea6"
//configurations.api.extendsFrom(configurations.extraLibs)
}
processResources {
inputs.property "version", project.version
duplicatesStrategy = DuplicatesStrategy.INCLUDE
from(sourceSets.main.resources.srcDirs) {
include "fabric.mod.json"
if(System.env.BUILD_NUMBER){
expand "version": System.env.BUILD_NUMBER
}
}
from(sourceSets.main.resources.srcDirs) {
exclude "fabric.mod.json"
}
}
tasks.withType(JavaCompile) { options.encoding = "UTF-8" }
jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from "LICENSE"
from {
(configurations.extraLibs - configurations.removeLibs).filter{ it.exists() }.collect { it.isDirectory() ? it : zipTree(it) }
}
exclude("**/mojang-translations/")
exclude("*.jar") // WHY GRADLE, WHY?
}
shadowJar {
configurations = [project.configurations.api]
dependencies {
exclude(dependency('com.mojang:minecraft:*'))
exclude(dependency('org.objectweb:asm:*'))
exclude(dependency('com.google.guava:guava:*'))
}
}