-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
94 lines (80 loc) · 2.27 KB
/
build.gradle
File metadata and controls
94 lines (80 loc) · 2.27 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
85
86
87
88
89
90
91
92
93
94
plugins {
id 'java'
id 'application'
}
group = 'com.algos.practice'
version = '1.0.0'
sourceCompatibility = '11'
targetCompatibility = '11'
repositories {
mavenCentral()
}
dependencies {
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.2'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.9.2'
// Add Lombok support
compileOnly 'org.projectlombok:lombok:1.18.30'
annotationProcessor 'org.projectlombok:lombok:1.18.30'
testCompileOnly 'org.projectlombok:lombok:1.18.30'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.30'
}
sourceSets {
main {
java {
srcDirs = ['src']
// Exclude test files from main source
exclude '**/*Test.java'
exclude '**/Test*.java'
exclude '**/*Tests.java'
}
}
test {
java {
srcDirs = ['test']
// Include test files from src directory that should be in test
srcDirs += fileTree(dir: 'src', includes: ['**/*Test.java', '**/Test*.java', '**/*Tests.java'])
// Exclude problematic test files
exclude '**/TextJustificationTest.java'
}
}
}
test {
useJUnitPlatform()
// Include both JUnit 4 and JUnit 5 tests
testLogging {
events "passed", "skipped", "failed"
showStandardStreams = true
}
}
// Configure Java compilation
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.compilerArgs += ['-Xlint:unchecked', '-Xlint:deprecation']
// Exclude problematic files from compilation
exclude '**/CanIWin.java'
}
// Create a jar task
jar {
manifest {
attributes(
'Main-Class': 'com.algos.practice.Experiment',
'Implementation-Title': project.name,
'Implementation-Version': project.version
)
}
// Include all dependencies in the jar
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
// Application plugin configuration
application {
mainClass = 'com.algos.practice.Experiment'
}
// Clean task to remove build artifacts
clean {
delete 'build'
delete 'out'
}