forked from ImpactDevelopment/UserDev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
98 lines (87 loc) · 3.12 KB
/
build.gradle
File metadata and controls
98 lines (87 loc) · 3.12 KB
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
import groovy.json.JsonBuilder
import java.text.SimpleDateFormat
plugins {
id 'java'
id 'maven-publish'
}
ext {
RELEASE = 1 // Bump when making additional releases to a given mc version
MC_VERSION = '1.14.4'
MCP_VERSION = '20190829.143755'
BINPATCH_VERSION = '1.0.5'
SPEC_VERSION = 1
}
group = 'net.impactclient'
version = "${MC_VERSION}-${RELEASE}"
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
compileJava {
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
}
repositories {
// mavenLocal()
maven {
name = 'mojang'
url = 'https://libraries.minecraft.net'
}
maven {
name = 'forge'
url = 'http://files.minecraftforge.net/maven'
}
jcenter()
mavenCentral()
}
dependencies {
implementation 'org.apache.logging.log4j:log4j-api:2.11.2'
implementation 'org.apache.logging.log4j:log4j-core:2.11.2'
implementation 'com.mojang:authlib:1.5.25'
implementation 'cpw.mods:modlauncher:3.2.+'
implementation 'org.apache.commons:commons-lang3:3.9'
}
processResources {
def resources = sourceSets.main.output.resourcesDir
resources.mkdirs()
new File(resources, 'config.json').text = new JsonBuilder([
// TODO: can we just not list any binpatches?
// can we pass something like --help instead of --apply?
// can we not a binpatcher archive so it doesn't even download?
'mcp': "de.oceanlabs.mcp:mcp_config:${MC_VERSION}-${MCP_VERSION}@zip",
'binpatches': 'joined.lzma', // File generated by giving binarypatcher two identical jars lol:
'binpatcher': [
'version': "net.minecraftforge:binarypatcher:${BINPATCH_VERSION}:fatjar",
'args': [ '--clean', '{clean}', '--output', '{output}', '--apply', '{patch}' ]
],
'patches': 'patches/',
'inject': 'inject/',
'spec': SPEC_VERSION
]).toPrettyString()
}
jar {
classifier 'userdev'
manifest {
attributes(
'Specification-Title': 'Vanilla User Development',
'Specification-Vendor': 'ImpactDevelopment',
'Specification-Version': SPEC_VERSION,
'Implementation-Title': project.group,
'Implementation-Version': project.version,
'Implementation-Vendor': 'ImpactDevelopment',
'Build-Timestamp': new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date()),
'Created-By': "Gradle ${gradle.gradleVersion}",
'Build-Jdk': "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})",
'Build-OS': "${System.properties['os.name']} ${System.properties['os.arch']} ${System.properties['os.version']}"
)
}
}
publishing {
repositories {
maven {
// change to point to your repo, e.g. http://my.org/repo
url = "$buildDir/maven"
}
}
publications {
myLibrary(MavenPublication) {
from components.java
}
}
}