-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
133 lines (118 loc) · 5.04 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'
}
compileJava.options.encoding = 'UTF-8'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
apply plugin:'application'
applicationDefaultJvmArgs = ["-Djava.library.path=natives"]
mainClassName = 'Start'
group 'dev.galaxyproject'
version '1.1-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
jcenter()
maven { url 'https://jitpack.io' }
ivy {
url 'https://libraries.minecraft.net/'
layout 'pattern', {
artifact "[organisation]/[module]/[revision].[ext]"
m2compatible = true
}
}
}
def currentOs(){
def osName = System.properties['os.name'].toLowerCase()
def path = ""
if(osName.contains("windows")){
path = System.getProperty("user.home")+"\\AppData\\Roaming\\.minecraft"
}else if(osName.contains("mac os")){
path = "~/Library/Application Support/minecraft"
}else{
path = System.getProperty("user.home")+"/.minecraft"
}
return path;
}
configurations {
extraLibs
runtime
}
jar {
from {
configurations.extraLibs.collect { it.isDirectory() ? it : zipTree(it) }
}
}
dependencies {
runtime 'commons-lang:commons-lang:2.6'
compile 'com.mojang.netty:1.6:netty-1.6@jar',
'oshi-project.oshi-core:1.1:oshi-core-1.1@jar',
'net.java.dev.jna.jna:3.4.0:jna-3.4.0@jar',
'net.java.dev.jna.platform:3.4.0:platform-3.4.0@jar',
'com.ibm.icu.icu4j-core-mojang:51.2:icu4j-core-mojang-51.2@jar',
'net.sf.jopt-simple.jopt-simple:4.6:jopt-simple-4.6@jar',
'com.paulscode.codecjorbis:20101023:codecjorbis-20101023@jar',
'com.paulscode.codecwav:20101023:codecwav-20101023@jar',
'com.paulscode.libraryjavasound:20101123:libraryjavasound-20101123@jar',
'com.paulscode.librarylwjglopenal:20100824:librarylwjglopenal-20100824@jar',
'org.lwjgl.lwjgl.lwjgl:2.9.4-nightly-20150209:lwjgl-2.9.4-nightly-20150209@jar',
'org.lwjgl.lwjgl.lwjgl_util:2.9.4-nightly-20150209:lwjgl_util-2.9.4-nightly-20150209@jar',
'org.lwjgl.lwjgl.lwjgl_util:2.9.2-nightly-20140822:lwjgl_util-2.9.2-nightly-20140822@jar',
'com.paulscode.soundsystem:20120107:soundsystem-20120107@jar',
'io.netty.netty-all:4.0.23.Final:netty-all-4.0.23.Final@jar',
'com.google.guava.guava:17.0:guava-17.0@jar',
'org.apache.commons.commons-lang3:3.3.2:commons-lang3-3.3.2@jar',
'commons-io.commons-io:2.4:commons-io-2.4@jar',
'commons-codec.commons-codec:1.9:commons-codec-1.9@jar',
'net.java.jinput.jinput:2.0.5:jinput-2.0.5@jar',
'net.java.jutils.jutils:1.0.0:jutils-1.0.0@jar',
'com.google.code.gson.gson:2.2.4:gson-2.2.4@jar',
'com.mojang.authlib:1.5.21:authlib-1.5.21@jar',
'com.mojang.realms:1.7.59:realms-1.7.59@jar',
'org.apache.commons.commons-compress:1.8.1:commons-compress-1.8.1@jar',
'org.apache.httpcomponents.httpclient:4.3.3:httpclient-4.3.3@jar',
'commons-logging.commons-logging:1.1.3:commons-logging-1.1.3@jar',
'org.apache.httpcomponents.httpcore:4.3.2:httpcore-4.3.2@jar',
'org.apache.logging.log4j.log4j-api:2.0-beta9:log4j-api-2.0-beta9@jar',
'org.apache.logging.log4j.log4j-core:2.0-beta9:log4j-core-2.0-beta9@jar',
'tv.twitch.twitch:6.5:twitch-6.5@jar',
'tv.twitch.twitch-platform:6.5:twitch-platform-6.5-natives-windows-32@jar',
'tv.twitch.twitch-platform:6.5:twitch-platform-6.5-natives-windows-64@jar',
'tv.twitch.twitch-external-platform:4.5:twitch-external-platform-4.5-natives-windows-32@jar',
'tv.twitch.twitch-external-platform:4.5:twitch-external-platform-4.5-natives-windows-64@jar',
'net.java.jinput.jinput-platform:2.0.5:jinput-platform-2.0.5-natives-windows@jar',
'org.lwjgl.lwjgl.lwjgl-platform:2.9.2-nightly-20140822:lwjgl-platform-2.9.2-nightly-20140822-natives-linux@jar',
'org.lwjgl.lwjgl.lwjgl-platform:2.9.4-nightly-20150209:lwjgl-platform-2.9.4-nightly-20150209-natives-windows@jar',
'net.java.jinput.jinput-platform:2.0.5:jinput-platform-2.0.5-natives-linux@jar',
'org.jsoup:jsoup:1.12.1'
configurations.compile.extendsFrom(configurations.extraLibs)
}
run {
println "Launching Client"
workingDir = new File("jars")
buildDir = 'jars'
if(!workingDir.exists()) workingDir.mkdir();
}
task unzipNatives(type: Copy) {
println "Unzipping natives:"
configurations.runtime.each {
if(it.name.contains("natives")){
println " * "+it.name
from(zipTree(it))
}
}
into "jars/natives"
}
task copyAssets(type: Copy) {
println "Copying assets from: " + currentOs()
from currentOs()+"/assets"
into "jars/assets"
}
task startGame {
dependsOn 'unzipNatives'
dependsOn 'copyAssets'
dependsOn 'run'
tasks.findByName('unzipNatives').mustRunAfter 'copyAssets'
tasks.findByName('run').mustRunAfter 'unzipNatives'
}