-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
159 lines (140 loc) · 4.57 KB
/
build.gradle
File metadata and controls
159 lines (140 loc) · 4.57 KB
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
plugins {
id 'java'
id 'application'
id 'eclipse'
id "com.github.johnrengelman.shadow" version "7.1.2"
id "org.graalvm.plugin.compiler" version "0.1.0-alpha2"
id 'com.bmuschko.docker-java-application' version '7.3.0'
id 'org.jetbrains.kotlin.jvm' version '1.6.21'
id 'org.jetbrains.kotlin.plugin.serialization' version '1.6.10'
}
ext.graalVersion = '22.0.0.2'
group 'fr.thesimpleteam'
version '1.0'
application {
mainClassName = "net.thesimpleteam.simplebot.SimpleBot"
tasks.run.setWorkingDir(file(sourceSets.main.resources.srcDirs[0]))
run {
getSystemProperties().put("simplebot.dev", "true")
}
}
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
compileJava.options.encoding = compileTestJava.options.encoding = javadoc.options.encoding = 'UTF-8'
import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage
import com.bmuschko.gradle.docker.tasks.image.Dockerfile
import java.util.concurrent.Callable
graal {
version "$graalVersion"
}
repositories {
mavenCentral()
mavenLocal()
maven {
name 'm2-dv8tion'
url 'https://m2.dv8tion.net/releases'
}
maven { url 'https://jitpack.io' }
maven { url "https://m2.chew.pro/releases" }
}
dependencies {
//JDA & JDA-Utilities
implementation("net.dv8tion:JDA:4.4.1_353")
implementation('pw.chew:jda-chewtils:1.23.0') {
exclude group: 'pw.chew', module: 'jda-chewtils-command'
}
implementation 'com.github.TheSimpleTeam.JDA-Chewtils:jda-chewtils-command:ab05b178ae'
//ByteCode
implementation 'net.bytebuddy:byte-buddy:1.12.9'
//Eval
implementation "org.graalvm.sdk:graal-sdk:$graalVersion"
implementation "org.graalvm.js:js:$graalVersion"
implementation "org.graalvm.js:js-scriptengine:$graalVersion"
implementation('com.caoccao.javet:javet:1.1.4')
implementation 'org.python:jython-standalone:2.7.2'
//CLI
implementation 'commons-cli:commons-cli:1.5.0'
//API
implementation('io.ktor:ktor-server-core:1.6.8')
implementation('io.ktor:ktor-server-host-common:1.6.8')
implementation('io.ktor:ktor-server-netty:1.6.8')
implementation('io.ktor:ktor-serialization:1.6.8')
//Mixins
implementation 'com.github.ReflxctionDev.Tuna-Bytes:core:1.2.0'
annotationProcessor 'com.github.ReflxctionDev.Tuna-Bytes:core:1.2.0'
//Other
implementation 'com.github.Thesimpleteam:spiget:15c1d27021'
implementation 'com.google.code.gson:gson:2.10.1'
implementation("com.google.guava:guava:31.1-jre")
implementation group: 'org.kohsuke', name: 'github-api', version: '1.306'
implementation 'org.jsoup:jsoup:1.14.3'
implementation "org.mariuszgromada.math:MathParser.org-mXparser:5.2.1"
implementation 'org.reflections:reflections:0.10.2'
implementation 'sh.stein:carbon-api:1.2'
implementation 'org.fusesource.jansi:jansi:2.4.0'
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.6.21'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
}
docker {
javaApplication {
baseImage = ''
getApiVersion().set("1.0")
maintainer = 'Minemobs <minemobs.pro@gmail.com>'
jvmArgs = ['-Xms256m', '-Xmx1024m']
}
}
task copyLangs(type: Copy) {
from('lang')
into("$buildDir/docker/lang")
}
processResources {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
sourceSets {
main {
resources {
srcDirs "src/main/resources"
}
}
}
task createDockerFile(type: Dockerfile) {
dependsOn(clean)
dependsOn(dockerSyncBuildContext)
finalizedBy(copyLangs)
from('eclipse-temurin:17_35-jdk-focal')
label([MAINTAINER: "Minemobs <minemobs.pro@gmail.com>"])
workingDir("/app")
addFile("lang", "lang/")
addFile("libs", "libs/")
addFile("classes", "classes/")
entryPoint(project.provider(new Callable<List<String>>() {
@Override
List<String> call() throws Exception {
["java", "-Xms256m", "-Xmx1024m", "-cp", "/app/resources:/app/classes:/app/libs/*", "net.thesimpleteam.simplebot.SimpleBot"]
}
}))
exposePort(8080)
}
task buildDocker(type: DockerBuildImage) {
dependsOn createDockerFile
dockerFile.set(file("$buildDir/docker/Dockerfile"))
images.add("thesimpleteam/$project.name:$project.version")
}
shadowJar {
exclude 'plugins'
exclude 'config'
exclude 'logs'
}
test {
useJUnitPlatform()
}
compileKotlin {
kotlinOptions {
jvmTarget = "17"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "17"
}
}