This repository has been archived by the owner on Jul 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
/
build.gradle
205 lines (172 loc) · 5.92 KB
/
build.gradle
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
apply plugin: 'base'
description = 'Spring Integration Groovy DSL'
allprojects {
group = 'org.springframework.integration'
repositories {
maven { url 'https://repo.spring.io/libs-snapshot' }
maven { url 'https://repo.spring.io/libs-milestone' }
maven { url 'https://repo.spring.io/libs-release' }
maven { url 'https://repo.spring.io/plugins-release' }
}
}
subprojects { subproject ->
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'idea'
apply plugin: 'eclipse'
sourceCompatibility = 1.6
targetCompatibility = 1.6
install {
repositories.mavenInstaller {
customizePom(pom, project)
}
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
task groovydocJar(type: Jar) {
classifier = 'groovydoc'
from groovydoc
}
artifacts {
archives sourcesJar
archives groovydocJar
}
// dependencies that are common across all java projects
dependencies {
compile "org.codehaus.groovy:groovy-all:$groovyVersion"
testCompile ("junit:junit:$junitVersion") {
exclude group: 'org.hamcrest'
}
testCompile "log4j:log4j:$log4jVersion"
testCompile "org.hamcrest:hamcrest-all:$hamcrestVersion"
testCompile ("org.mockito:mockito-core:$mockitoVersion") {
exclude group: 'org.hamcrest'
}
}
sourceSets.main.groovy.srcDirs = ["src/main/java", "src/main/groovy"]
// enable all compiler warnings; individual projects may customize further
ext.xLintArg = '-Xlint:all,-options'
[compileGroovy, compileTestGroovy]*.options*.compilerArgs = [xLintArg]
compileJava.enabled = compileTestJava.enabled = false
}
project('spring-integration-dsl-groovy-core') {
description = 'Spring Integration Groovy DSL Core'
dependencies {
// dependent libraries
compile "org.springframework.integration:spring-integration-core:$springIntegrationVersion"
testCompile "org.springframework.integration:spring-integration-http:$springIntegrationVersion"
testCompile "javax.servlet:javax.servlet-api:$servletApiVersion"
}
}
project('spring-integration-dsl-groovy-jms') {
description = 'Spring Integration Groovy DSL JMS'
dependencies {
compile project(":spring-integration-dsl-groovy-core")
compile "org.springframework.integration:spring-integration-jms:$springIntegrationVersion"
compile "javax.jms:jms-api:$jmsApiVersion"
// libraries only needed for test
testCompile("org.apache.activemq:activemq-broker:$activeMqVersion")
testCompile("org.apache.activemq:activemq-kahadb-store:$activeMqVersion") {
exclude group: 'org.springframework', module: 'spring-context'
}
}
}
project('spring-integration-dsl-groovy-amqp') {
description = 'Spring Integration Groovy DSL AMQP'
dependencies {
compile project(":spring-integration-dsl-groovy-core")
compile "org.springframework.integration:spring-integration-amqp:$springIntegrationVersion"
}
}
project('spring-integration-dsl-groovy-http') {
description = 'Spring Integration Groovy DSL Http'
dependencies {
compile project(":spring-integration-dsl-groovy-core")
compile "org.springframework.integration:spring-integration-http:$springIntegrationVersion"
testCompile "javax.servlet:javax.servlet-api:$servletApiVersion"
}
}
project('spring-integration-dsl-groovy-samples') {
description = 'Spring Integration Groovy DSL Samples'
dependencies {
compile project(":spring-integration-dsl-groovy-core")
compile project(":spring-integration-dsl-groovy-http")
compile "log4j:log4j:$log4jVersion"
}
}
project('spring-integration-dsl-groovy-feed') {
description = 'Spring Integration Groovy DSL Feed'
dependencies {
compile project(":spring-integration-dsl-groovy-core")
compile "org.springframework.integration:spring-integration-feed:$springIntegrationVersion"
}
}
task 'run-cafe'(type: JavaExec) {
description "Runs the cafe example"
main = 'org.springframework.integration.samples.cafe.Main'
classpath = subprojects.find { it.name == 'spring-integration-dsl-groovy-samples' }
.sourceSets.main.runtimeClasspath;
workingDir = 'spring-integration-dsl-groovy-samples'
}
def customizePom(def pom, def gradleProject) {
pom.whenConfigured { generatedPom ->
// respect 'optional' and 'provided' dependencies
def deps = gradleProject.configurations.runtime.allDependencies
def optionalDeps = deps.findAll { dep ->
dep.asDynamicObject.hasProperty('optional') && dep.optional
}
def providedDeps = deps.findAll { dep ->
dep.asDynamicObject.hasProperty('provided') && dep.provided
}
generatedPom.dependencies.each { mavenDep ->
mavenDep.optional = optionalDeps.any { optionalDep ->
optionalDep.group == mavenDep.groupId &&
optionalDep.name == mavenDep.artifactId &&
optionalDep.version == mavenDep.version
}
boolean isProvided = providedDeps.any { providedDep ->
providedDep.group == mavenDep.groupId &&
providedDep.name == mavenDep.artifactId &&
providedDep.version == mavenDep.version
}
if (isProvided) {
mavenDep.scope = 'provided'
}
}
// eliminate test-scoped dependencies (no need in maven central poms)
generatedPom.dependencies.removeAll { dep ->
dep.scope == 'test'
}
// add all items necessary for maven central publication
generatedPom.project {
name = gradleProject.description
description = gradleProject.description
url = 'https://github.com/spring-projects/spring-integration-dsl-groovy'
organization {
name = 'Spring IO'
url = 'https://spring.io'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'https://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
scm {
url = 'https://github.com/spring-projects/spring-integration-dsl-groovy'
connection = 'scm:git:git://github.com/spring-projects/spring-integration-dsl-groovy'
developerConnection = 'scm:git:ssh://[email protected]:spring-projects/spring-integration-dsl-groovy'
}
developers {
developer {
id = 'dturanski'
name = 'David Turanski'
email = '[email protected]'
}
}
}
}
}