-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
95 lines (77 loc) · 3.14 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.parchmentmc.lodestone.tasks.*;
plugins {
// Apply the Java Gradle plugin development plugin to add support for developing Gradle plugins
id 'org.parchmentmc.writtenbooks' version '0.4.0'
// Lodestone obviously for metadata management tasks
id 'org.parchmentmc.lodestone' version '0.10.0'
// Publishing
id 'maven-publish'
}
lodestone {
mcVersion = blackstone_targets_mc_version
}
afterEvaluate {
println "MC Version: ${lodestone.resolvedMcVersion.get()}"
}
def downloadLauncherMeta = tasks.register('downloadLauncherMeta', DownloadLauncherMetadata)
def downloadVersionMeta = tasks.register('downloadVersionMeta', DownloadVersionMetadata) {
input = downloadLauncherMeta.flatMap { it.output }
}
def downloadVersion = tasks.register('downloadVersion', DownloadVersion) {
input = downloadVersionMeta.flatMap { it.output }
}
def createProGuardMetadata = tasks.register('createProGuardMetadata', ExtractMetadataFromProguardFile) {
input = downloadVersion.flatMap { it.output }.map { it.file('client.txt') }
}
def createJarMetadata = tasks.register('createJarMetadata', ExtractMetadataFromJarFiles) {
input = downloadVersion.flatMap { it.output }.map { it.file('client.jar') }
libraries = downloadVersion.flatMap { it.output }.map { it.dir('libraries') }
}
def mergeMetadata = tasks.register('mergeMetadata', MergeMetadata) {
leftSource = createJarMetadata.flatMap { it.output }
rightSource = createProGuardMetadata.flatMap { it.output }
}
def createDistribution = tasks.register('createDistribution', Zip) {
archiveFileName = lodestone.resolvedMcVersion.map { "${it}.zip" }
destinationDirectory = layout.buildDirectory.dir('dist')
from mergeMetadata.flatMap { it.output }
}
def build = tasks.register('build') {
dependsOn createDistribution
}
tasks.publish.dependsOn build
publishing {
publications {
mavenJava(MavenPublication) {
groupId = 'org.parchmentmc.data'
afterEvaluate {
version lodestone.resolvedMcVersion.get()
}
artifact createDistribution
pom {
name = 'Blackstone'
description = 'Metadata from the minecraft jar created for each published MC Version.'
url = 'https://github.com/ParchmentMC/Blackstone'
properties.put('minecraft_version', lodestone.resolvedMcVersion)
licenses {
license {
name = 'MIT'
url = 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id = 'OrionDevelopment'
name = 'Marc Hermans'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:git://github.com/parchmentmc/blackstone.git'
developerConnection = 'scm:git:https://github.com/parchmentmc/blackstone.git'
url = 'https://github.com/ParchmentMC/Blackstone'
}
}
}
}
}