-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
56 lines (46 loc) · 1.17 KB
/
build.gradle
File metadata and controls
56 lines (46 loc) · 1.17 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
// This is build.gradle file
//set JAVA_HOME=C:\Program Files\Java\jdk-1.8
//set PATH=%JAVA_HOME%\bin;%PATH%
//
apply plugin: 'java'
apply plugin:'jacoco'
jacoco {
toolVersion = "0.8.7"
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
group = 'com.example'
version = 'V1'
repositories {
mavenCentral()
}
dependencies {
testImplementation 'junit:junit:4.13.2'
}
test {
// Specify the directory containing test classes
testClassesDirs = sourceSets.test.output.classesDirs
// Optionally configure test options
testLogging {
// Configure which events to log during test execution
events 'passed', 'skipped', 'failed'
}
finalizedBy jacocoTestReport
}
jar {
manifest {
attributes 'Main-Class': 'com.example.HelloWorld'
}
from sourceSets.main.output // Include compiled classes in the JAR
archiveBaseName = 'hello-world-java' // Name of the JAR file
destinationDirectory = file('build/libs') // Output directory for the JAR file
}
jacocoTestReport
{ dependsOn test
reports {
xml.required = true
html.required = true
}
}