@@ -95,20 +95,38 @@ publishing {
9595 }
9696 }
9797
98+ mkp. properties {
99+ for (dep in plugins) {
100+ String version = dep. value
101+ if (! isBuildSnapshot && version. endsWith(" -SNAPSHOT" )) {
102+ throw new RuntimeException (" Cannot have a snapshot dependency on a plugin [$dep . key ] for a release!" )
103+ }
104+ mkp. " ${ dep.key} .version" (version)
105+ }
106+
107+ for (dep in dependencyVersions) {
108+ String version = dep. value. version
109+ if (! isBuildSnapshot && version. endsWith(" -SNAPSHOT" )) {
110+ throw new RuntimeException (" Cannot have a snapshot dependency on [$dep . key ] for a release!" )
111+ }
112+ mkp. " ${ dep.key} .version" (version)
113+ }
114+ }
115+
98116 mkp. dependencyManagement {
99117 mkp. dependencies {
100- for (sub in project. parent. subprojects) {
101- if (sub. name == ' grails-bom' ) continue
118+ for (sub in project. parent. subprojects) {
119+ if (sub. name == ' grails-bom' ) continue
102120
103121 mkp. dependency {
104122 mkp. groupId sub. group
105123 mkp. artifactId sub. name
106- mkp. version( sub. version )
107- if (sub. name == ' grails-dependencies' ) {
124+ mkp. version sub. version
125+ if (sub. name == ' grails-dependencies' ) {
108126 mkp. type ' pom'
109127 }
110128
111- if (sub. name == ' grails-bootstrap' ) {
129+ if (sub. name == ' grails-bootstrap' ) {
112130 mkp. exclusions {
113131 mkp. exclusion {
114132 mkp. groupId ' jline'
@@ -128,123 +146,52 @@ publishing {
128146 }
129147 }
130148 }
131-
132- }
133- }
134-
135- [' core' , ' simple' ,' web' ,' rest-client' ,' gorm' , ' gorm-validation' , ' gorm-support' , ' gorm-async' , ' test-support' , ' hibernate-core' ,' gorm-test' ]. each { name ->
136- mkp. dependency {
137- mkp. groupId ' org.grails'
138- mkp. artifactId " grails-datastore-$name "
139- mkp. version( datastoreVersion )
140- }
141-
142- }
143-
144- [' ' , ' xml' , ' swing' , ' console' , ' json' , ' ant' , ' sql' , ' templates' , ' xml' ,' nio' ]. each { name ->
145- mkp. dependency {
146- mkp. groupId ' org.codehaus.groovy'
147- mkp. artifactId name ? " groovy-$name " : " groovy"
148- mkp. version( groovyVersion )
149149 }
150150 }
151151
152- [' aop' , ' aspects' , ' beans' , ' context-support' , ' context' , ' core' , ' expression' , ' instrument' , ' jdbc' ,' jms' , ' messaging' , ' orm' , ' oxm' , ' test' , ' tx' , ' web' , ' webmvc' , ' websocket' ]. each { name ->
153- mkp. dependency {
154- mkp. groupId ' org.springframework'
155- mkp. artifactId " spring-$name "
156- mkp. version( springVersion )
152+ for (dep in dependencyVersions) {
153+ def info = dep. value
154+ def depList = GroovyCollections
155+ .combinations(info. names, info. modules)
156+ .collect { it. join(' -' ) }
157+ .collect { it. endsWith(' -' ) ? it[0 .. -2 ] : it }
158+
159+ for (dependency in depList) {
160+ mkp. dependency {
161+ mkp. groupId info. group
162+ mkp. artifactId dependency
163+ mkp. version " \$ {${ dep.key} .version}"
164+ }
157165 }
158166 }
159167
160- mkp. dependency {
161- mkp. groupId ' io.methvin'
162- mkp. artifactId " directory-watcher"
163- mkp. version(directoryWatcherVersion) // 0.3.0
164- }
165-
166- mkp. dependency {
167- mkp. groupId ' org.springframework'
168- mkp. artifactId " springloaded"
169- mkp. version( springLoadedVersion )
170- }
171-
172- for (plugin in plugins) {
168+ for (plugin in plugins) {
173169 mkp. dependency {
174170 mkp. groupId ' org.grails.plugins'
175171 mkp. artifactId plugin. key
176- def version = plugin. value
177- if (! isBuildSnapshot && version. toString() . endsWith(" -SNAPSHOT" )) {
172+ String version = plugin. value
173+ if (! isBuildSnapshot && version. endsWith(" -SNAPSHOT" )) {
178174 throw new RuntimeException (" Cannot have a snapshot dependency on a plugin [$plugin . key ] for a release!" )
179175 }
180- mkp. version( version)
176+ mkp. version " \$ { ${ plugin.key } . version} "
181177 }
182178 }
183179
184- [' async' , ' events' ]. each { name ->
185- mkp. dependency {
186- mkp. groupId ' org.grails.plugins'
187- mkp. artifactId name
188- mkp. version( asyncVersion )
189- }
190- }
191-
192- [' gpars' , ' rxjava' , ' rxjava2' ]. each { name ->
193- mkp. dependency {
194- mkp. groupId ' org.grails'
195- mkp. artifactId " grails-async-$name "
196- mkp. version( asyncVersion )
197- }
198- mkp. dependency {
199- mkp. groupId ' org.grails'
200- mkp. artifactId " grails-events-$name "
201- mkp. version( asyncVersion )
202- }
203- }
204-
205- mkp. dependency {
206- mkp. groupId ' org.spockframework'
207- mkp. artifactId " spock-core"
208- mkp. version( spockVersion )
209- }
210-
211- mkp. dependency {
212- mkp. groupId ' org.spockframework'
213- mkp. artifactId " spock-spring"
214- mkp. version( spockVersion )
215- }
216-
217- mkp. dependency {
218- mkp. groupId ' org.grails.plugins'
219- mkp. artifactId " gsp"
220- mkp. version( gspVersion )
221- }
222-
223-
224- for (profile in profiles) {
180+ for (profile in profiles) {
225181 mkp. dependency {
226182 mkp. groupId ' org.grails.profiles'
227183 mkp. artifactId profile. key
228- def version = profile. value
229- if (! isBuildSnapshot && version. toString() . endsWith(" -SNAPSHOT" )) {
184+ String version = profile. value
185+ if (! isBuildSnapshot && version. endsWith(" -SNAPSHOT" )) {
230186 throw new RuntimeException (" Cannot have a snapshot dependency on a profile [$profile . key ] for a release!" )
231187 }
232188 mkp. version(version)
233189 }
234190 }
235-
236- [' gorm-' , ' web-' , ' ' ]. each { name ->
237- mkp. dependency {
238- mkp. groupId ' org.grails'
239- mkp. artifactId " grails-${ name} testing-support"
240- mkp. version( testingSupportVersion )
241- }
242- }
243191 }
244192 }
245193 }
246194 }
247-
248195 }
249196 }
250197}
0 commit comments