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
180 lines (154 loc) · 5.9 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
apply plugin: 'base'
description = 'Spring Integration Groovy DSL'
allprojects {
group = 'org.springframework.integration'
repositories {
maven { url 'http://repo.springsource.org/libs-milestone' }
maven { url 'https://repo.springsource.org/libs-snapshot'}
maven { url 'https://repo.springsource.org/libs-release'}
}
}
subprojects { subproject ->
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'eclipse'
sourceCompatibility=1.6
targetCompatibility=1.6
install {
repositories.mavenInstaller {
customizePom(pom, subproject)
}
}
task sourcesJar(type: Jar) {
classifier = 'sources'
}
artifacts {
archives sourcesJar
}
// dependencies that are common across all java projects
dependencies {
groovy "org.codehaus.groovy:groovy-all:$groovyVersion"
testCompile "junit:junit-dep:$junitVersion"
testRuntime "log4j:log4j:$log4jVersion"
testCompile "org.mockito:mockito-all:$mockitoVersion"
}
}
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:servlet-api:2.5'
}
}
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 "org.apache.geronimo.specs:geronimo-jms_1.1_spec:1.1"
// libraries only needed for test
testCompile ("org.apache.activemq:activemq-core:5.3.0") {
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"
// libraries only needed for test
testCompile ("org.apache.activemq:activemq-core:5.3.0") {
exclude group: 'org.springframework', module: 'spring-context'
}
}
}
project('spring-integration-dsl-groovy-samples') {
description = 'Spring Integration Groovy DSL Samples'
dependencies {
compile project(":spring-integration-dsl-groovy-core")
compile "log4j:log4j:$log4jVersion"
}
}
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'
}
task wrapper(type: Wrapper) {
description = 'Generates gradlew[.bat] scripts'
gradleVersion = '1.1'
distributionUrl = 'http://services.gradle.org/distributions/gradle-1.1-bin.zip'
jarFile = '.wrapper/gradle-wrapper.jar'
}
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/SpringSource/spring-integration-dsl-groovy'
organization {
name = 'SpringSource'
url = 'http://springsource.org'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
scm {
url = 'https://github.com/SpringSource/spring-integration-groovy-dsl'
connection = 'scm:git:git://github.com/SpringSource/spring-integration-dsl-groovy'
developerConnection = 'scm:git:git://github.com/SpringSource/spring-integration-dsl-groovy'
}
developers {
developer {
id = 'dturanski'
name = 'David Turanski'
email = 'dturanski@vmware.com'
}
}
}
}
}