-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
95 lines (81 loc) · 2.37 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
import org.gradle.util.GradleVersion
plugins {
id 'java-library'
id 'java-gradle-plugin'
// id 'checkstyle'
id 'maven-publish'
}
group = 'net.legacyfabric'
version = project.multi_filament_version
def ENV = System.getenv()
repositories {
maven {
name "Fabric Repository"
url 'https://maven.fabricmc.net'
}
mavenCentral()
mavenLocal()
}
dependencies {
implementation "org.ow2.asm:asm:${project.asm_version}"
implementation "org.ow2.asm:asm-tree:${project.asm_version}"
implementation "net.fabricmc.unpick:unpick-format-utils:${project.unpick_version}"
implementation "net.fabricmc:mapping-io:0.5.1"
implementation "cuchaz:enigma-cli:${project.enigma_version}"
implementation "net.fabricmc:name-proposal:${project.name_proposal_version}"
implementation "net.fabricmc:fabric-filament:0.7.1"
implementation("net.fabricmc:fabric-loader:0.15.6")
implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.4.2'
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.release = 17
}
test {
useJUnitPlatform()
}
//checkstyle {
// configFile = file('checkstyle.xml')
// toolVersion = '10.3.3'
//}
gradlePlugin {
plugins {
filament {
id = 'net.legacyfabric.multifilament'
implementationClass = 'net.legacyfabric.multifilament.MultiFilamentGradlePlugin'
}
}
}
publishing {
repositories {
if (ENV.MAVEN_PUBLISH_CREDENTIALS) {
maven {
url "https://repo.legacyfabric.net/repository/legacyfabric"
credentials {
username ENV.MAVEN_PUBLISH_CREDENTIALS.split(":")[0]
password ENV.MAVEN_PUBLISH_CREDENTIALS.split(":")[1]
}
authentication {
basic(BasicAuthentication)
}
}
}
}
}
/**
* Run this task to download the gradle sources next to the api jar, you may need to manually attach the sources jar
*/
task downloadGradleSources() {
doLast {
// Awful hack to find the gradle api location
def gradleApiFile = project.configurations.detachedConfiguration(dependencies.gradleApi()).files.stream()
.filter {
it.name.startsWith("gradle-api")
}.findFirst().orElseThrow()
def gradleApiSources = new File(gradleApiFile.absolutePath.replace(".jar", "-sources.jar"))
def url = "https://services.gradle.org/distributions/gradle-${GradleVersion.current().getVersion()}-src.zip"
gradleApiSources.delete()
println("Downloading (${url}) to (${gradleApiSources})")
gradleApiSources << new URL(url).newInputStream()
}
}