-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathbuild.gradle
More file actions
215 lines (178 loc) · 7.78 KB
/
Copy pathbuild.gradle
File metadata and controls
215 lines (178 loc) · 7.78 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
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
// To create fat (uber) jar
plugins {
id 'com.gradleup.shadow' version '9.2.2' // ← new plugin id
id 'java'
id 'application'
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
application {
mainClass = "gin.LocalSearch"
}
repositories {
mavenCentral()
maven { url 'https://repo.gradle.org/gradle/libs-releases' }
}
import org.gradle.api.attributes.Category
import org.gradle.api.attributes.Usage
configurations {
junit5Launcher {
canBeConsumed = false
canBeResolved = true
transitive = true
}
junit6Launcher {
canBeConsumed = false
canBeResolved = true
transitive = true
}
}
dependencies {
implementation group: 'commons-io', name: 'commons-io', version: '2.8.0'
implementation group: 'com.google.guava', name: 'guava', version: '30.1-jre'
implementation platform('org.junit:junit-bom:5.11.0')
//implementation 'org.junit.jupiter:junit-jupiter'
runtimeOnly 'org.junit.jupiter:junit-jupiter-engine'
implementation 'org.junit.platform:junit-platform-launcher'
implementation 'org.junit.platform:junit-platform-engine'
implementation 'org.junit.vintage:junit-vintage-engine'
compileOnly 'org.apiguardian:apiguardian-api:1.1.2'
//implementation group: 'junit', name: 'junit', version: '4.13.1'
//implementation group: 'org.hamcrest', name: 'hamcrest', version: '2.2'
implementation 'junit:junit:4.13.2'
implementation 'org.hamcrest:hamcrest:2.2'
implementation group: 'com.github.javaparser', name: 'javaparser-core', version: '3.24.0'
implementation group: 'org.apache.commons', name: 'commons-math3', version: '3.6.1'
implementation group: 'org.apache.commons', name: 'commons-rng-simple', version: '1.3'
implementation group: 'org.apache.commons', name: 'commons-rng-core', version: '1.3'
implementation group: 'org.apache.commons', name: 'commons-rng-client-api', version: '1.3'
implementation group: 'org.apache.commons', name: 'commons-rng-sampling', version: '1.3'
implementation group: 'com.opencsv', name: 'opencsv', version: '5.3'
// ---- JUnit for tests of Gin ----
testImplementation platform('org.junit:junit-bom:5.11.0')
testImplementation 'org.junit.jupiter:junit-jupiter' // API + parameterized, etc.
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.11.0'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.11.0'
testCompileOnly 'org.apiguardian:apiguardian-api:1.1.2'
// for LLM integrations
implementation 'dev.langchain4j:langchain4j:0.18.0'
// LLM: SLF4J API
//implementation 'org.slf4j:slf4j-api:1.7.32'
// LLM: Logback Classic (implementation of SLF4J)
implementation 'ch.qos.logback:logback-classic:1.2.3'
// LLM: ollama4j
implementation 'io.github.amithkoujalgi:ollama4j:1.0.44'
// https://mvnrepository.com/artifact/com.github.spullara.cli-parser/cli-parser
implementation group: 'com.github.spullara.cli-parser', name: 'cli-parser', version: '1.1.5'
// https://mvnrepository.com/artifact/org.tinylog/tinylog
implementation group: 'org.tinylog', name: 'tinylog', version: '1.3.6'
// https://mvnrepository.com/artifact/org.ekstazi/org.ekstazi.core
implementation group: 'org.ekstazi', name: 'org.ekstazi.core', version: '5.3.0'
// https://mvnrepository.com/artifact/edu.illinois/starts-core
implementation group: 'edu.illinois', name: 'starts-core', version: '1.3'
// https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.11'
// Include the jar by "mvn package" on the fork of InMemoryCompiler created for gin.
// This is a substitute for the following:
// compile "org.mdkt.compiler:InMemoryJavaCompiler:1.3.0"
// ... because InMemoryJavaCompiler has yet to incorporate the critical bugfix
// ... and we then forked a second time to provide access to bytes of compiled code.
implementation fileTree(dir: 'libs', include: ['*.jar'])
// Used to profile maven projects
implementation group: 'org.apache.maven.shared', name: 'maven-invoker', version: '3.2.0'
implementation group: 'org.apache.maven', name: 'maven-core', version: '3.9.0'
// Used to profile gradle projects
implementation 'org.gradle:gradle-tooling-api:9.0.0'
runtimeOnly 'org.slf4j:slf4j-simple:2.0.6'
// Create jars for call graph generation using zta-zip
implementation 'org.zeroturnaround:zt-zip:1.14'
// Parse commandline
implementation group: 'org.zeroturnaround', name: 'zt-exec', version: '1.12'
// Parse build reports using jsoup
implementation 'org.jsoup:jsoup:1.13.1'
testImplementation "org.mockito:mockito-core:3.+"
junit5Launcher 'org.junit.platform:junit-platform-launcher:1.11.0'
junit6Launcher platform("org.junit:junit-bom:6.0.2")
junit6Launcher "org.junit.platform:junit-platform-launcher"
junit6Launcher "org.junit.jupiter:junit-jupiter-engine"
junit6Launcher "org.junit.platform:junit-platform-engine"
junit6Launcher "org.junit.platform:junit-platform-commons"
junit6Launcher "org.opentest4j:opentest4j:1.3.0"
junit6Launcher "org.apiguardian:apiguardian-api:1.1.2"
}
jar {
manifest {
attributes(
'Class-Path': configurations.compileClasspath.collect { it.getName() }.join(' '),
'Premain-Class': "org.ekstazi.agent.EkstaziAgent",
"Can-Redefine-Classes": "true",
"Can-Retransform-Classes": "true"
)
}
}
// This is handy to copy dependencies into a folder, for use in an IDE etc.
tasks.register('copyToLib', Copy) {
into "lib"
from configurations.runtimeClasspath
}
javadoc {
source = sourceSets.main.allJava
classpath = configurations.compileClasspath
}
shadowJar {
dependencies {
exclude(dependency("org.junit.platform:.*"))
exclude(dependency("org.junit.jupiter:.*"))
exclude(dependency("org.junit.vintage:.*"))
exclude(dependency("junit:junit"))
}
into("embedded-libs/junit5") {
from {
project.configurations.junit5Launcher
.resolvedConfiguration
.resolvedArtifacts
.findAll { it.moduleVersion.id.group == "org.junit.platform" && it.name == "junit-platform-launcher" }
.collect { it.file }
}
rename { "launcher.jar" }
}
into("embedded-libs/junit6") {
from {
project.configurations.junit6Launcher
.resolvedConfiguration
.resolvedArtifacts
.findAll { it.moduleVersion.id.group == "org.junit.platform" && it.name == "junit-platform-launcher" }
.collect { it.file }
}
rename { "launcher.jar" }
}
destinationDirectory = buildDir
archiveBaseName = 'gin'
archiveVersion = null
archiveClassifier = null
mergeServiceFiles()
}
test {
useJUnitPlatform() // ✅ run on JUnit 5 Platform
testLogging {
events "PASSED", "FAILED", "SKIPPED" //, "STANDARD_ERROR"
exceptionFormat "full"
showCauses true
showExceptions true
showStackTraces true
}
// If you previously used excludeCategory, switch to tags:
if (project.hasProperty("excludeCategory")) {
useJUnitPlatform {
excludeTags project.property("excludeCategory")
}
}
}
tasks.test {
dependsOn tasks.shadowJar
// hand the jar path to ExternalTestRunner via system property
systemProperty "gin.jar", "${buildDir}/gin.jar"
}