forked from OSRSB/OsrsBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
109 lines (95 loc) · 3.59 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
plugins {
id 'java'
}
repositories {
mavenLocal()
maven { url 'https://jitpack.io' }
mavenCentral()
maven {
url 'https://repo.runelite.net'
content {
// only download packages for group net.runelite*
includeGroupByRegex "net\\.runelite.*"
}
}
}
def lastSupportedVersion = "1.9.3"
def runeLiteVersion = getRuneLiteVersion()
def supportedCheck = false
if (supportedCheck) {
if (runeLiteVersion != lastSupportedVersion) {
println("Warning - client has been updated")
throw new Exception("Out of date (last supported: " + lastSupportedVersion + " current client: " + runeLiteVersion + ")")
}
}
static def getRuneLiteVersion() {
URL url = new URL("http://repo.runelite.net/net/runelite/client/maven-metadata.xml")
URLConnection urlConnection = url.openConnection()
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(
urlConnection.getInputStream()))
String latestName = null
String inputLine
while ((inputLine = bufferedReader.readLine()) != null) {
inputLine = inputLine.trim()
if (inputLine.contains("<release>")) {
latestName = inputLine.replace("<release>", "").replace("</release>", "")
}
}
bufferedReader.close()
return latestName
}
dependencies {
implementation group: 'org.clojure', name: 'clojure', version: '1.9.0'
implementation group: 'org.clojure', name: 'tools.nrepl', version: '0.2.12'
implementation group: 'net.runelite', name: 'client', version: runeLiteVersion
implementation group: 'net.runelite', name: 'cache', version: runeLiteVersion
implementation 'org.projectlombok:lombok:1.18.24'
annotationProcessor 'org.projectlombok:lombok:1.18.24'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.slf4j:slf4j-simple:1.7.36'
testImplementation group: 'net.runelite', name: 'client', version: runeLiteVersion, {
exclude group: 'ch.qos.logback', module: 'logback-classic'
}
implementation 'com.github.OSRSB:OSRSBPlugin:main-SNAPSHOT'
implementation group: 'com.github.joonasvali.naturalmouse', name: 'naturalmouse', version: '2.0.3'
implementation group: 'javassist', name: 'javassist', version: '3.12.1.GA'
implementation group: 'net.sf.jopt-simple', name:'jopt-simple', version: '5.0.4'
}
sourceSets {
main {
java {
srcDirs= ["src/main/java"]
}
}
}
project.configurations.implementation.setCanBeResolved(true)
jar {
manifest.attributes('Main-Class': 'net.runelite.rsb.botLauncher.Application')
from{
configurations.implementation.collect {it.isDirectory() ? it: zipTree(it)}
}
exclude 'META-INF/*.RSA'
exclude 'META-INF/*.SF'
exclude 'META-INF/*.DSA'
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
destinationDirectory.set(file("$rootDir"))
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
task botRun(type: JavaExec) {
group = "Execution"
description = "Runs the main method within RSB"
classpath = sourceSets.main.runtimeClasspath + sourceSets.main.compileClasspath
getMainClass() set "net.runelite.rsb.botLauncher.Application"
jvmArgs "-debug"
args "--bot-runelite --developer-mode".split(" ")
}
task headlessBotRun(type: JavaExec) {
group = "Execution"
description = "Runs the main method within RSB"
classpath = sourceSets.main.runtimeClasspath + sourceSets.main.compileClasspath
getMainClass() set "net.runelite.rsb.botLauncher.Application"
jvmArgs "-debug"
args "--bot-runelite --developer-mode --headless".split(" ")
}