forked from unibo-oop/sample-gradle-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
69 lines (58 loc) · 2.13 KB
/
build.gradle.kts
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
plugins {
// Apply the java plugin to add support for Java
java
// Apply the application plugin to add support for building a CLI application
// You can run your app via task "run": ./gradlew run
application
/*
* Adds tasks to export a runnable jar.
* In order to create it, launch the "shadowJar" task.
* The runnable jar will be found in build/libs/projectname-all.jar
*/
id("com.github.johnrengelman.shadow") version "6.1.0"
}
repositories {
mavenCentral()
}
dependencies {
// Maven dependencies are composed by a group name, a name and a version, separated by colons
implementation("com.diffplug.durian:durian:3.4.0")
implementation("com.google.apis:google-api-services-books:v1-rev20201021-1.31.0")
implementation("com.omertron:API-OMDB:1.5")
/*
* Simple Logging Facade for Java (SLF4J) with Apache Log4j
* See: http://www.slf4j.org/
*/
val slf4jVersion = "1.7.30"
// when dependencies share the same version, grouping in a val helps to keep them in sync
implementation("org.slf4j:slf4j-api:$slf4jVersion")
runtimeOnly("org.slf4j:slf4j-log4j12:$slf4jVersion")
// JUnit API and testing engine
val jUnitVersion = "5.7.1"
testImplementation("org.junit.jupiter:junit-jupiter-api:$jUnitVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$jUnitVersion")
}
application {
// Define the main class for the application.
mainClass.set("it.unibo.sampleapp.App")
/*
* mainClassName was deprecated by Gradle, but it is still required by John Engelman's Shadow plugin.
* A pull request with a fix was already merged, but it hasn't been released yet;
* see https://github.com/johnrengelman/shadow/issues/609 and https://github.com/johnrengelman/shadow/pull/612
*/
@Suppress("DEPRECATION")
mainClassName = mainClass.get()
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
tasks {
withType<JavaCompile> {
options.encoding = "UTF-8"
}
withType<Test> {
// Enables JUnit 5 Jupiter module
useJUnitPlatform()
}
}