-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathbuild.gradle
More file actions
212 lines (173 loc) · 5.54 KB
/
build.gradle
File metadata and controls
212 lines (173 loc) · 5.54 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
buildscript {
repositories {
maven {url "https://plugins.gradle.org/m2/"}
}
dependencies {
classpath "io.freefair.gradle:aspectj-plugin:9.2.0"
}
}
plugins {
id 'eclipse'
id 'maven-publish'
id("io.freefair.aspectj.post-compile-weaving") version "9.2.0"
}
sourceCompatibility = 17
targetCompatibility = 17
// The following lines are necessay to create a test jar
project.configurations {
testArchives.extendsFrom (testCompile)
}
project.task ('jarTest', type:Jar, dependsOn: project.testClasses, description: 'create a jar from the test source set') {
from project.sourceSets.test.output
archiveClassifier = 'test'
}
project.artifacts {
testArchives project.jarTest
}
repositories {
mavenCentral()
}
configurations {
ajc
aspectJCompileTime
}
compileJava {
ajc {
enabled = true
classpath.setFrom configurations.aspectJCompileTime
}
}
compileTestJava {
ajc {
classpath.setFrom configurations.aspectJCompileTime
}
}
dependencies {
implementation project(':common')
implementation project(':monitoring:core')
aspectJCompileTime "org.aspectj:aspectjtools:1.9.25.1"
implementation "org.aspectj:aspectjrt:$aspectjVersion"
implementation "org.aspectj:aspectjweaver:$aspectjVersion" // for our custom AspectJ weaver (class: AspectJLoader)
implementation "org.glassfish.jersey.core:jersey-server:$jerseyVersion"
implementation "org.glassfish.jersey.core:jersey-common:$jerseyVersion"
implementation "org.glassfish.jersey.core:jersey-client:$jerseyVersion"
implementation "javax.servlet:javax.servlet-api:4.0.1"
implementation "javax.jms:javax.jms-api:2.0.1"
implementation "org.springframework:spring-beans:$springVersion"
implementation "org.springframework:spring-context:$springVersion"
implementation "org.springframework:spring-core:$springVersion"
implementation "org.springframework:spring-web:$springVersion"
implementation "org.springframework:spring-webmvc:$springVersion"
// testing
testImplementation "org.hamcrest:hamcrest:$libHamcrestVersion"
testImplementation "org.javassist:javassist:3.30.2-GA"
testImplementation "junit:junit:$libJunitVersion"
testImplementation "org.objenesis:objenesis:3.5"
testImplementation "org.easymock:easymock:5.6.0"
testImplementation "org.mockito:mockito-core:$libMockitoVersion"
// this project depends on the tests of common, e.g., it requires the class AbstractKiekerTest
testImplementation project (path: ':common', configuration: 'testArchives')
testImplementation "org.springframework:spring-beans:$springVersion"
testImplementation "org.springframework:spring-expression:3.$springVersion"
testImplementation "org.eclipse.jetty:jetty-server:12.1.7"
testImplementation "org.eclipse.jetty.ee10:jetty-ee10-webapp:12.1.7"
testImplementation "org.eclipse.jetty.ee10:jetty-ee10-apache-jsp:12.1.7"
testImplementation "commons-io:commons-io:2.21.0"
testImplementation project(':common').sourceSets.test.output
integrationTestImplementation "junit:junit:$libJunitVersion"
}
// publishing
publishing {
publications {
maven(MavenPublication) {
groupId = 'net.kieker-monitoring'
artifactId = 'monitoring-aspectj'
version = version
from components.java
}
}
repositories {
maven {
def mavenUser = "NoMavenUser"
if (System.env.kiekerMavenUser != null) {
mavenUser = System.env.kiekerMavenUser
}
def mavenPassword = "NoMavenPassword"
if (System.env.kiekerMavenPassword != null) {
mavenPassword = System.env.kiekerMavenPassword
}
credentials {
username = mavenUser
password = mavenPassword
}
// Maven central:
def releasesRepoUrl = 'https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = 'https://central.sonatype.com/repository/maven-snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
}
task iajc(dependsOn: classes) {
doLast {
ant.taskdef(
resource: 'org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties',
classpath: configurations.ajc.asPath
)
ant.iajc(
XlintFile: 'aspectjXlint.properties',
X: 'joinpoints:synchronization',
source: sourceCompatibility,
target: targetCompatibility,
debug: 'true',
destdir: sourceSets.main.output.classesDir) {
classpath {
pathElement(location: configurations.compile.asPath)
pathElement(location: sourceSets.main.output.classesDir)
}
sourceroots {
pathElement(location: 'src/kieker/monitoring/probe/aspectj')
}
}
}
}
sourceSets {
jarIntegrationTest {
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
compileClasspath += sourceSets.test.output
runtimeClasspath += sourceSets.test.output
java {
srcDirs = [ 'integrationTest' ]
}
}
}
configurations {
jarIntegrationTestImplementation.extendsFrom testImplementation
jarIntegrationTestRuntimeOnly.extendsFrom runtimeOnly
}
task jarIntegrationTest(type: Test) {
description = 'Runs integration tests.'
group = 'verification'
testClassesDirs = sourceSets.jarIntegrationTest.output.classesDirs
classpath = sourceSets.jarIntegrationTest.runtimeClasspath
dependsOn rootProject.aspectJJar
}
compileJarIntegrationTestJava {
ajc {
classpath.setFrom configurations.aspectJCompileTime
}
}
// This is necessary to avoid eclipse problems; eclipse does not allow the same project to be imported twice as dependency
eclipse {
classpath {
file {
whenMerged { classpath ->
classpath.entries.removeAll { entry ->
entry instanceof org.gradle.plugins.ide.eclipse.model.ProjectDependency
&& entry.path == '/common'
&& entry.entryAttributes['test']
}
}
}
}
}