-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
53 lines (43 loc) · 1.41 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
plugins {
id 'java'
id 'application'
// Para gerar um 'fat JAR'
id 'com.github.johnrengelman.shadow' version '8.1.1'
}
group 'engtelecom'
version '1.0'
repositories {
mavenCentral()
}
application {
// Define the main class for the application.
mainClass = 'bcd.Principal'
}
run {
standardInput = System.in
}
tasks.withType(JavaExec) {
standardInput = System.in
}
// Para gerar um JAR executável
jar {
manifest {
// Classe principal da aplicação
attributes "Main-Class": "bcd.Principal"
}
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
// Driver JDBC para o SQLite
// https://mvnrepository.com/artifact/org.xerial/sqlite-jdbc
implementation 'org.xerial:sqlite-jdbc:3.42.0.0'
// Driver JDBC para o MySQL
// https://mvnrepository.com/artifact/mysql/mysql-connector-java
implementation 'mysql:mysql-connector-java:8.0.33'
}
// Merging Service Descriptor Files (necessário para o driver JDBC)
// Java libraries often contain service descriptors files in the META-INF/services directory of the JAR. A service descriptor typically contains a line delimited list of classes that are supported for a particular service. At runtime, this file is read and used to configure library or application behavior.
tasks.shadowJar {
mergeServiceFiles()
}