Commit 9296cbe27586f6d210bcadc5c40a8c6819d21692
1 parent
d1ac5ae1
Add gradle build file
Showing
4 changed files
with
194 additions
and
1 deletions
.gitignore
build.gradle
0 → 100644
1 | +buildscript { | ||
2 | + repositories { | ||
3 | + mavenLocal() | ||
4 | + mavenCentral() | ||
5 | + maven { | ||
6 | + name = "forge" | ||
7 | + url = "http://files.minecraftforge.net/maven" | ||
8 | + } | ||
9 | + maven { | ||
10 | + name = "sonatype" | ||
11 | + url = "https://oss.sonatype.org/content/repositories/snapshots/" | ||
12 | + } | ||
13 | + } | ||
14 | + dependencies { | ||
15 | + classpath 'net.minecraftforge.gradle:ForgeGradle:2.0-SNAPSHOT' | ||
16 | + } | ||
17 | +} | ||
18 | + | ||
19 | +apply plugin: 'net.minecraftforge.gradle.tweaker-client' | ||
20 | +apply plugin: 'maven' | ||
21 | + | ||
22 | +// Artefact details | ||
23 | +ext.buildNumber = project.hasProperty("buildNumber") ? buildNumber : '0' | ||
24 | +ext.ciSystem = project.hasProperty("ciSystem") ? ciSystem : 'unknown' | ||
25 | +ext.commit = project.hasProperty("commit") ? commit : 'unknown' | ||
26 | +ext.classifier = project.hasProperty("buildType") ? buildType : 'SNAPSHOT' | ||
27 | +ext.isReleaseBuild = "RELEASE".equals(project.classifier.toUpperCase()) | ||
28 | +ext.mavenRepo = project.isReleaseBuild ? "mavenUrl" : "mavenSnapshotUrl" | ||
29 | + | ||
30 | +// Basic project information | ||
31 | +group = "com.mumfrey" | ||
32 | +archivesBaseName = "liteloader" | ||
33 | +version = buildVersion + (project.isReleaseBuild ? '' : '-' + project.classifier) | ||
34 | + | ||
35 | +// Extended project information | ||
36 | +ext.projectName = 'LiteLoader' | ||
37 | +ext.inceptionYear = '2012' | ||
38 | +ext.packaging = 'jar' | ||
39 | + | ||
40 | +ext.startClass = 'com.mumfrey.liteloader.debug.Start' | ||
41 | +ext.tweakClass = 'com.mumfrey.liteloader.launch.LiteLoaderTweaker' | ||
42 | + | ||
43 | +// Minimum version of Java required | ||
44 | +sourceCompatibility = '1.6' | ||
45 | +targetCompatibility = '1.6' | ||
46 | + | ||
47 | +minecraft { | ||
48 | + version = project.mcVersion | ||
49 | + mappings = project.mcMappings | ||
50 | + runDir = "run" | ||
51 | + tweakClass = project.tweakClass | ||
52 | +} | ||
53 | + | ||
54 | +sourceSets { | ||
55 | + client { | ||
56 | + compileClasspath += main.compileClasspath + main.output | ||
57 | + } | ||
58 | + debug { | ||
59 | + compileClasspath += client.compileClasspath + client.output | ||
60 | + } | ||
61 | +} | ||
62 | + | ||
63 | +javadoc { | ||
64 | + source sourceSets.client.allJava | ||
65 | + source sourceSets.debug.allJava | ||
66 | +} | ||
67 | + | ||
68 | +// hacks for run configs | ||
69 | +afterEvaluate { | ||
70 | + def mc = plugins.getPlugin 'net.minecraftforge.gradle.tweaker-client' | ||
71 | + mc.replacer.putReplacement '{RUN_CLIENT_MAIN}', project.startClass | ||
72 | + mc.replacer.putReplacement '{RUN_CLIENT_TWEAKER}', minecraft.tweakClass | ||
73 | +} | ||
74 | + | ||
75 | +// manifest entries for all jars | ||
76 | +def jarManifest = { | ||
77 | + mainAttributes ( | ||
78 | + 'Built-By': System.properties['user.name'], | ||
79 | + 'Created-By': System.properties['java.vm.version'] + " (" + System.properties['java.vm.vendor'] + ")", | ||
80 | + 'Implementation-Title': name, | ||
81 | + 'Implementation-Version': version + "+" + ciSystem + "-b" + buildNumber + ".git-" + commit, | ||
82 | + 'Implementation-Vendor': url | ||
83 | + ) | ||
84 | +} | ||
85 | + | ||
86 | +jar { | ||
87 | + from sourceSets.client.output | ||
88 | + from sourceSets.debug.output | ||
89 | + manifest jarManifest | ||
90 | +} | ||
91 | + | ||
92 | +task releaseJar(type: Jar) { | ||
93 | + from sourceSets.main.output | ||
94 | + from sourceSets.client.output | ||
95 | + manifest jarManifest | ||
96 | + classifier = 'release' | ||
97 | +} | ||
98 | + | ||
99 | +task javadocJar(type: Jar, dependsOn: javadoc) { | ||
100 | + from javadoc.destinationDir | ||
101 | + classifier = 'javadoc' | ||
102 | +} | ||
103 | + | ||
104 | +// Hey @AbrarSyed why can't we just turn this off >:( | ||
105 | +task runClient(type: JavaExec, overwrite: true) { | ||
106 | + doFirst { | ||
107 | + println "Do not use runClient, it is not compatible with Mixin" | ||
108 | + System.exit(-1) | ||
109 | + } | ||
110 | +} | ||
111 | + | ||
112 | +tasks.withType(JavaCompile) { | ||
113 | + options.compilerArgs += ['-Xlint:all', '-Xlint:-path'] | ||
114 | + options.deprecation = true | ||
115 | + options.encoding = 'utf8' | ||
116 | +} | ||
117 | + | ||
118 | +if (JavaVersion.current().isJava8Compatible()) { | ||
119 | + tasks.withType(Javadoc) { | ||
120 | + // disable the crazy super-strict doclint tool in Java 8 | ||
121 | + options.addStringOption('Xdoclint:none', '-quiet') | ||
122 | + } | ||
123 | +} | ||
124 | + | ||
125 | +reobf { | ||
126 | + jar { | ||
127 | + useSrgSrg() | ||
128 | + } | ||
129 | + releaseJar { | ||
130 | + useNotchSrg() | ||
131 | + classpath = sourceSets.main.compileClasspath | ||
132 | + } | ||
133 | +} | ||
134 | + | ||
135 | +compileJava.doFirst { | ||
136 | + println '------------------------------------------------------------' | ||
137 | + println 'Running ' + (project.isReleaseBuild ? "RELEASE" : "SNAPSHOT") + ' build' | ||
138 | + println '------------------------------------------------------------' | ||
139 | +} | ||
140 | + | ||
141 | +build.dependsOn "reobfReleaseJar" | ||
142 | + | ||
143 | +artifacts { | ||
144 | + if (project.isReleaseBuild) { | ||
145 | + archives jar | ||
146 | + } | ||
147 | + archives releaseJar | ||
148 | + archives sourceJar | ||
149 | + archives javadocJar | ||
150 | +} | ||
151 | + | ||
152 | +uploadArchives { | ||
153 | + repositories { | ||
154 | + mavenDeployer { | ||
155 | + if (project.hasProperty(project.mavenRepo)) { | ||
156 | + repository(url: project.getProperty(project.mavenRepo)) { | ||
157 | + authentication(userName: project.mavenUsername, password: project.mavenPassword) | ||
158 | + } | ||
159 | + } | ||
160 | + pom { | ||
161 | + groupId = project.group | ||
162 | + version = project.version | ||
163 | + artifactId = project.archivesBaseName | ||
164 | + project { | ||
165 | + name project.archivesBaseName | ||
166 | + packaging 'jar' | ||
167 | + description 'LiteLoader' | ||
168 | + url 'http://www.liteloader.com/' | ||
169 | + scm { | ||
170 | + url 'http://develop.liteloader.com/liteloader/LiteLoader' | ||
171 | + connection 'scm:git:http://develop.liteloader.com/liteloader/LiteLoader.git' | ||
172 | + developerConnection 'scm:git:http://develop.liteloader.com/liteloader/LiteLoader.git' | ||
173 | + } | ||
174 | + issueManagement { | ||
175 | + system 'GitLab Issues' | ||
176 | + url 'http://develop.liteloader.com/liteloader/LiteLoader/issues' | ||
177 | + } | ||
178 | + } | ||
179 | + } | ||
180 | + } | ||
181 | + } | ||
182 | +} |
gradle.properties
0 → 100644
src/main/java/com/mumfrey/liteloader/util/ChatUtilities.java
@@ -120,7 +120,7 @@ public abstract class ChatUtilities | @@ -120,7 +120,7 @@ public abstract class ChatUtilities | ||
120 | return component; | 120 | return component; |
121 | } | 121 | } |
122 | 122 | ||
123 | - for (IChatComponent oldSibling : ChatUtilities.covertCodesInPlace(component.getSiblings())) | 123 | + for (IChatComponent oldSibling : ChatUtilities.covertCodesInPlace((List<IChatComponent>)component.getSiblings())) |
124 | { | 124 | { |
125 | newComponent.appendSibling(oldSibling); | 125 | newComponent.appendSibling(oldSibling); |
126 | } | 126 | } |