-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
96 lines (81 loc) · 2.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
plugins {
id 'java-gradle-plugin'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '6.1.0'
}
import org.gradle.internal.jvm.Jvm
sourceCompatibility = 1.8
targetCompatibility = 1.8
archivesBaseName = "faucet"
repositories {
mavenCentral()
maven {
url = "https://maven.fabricmc.net"
name = "FabricMC"
}
maven {
url = "https://dl.bintray.com/user11681/maven"
}
maven {
name = 'GrossFabricHackers'
url = 'https://raw.githubusercontent.com/GrossFabricHackers/maven/master/'
}
}
dependencies {
shadow(implementation("net.grossfabrichackers:fabric-loader:${project.loader_version}"))
// shadow(implementation("net.gudenau.lib:unsafe:+"))
// For some reason the java gradle plugin doesn't apply this properly
implementation gradleApi()
def toolsJar = Jvm.current().toolsJar
if(toolsJar != null && toolsJar.exists()) {
implementation files(toolsJar)
}
}
processResources {
// Write transient dependencies
Properties transientDeps = new Properties()
final String transientPrefix = "transient_"
project.properties.entrySet().stream()
.filter {it.key.startsWith(transientPrefix) }
.forEach {transientDeps.put(it.key.substring(transientPrefix.length()), it.value) }
File transientDepsFile = new File(buildDir, "resources/main/META-INF/faucetTransientDependencies.properties")
if(!transientDepsFile.exists()) {
transientDepsFile.getParentFile().mkdirs()
transientDepsFile.createNewFile()
}
transientDepsFile.withOutputStream {
transientDeps.store(it, null)
}
}
gradlePlugin {
plugins {
faucet {
id = 'net.grossfabrichackers.faucet'
implementationClass = 'net.grossfabrichackers.faucet.FaucetPlugin'
}
}
}
shadowJar {
archiveClassifier.set('')
configurations = [project.configurations.shadow]
}
jar.enabled = false
assemble.dependsOn shadowJar
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
if (JavaVersion.current().isJava9Compatible()) {
it.options.release = 8
}
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact shadowJar
artifact sourcesJar
}
}
}