-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
100 lines (80 loc) · 1.81 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
// Build script for COMP1721 Coursework 2
plugins {
id 'java'
id 'checkstyle'
id 'application'
id 'idea'
}
// Library dependencies
repositories {
mavenCentral()
}
dependencies {
testImplementation (
'org.junit.jupiter:junit-jupiter-api:5.9.2',
'org.hamcrest:hamcrest:2.2'
)
testRuntimeOnly (
'org.junit.jupiter:junit-jupiter-engine:5.9.2'
)
}
// Unit testing
test {
useJUnitPlatform()
testLogging {
events 'PASSED', 'FAILED', 'SKIPPED'
}
}
// Style checking
checkstyle {
showViolations false
}
task style {
group 'verification'
description 'Runs checkstyle on code of this project.'
dependsOn checkstyleMain
}
// Support for IntelliJ
idea {
module {
sourceDirs += file('src/main/java')
testSourceDirs += file('src/test/java')
inheritOutputDirs = false
outputDir = file('build/classes/java/main')
testOutputDir file('build/classes/java/test')
}
}
// Running the application
application {
mainClass = 'Baccarat'
run {
description 'Runs the Baccarat application.'
doFirst {
println "\nRunning Baccarat application...\n"
}
}
}
task interact(type: JavaExec) {
group 'application'
description 'Runs Baccarat application with -i command line option.'
classpath = sourceSets.main.runtimeClasspath
mainClass = 'Baccarat'
standardInput = System.in
args ('-i')
doFirst {
println "\nRunning Baccarat with -i command line argument...\n"
}
}
// Generation of Zip file for submission
task submission(type: Zip) {
group 'Submission'
description 'Generates Zip archive suitable for submission to Minerva.'
archiveFileName = 'cwk2.zip'
destinationDirectory = project.rootDir
from("$project.rootDir") {
exclude 'cwk2.zip', '.idea', '.git', '**/.gradle', '**/build'
}
doLast {
logger.warn("cwk2.zip generated.")
}
}