@@ -18,20 +18,38 @@ publishing {
1818 xml. children(). last() + {
1919 def mkp = delegate
2020
21+ mkp. properties {
22+ for (dep in plugins) {
23+ String version = dep. value
24+ if (! isBuildSnapshot && version. endsWith(" -SNAPSHOT" )) {
25+ throw new RuntimeException (" Cannot have a snapshot dependency on a plugin [$dep . key ] for a release!" )
26+ }
27+ mkp. " ${ dep.key} .version" (version)
28+ }
29+
30+ for (dep in dependencyVersions) {
31+ String version = dep. value. version
32+ if (! isBuildSnapshot && version. endsWith(" -SNAPSHOT" )) {
33+ throw new RuntimeException (" Cannot have a snapshot dependency on [$dep . key ] for a release!" )
34+ }
35+ mkp. " ${ dep.key} .version" (version)
36+ }
37+ }
38+
2139 mkp. dependencyManagement {
2240 mkp. dependencies {
23- for (sub in project. parent. subprojects) {
24- if (sub. name == ' grails-bom' ) continue
41+ for (sub in project. parent. subprojects) {
42+ if (sub. name == ' grails-bom' ) continue
2543
2644 mkp. dependency {
2745 mkp. groupId sub. group
2846 mkp. artifactId sub. name
29- mkp. version( sub. version )
30- if (sub. name == ' grails-dependencies' ) {
47+ mkp. version sub. version
48+ if (sub. name == ' grails-dependencies' ) {
3149 mkp. type ' pom'
3250 }
3351
34- if (sub. name == ' grails-bootstrap' ) {
52+ if (sub. name == ' grails-bootstrap' ) {
3553 mkp. exclusions {
3654 mkp. exclusion {
3755 mkp. groupId ' jline'
@@ -51,123 +69,52 @@ publishing {
5169 }
5270 }
5371 }
54-
55- }
56- }
57-
58- [' core' , ' simple' ,' web' ,' rest-client' ,' gorm' , ' gorm-validation' , ' gorm-support' , ' gorm-async' , ' test-support' , ' hibernate-core' ,' gorm-test' ]. each { name ->
59- mkp. dependency {
60- mkp. groupId ' org.grails'
61- mkp. artifactId " grails-datastore-$name "
62- mkp. version( datastoreVersion )
63- }
64-
65- }
66-
67- [' ' , ' xml' , ' swing' , ' console' , ' json' , ' ant' , ' sql' , ' templates' , ' xml' ,' nio' ]. each { name ->
68- mkp. dependency {
69- mkp. groupId ' org.codehaus.groovy'
70- mkp. artifactId name ? " groovy-$name " : " groovy"
71- mkp. version( groovyVersion )
7272 }
7373 }
7474
75- [' aop' , ' aspects' , ' beans' , ' context-support' , ' context' , ' core' , ' expression' , ' instrument' , ' jdbc' ,' jms' , ' messaging' , ' orm' , ' oxm' , ' test' , ' tx' , ' web' , ' webmvc' , ' websocket' ]. each { name ->
76- mkp. dependency {
77- mkp. groupId ' org.springframework'
78- mkp. artifactId " spring-$name "
79- mkp. version( springVersion )
75+ for (dep in dependencyVersions) {
76+ def info = dep. value
77+ def depList = GroovyCollections
78+ .combinations(info. names, info. modules)
79+ .collect { it. join(' -' ) }
80+ .collect { it. endsWith(' -' ) ? it[0 .. -2 ] : it }
81+
82+ for (dependency in depList) {
83+ mkp. dependency {
84+ mkp. groupId info. group
85+ mkp. artifactId dependency
86+ mkp. version " \$ {${ dep.key} .version}"
87+ }
8088 }
8189 }
8290
83- mkp. dependency {
84- mkp. groupId ' io.methvin'
85- mkp. artifactId " directory-watcher"
86- mkp. version(directoryWatcherVersion) // 0.3.0
87- }
88-
89- mkp. dependency {
90- mkp. groupId ' org.springframework'
91- mkp. artifactId " springloaded"
92- mkp. version( springLoadedVersion )
93- }
94-
95- for (plugin in plugins) {
91+ for (plugin in plugins) {
9692 mkp. dependency {
9793 mkp. groupId ' org.grails.plugins'
9894 mkp. artifactId plugin. key
99- def version = plugin. value
100- if (! isBuildSnapshot && version. toString() . endsWith(" -SNAPSHOT" )) {
95+ String version = plugin. value
96+ if (! isBuildSnapshot && version. endsWith(" -SNAPSHOT" )) {
10197 throw new RuntimeException (" Cannot have a snapshot dependency on a plugin [$plugin . key ] for a release!" )
10298 }
103- mkp. version( version)
99+ mkp. version " \$ { ${ plugin.key } . version} "
104100 }
105101 }
106102
107- [' async' , ' events' ]. each { name ->
108- mkp. dependency {
109- mkp. groupId ' org.grails.plugins'
110- mkp. artifactId name
111- mkp. version( asyncVersion )
112- }
113- }
114-
115- [' gpars' , ' rxjava' , ' rxjava2' ]. each { name ->
116- mkp. dependency {
117- mkp. groupId ' org.grails'
118- mkp. artifactId " grails-async-$name "
119- mkp. version( asyncVersion )
120- }
121- mkp. dependency {
122- mkp. groupId ' org.grails'
123- mkp. artifactId " grails-events-$name "
124- mkp. version( asyncVersion )
125- }
126- }
127-
128- mkp. dependency {
129- mkp. groupId ' org.spockframework'
130- mkp. artifactId " spock-core"
131- mkp. version( spockVersion )
132- }
133-
134- mkp. dependency {
135- mkp. groupId ' org.spockframework'
136- mkp. artifactId " spock-spring"
137- mkp. version( spockVersion )
138- }
139-
140- mkp. dependency {
141- mkp. groupId ' org.grails.plugins'
142- mkp. artifactId " gsp"
143- mkp. version( gspVersion )
144- }
145-
146-
147- for (profile in profiles) {
103+ for (profile in profiles) {
148104 mkp. dependency {
149105 mkp. groupId ' org.grails.profiles'
150106 mkp. artifactId profile. key
151- def version = profile. value
152- if (! isBuildSnapshot && version. toString() . endsWith(" -SNAPSHOT" )) {
107+ String version = profile. value
108+ if (! isBuildSnapshot && version. endsWith(" -SNAPSHOT" )) {
153109 throw new RuntimeException (" Cannot have a snapshot dependency on a profile [$profile . key ] for a release!" )
154110 }
155111 mkp. version(version)
156112 }
157113 }
158-
159- [' gorm-' , ' web-' , ' ' ]. each { name ->
160- mkp. dependency {
161- mkp. groupId ' org.grails'
162- mkp. artifactId " grails-${ name} testing-support"
163- mkp. version( testingSupportVersion )
164- }
165- }
166114 }
167115 }
168116 }
169117 }
170-
171118 }
172119 }
173120}
0 commit comments