forked from MinecraftForge/LegacyDev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
133 lines (119 loc) · 4.05 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
plugins {
id 'java'
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'org.cadixdev.licenser' version '0.6.1'
id 'org.ajoberstar.grgit' version '4.0.0'
}
ext {
TAG = '0.0'
}
def gitVersion = {
def raw = grgit.describe(longDescr: true, tags: true)
def desc = (raw == null ? '0.0-0-unknown' : grgit.describe(longDescr: true, tags: true)).split('-') as List
def hash = desc.remove(desc.size() - 1)
def offset = desc.remove(desc.size() - 1)
TAG = desc.join('-')
def branch = grgit.branch.current().name
if (branch in ['master', 'HEAD'])
branch = null
if (branch != null && branch.endsWith('.x') && TAG.equals(branch.substring(0, branch.length() - 2)))
branch = null
return "${TAG}.${offset}${t -> if (branch != null) t << '-' + branch}".toString()
}
group = 'net.minecraftforge'
archivesBaseName = 'legacydev'
version = gitVersion()
targetCompatibility = sourceCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
license {
header project.file('LICENSE-header.txt')
ext["year"] = '2016-' + Calendar.getInstance().get(Calendar.YEAR)
include 'net/minecraftforge/legacydev/**/*.java'
newLine false
}
ext {
MANIFEST = manifest {
attributes([
'Specification-Title' : 'accesstransformers',
'Specification-Vendor' : 'Forge Development LLC',
'Specification-Version' : TAG,
'Implementation-Title' : project.name,
'Implementation-Version' : "${version}+${System.getenv("BUILD_NUMBER") ?: 0}+${grgit.head().abbreviatedId}",
'Implementation-Vendor' : 'Forge Development LLC',
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'Git-Commit' : grgit.head().abbreviatedId,
'Git-Branch' : grgit.branch.current().getName()
] as LinkedHashMap, 'net/minecraftforge/legacydev/')
}
}
repositories {
mavenCentral()
maven {
name 'mojang'
url 'https://libraries.minecraft.net/'
}
}
dependencies {
implementation 'net.sf.jopt-simple:jopt-simple:5.0.4'
implementation('net.minecraft:launchwrapper:1.12') {
exclude group: 'org.ow2.asm'
}
implementation 'com.google.guava:guava:21.0'
}
compileJava {
options.encoding = 'UTF-8'
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
manifest.from(MANIFEST)
}
artifacts {
archives sourcesJar
}
jar {
manifest.from(MANIFEST)
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact sourcesJar
artifact jar
pom {
name = project.archivesBaseName
packaging = 'jar'
description = 'Minecraft Forge Legacy Dev'
url = 'https://github.com/MinecraftForge/LegacyDev'
scm {
url = 'https://github.com/MinecraftForge/LegacyDev'
connection = 'scm:git:git://github.com/MinecraftForge/LegacyDev.git'
developerConnection = 'scm:git:[email protected]:MinecraftForge/LegacyDev.git'
}
issueManagement {
system = 'github'
url = 'https://github.com/MinecraftForge/LegacyDev/issues'
}
developers {
developer {
id = 'LexManos'
name = 'Lex Manos'
}
}
}
}
}
repositories {
maven {
if (project.hasProperty('forgeMavenPassword')) {
credentials {
username project.properties.forgeMavenUser
password project.properties.forgeMavenPassword
}
url 'https://files.minecraftforge.net/maven/manage/upload'
} else {
url 'file://' + rootProject.file('repo').getAbsolutePath()
}
}
}
}