-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
84 lines (69 loc) · 2.26 KB
/
build.gradle
File metadata and controls
84 lines (69 loc) · 2.26 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
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* User Manual available at https://docs.gradle.org/7.4.2/userguide/getting_started.html
* The dataset is downloaded automatically. Alternatively, you can comment out 'dependsOn downloadAndUnzip'
* in this file, then download the dataset manually from https://www.itu.dk/~mahv/data/datafiles.zip
*/
plugins {
// Apply the java plugin to add support for Java
id 'java'
// Apply the application plugin to add support for building a CLI application
id 'application'
// download tasks
id "de.undercouch.download" version "5.2.0"
// Java Code Coverage
id "jacoco"
}
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
dependencies {
// Use JUnit Jupiter API for testing.
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.1'
// Use JUnit Jupiter Engine for testing.
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
}
application {
// Define the main class for the application
mainClass.set("searchengine.Main") // Pauli: changed to Main
}
task downloadZipFile(type: Download) {
src 'https://www.itu.dk/~mahv/data/datafiles.zip'
dest new File('data', 'datafiles.zip')
overwrite false
}
task downloadAndUnzip(dependsOn: downloadZipFile, type: Copy) {
from zipTree(downloadZipFile.dest)
into 'data'
doLast {
downloadZipFile.dest.delete()
}
}
task buildConf() {
if (!new File('data', 'enwiki-medium.txt').exists()) {
dependsOn downloadAndUnzip
}
doLast {
File configFile = file('config.txt')
if(!configFile.exists() ) {
configFile.text = """data/enwiki-medium.txt"""
}
}
}
run {
dependsOn buildConf
mainClassName = 'searchengine.Main' // Pauli: changed to Main
}
tasks.named('test') {
// Use junit platform for unit tests.
if (!new File('data', 'enwiki-medium.txt').exists()) {
dependsOn downloadAndUnzip
}
useJUnitPlatform()
}