-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
119 lines (104 loc) · 3.81 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
plugins {
id 'java'
id 'java-library'
id 'application'
id "com.github.johnrengelman.shadow" version "7.1.2"
}
project.version = '0.4.0'
def minicraftVerison = "2.0.7"
sourceCompatibility = 8
mainClassName = 'io.github.anvilloystudio.minimods.loader.LoaderInitialization'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
repositories {
mavenCentral()
maven { url "https://nexus.velocitypowered.com/repository/maven-public/" }
maven { url = 'https://maven.minecraftforge.net/' }
}
dependencies {
// Minicraft+ base code dependencies. Updated for every version.
api project(path: ":minicraft-base", configuration: "shadow")
api 'org.jetbrains:annotations:21.0.1'
// api 'org.xbill:dns:2.0.8'
api 'commons-codec:commons-codec:1.15'
api 'commons-io:commons-io:2.4'
api 'commons-logging:commons-logging:1.2'
api 'dnsjava:dnsjava:3.4.1'
api 'org.apache.httpcomponents:httpasyncclient:4.1.4'
api 'org.apache.httpcomponents:httpclient:4.5.13'
api 'org.apache.httpcomponents:httpcore:4.4.14'
api 'org.apache.httpcomponents:httpcore-nio:4.4.14'
api 'org.apache.httpcomponents:httpmime:4.5.13'
api 'org.json:json:20210307'
api 'org.slf4j:slf4j-api:1.7.32'
api 'com.mashape.unirest:unirest-java:1.4.9'
api 'org.apache.xmlgraphics:xmlgraphics-commons:2.6'
testImplementation 'org.hamcrest:hamcrest:2.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.2'
// Future Minicraft+ version implementation.
api 'org.json:json:20211205'
api 'com.konghq:unirest-java:3.13.7'
api 'org.tinylog:tinylog-api:2.4.1'
api 'org.tinylog:tinylog-impl:2.4.1'
// Main Loader dependencies.
implementation "org.spongepowered:mixin:0.8.5"
annotationProcessor "org.spongepowered:mixin:0.8.5:processor"
implementation "net.java.dev.jna:jna:5.12.1"
implementation "net.java.dev.jna:jna-platform:5.12.1"
implementation "com.github.oshi:oshi-core:6.2.2"
api "com.electronwill.night-config:toml:3.6.0"
runtimeOnly 'net.minecraftforge:accesstransformers:8.0.4'
implementation('org.apache.maven:maven-artifact:3.8.1')
implementation fileTree(dir: 'libraries', include: '*.jar')
// Dependencies of mixin.
api "org.ow2.asm:asm:9.3"
api "org.ow2.asm:asm-tree:9.3"
api "org.ow2.asm:asm-util:9.3"
api "org.ow2.asm:asm-commons:9.3"
api 'com.google.guava:guava:31.1-jre'
}
java {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
javadoc {
source = sourceSets.main.allJava
classpath = configurations.compileClasspath
}
jar {
delete(file("build/libs"))
file("build/libs/lib").mkdirs()
def paths = [];
configurations.runtimeClasspath.each { dir ->
def des = "lib/"
if (dir.getName().startsWith("minicraft_plus")) { des = "" }
if (dir.getName().startsWith("minicraft-base")) { return }
paths.add(des + dir.getName())
copy {
from dir
into "build/libs/" + des
}
}
archivesBaseName = "minimods-${minicraftVerison}"
archiveClassifier.set('')
manifest {
attributes(
'Main-Class': mainClassName,
'Implementation-Title': project.name,
'Implementation-Version': project.version,
'SplashScreen-Image': "Minicraft_Splash_Screen_3.png",
'Class-Path': String.join(" ", paths) // Adding class paths
)
}
}
shadowJar {
archivesBaseName = "minimods-${minicraftVerison}"
manifest {
attributes(
'Main-Class': mainClassName,
'Implementation-Title': project.name,
'Implementation-Version': project.version,
'SplashScreen-Image': "Minicraft_Splash_Screen_3.png",
)
}
}