-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
122 lines (100 loc) · 2.61 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
110
111
112
113
114
115
116
117
118
119
120
121
122
// Build script for COMP1721 Coursework 1
plugins {
id 'java'
id 'checkstyle'
id 'application'
id 'idea'
}
// Library dependencies
repositories {
mavenCentral()
}
dependencies {
implementation fileTree(dir:'lib',includes:['*.jar'])
testImplementation (
'org.junit.jupiter:junit-jupiter-api:5.8.2',
'org.hamcrest:hamcrest:2.2'
)
testRuntimeOnly (
'org.junit.jupiter:junit-jupiter-engine:5.8.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 = 'comp1721.cwk1.Wordle'
run {
description 'Runs a game of Wordle using today\'s word.'
standardInput = System.in
doFirst {
print "\n"
println "----------------------------------------------------------------"
}
}
}
//ordinary version
task runFixed(type: JavaExec) {
group 'application'
description 'Runs the game specified as a command line argument.'
standardInput = System.in
classpath = sourceSets.main.runtimeClasspath
mainClass = 'comp1721.cwk1.Wordle'
args '100','-a'
doFirst {
println "\nRunning with 100 as a command line argument"
println "(Target word for Game 100 is BASIC)\n"
println "----------------------------------------------------------------"
}
}
//visual impaired version
//task runFixed(type: JavaExec) {
// group 'application'
// description 'Runs the game specified as a command line argument.'
// standardInput = System.in
// classpath = sourceSets.main.runtimeClasspath
// mainClass = 'comp1721.cwk1.Wordle_impair'
// args '-a'
// doFirst {
// println "\nRunning with 100 as a command line argument"
// println "(Target word for Game 100 is BASIC)\n"
// println "----------------------------------------------------------------"
// }
//}
// Generation of Zip file for submission
task submission(type: Zip) {
group 'Submission'
description 'Generates Zip archive suitable for submission to Minerva.'
archiveFileName = 'cwk1.zip'
destinationDirectory = project.rootDir
from("$project.rootDir") {
exclude 'cwk1.zip', '.idea', '**/.gradle', '**/build'
}
doLast {
logger.warn("cwk1.zip generated.")
}
}