Skip to content

Commit 94f77fa

Browse files
committed
Merge remote-tracking branch 'origin/7.0.x'
2 parents d4f5ebe + 213ea64 commit 94f77fa

File tree

2 files changed

+23
-27
lines changed

2 files changed

+23
-27
lines changed

build.gradle

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ buildscript {
66
dependencies {
77
classpath "io.github.gradle-nexus:publish-plugin:1.1.0"
88
classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
9-
classpath "io.github.groovylang.groovydoc:groovydoc-gradle-plugin:1.0.1"
109
}
1110
}
1211

13-
project.ext {
12+
ext {
1413
isTravisBuild = System.getenv().get("TRAVIS") == 'true'
1514
// overall project version
1615
isCiBuild = project.hasProperty("isCiBuild")
17-
isBuildSnapshot = version.endsWith("-SNAPSHOT")
16+
isSnapshot = project.projectVersion.endsWith("-SNAPSHOT")
17+
isReleaseVersion = !isSnapshot
1818

1919
nexusUsername = System.getenv("SONATYPE_USERNAME") ?: project.hasProperty("sonatypeOssUsername") ? project.sonatypeOssUsername : ''
2020
nexusPassword = System.getenv("SONATYPE_PASSWORD") ?: project.hasProperty("sonatypeOssPassword") ? project.sonatypeOssPassword : ''
@@ -36,14 +36,10 @@ group = "org.grails"
3636
apply plugin: 'idea'
3737
apply plugin: 'project-report'
3838

39-
ext {
40-
isCiBuild = project.hasProperty("isCiBuild")
41-
}
42-
4339
allprojects {
4440
repositories {
4541
maven { url "https://repo.grails.org/grails/core" }
46-
if(isBuildSnapshot) {
42+
if(isSnapshot) {
4743
maven { url "https://repo.grails.org/grails/libs-snapshots-local" }
4844
}
4945
if(groovyVersion && groovyVersion.endsWith('-SNAPSHOT')) {
@@ -75,11 +71,11 @@ subprojects {
7571
version = project.projectVersion
7672
group = "org.grails"
7773

78-
afterEvaluate { project ->
79-
if (isGroovyProject(project)) {
80-
def hasSnapshotVersion = project.version.endsWith("-SNAPSHOT")
81-
if(isBuildSnapshot != hasSnapshotVersion) {
82-
throw new StopExecutionException("${project.name} has version \"${project.version}\" which is${isBuildSnapshot ? 'n\'t' : ''} a snapshot version.")
74+
afterEvaluate { subproject ->
75+
if (isGroovyProject(subproject)) {
76+
def hasSnapshotVersion = subproject.version.endsWith("-SNAPSHOT")
77+
if(isSnapshot != hasSnapshotVersion) {
78+
throw new StopExecutionException("${subproject.name} has version \"${subproject.version}\" which is${isSnapshot ? 'n\'t' : ''} a snapshot version.")
8379
}
8480
}
8581
}
@@ -277,7 +273,7 @@ task test(dependsOn: getTasksByName("test", true)) {
277273
}
278274
}
279275

280-
if (!isBuildSnapshot) {
276+
if (isReleaseVersion) {
281277
nexusPublishing {
282278
transitionCheckOptions {
283279
maxRetries.set(50)

grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/config/Entity.groovy

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class Entity<P extends Property> {
8282
return defaultSort
8383
}
8484

85-
Entity setSort(Object defaultSort) {
85+
Entity<P> setSort(Object defaultSort) {
8686
this.defaultSort = defaultSort
8787
return this
8888
}
@@ -99,7 +99,7 @@ class Entity<P extends Property> {
9999
* @param name
100100
* @return
101101
*/
102-
Entity datasource(String name) {
102+
Entity<P> datasource(String name) {
103103
this.datasources = [name]
104104
return this
105105
}
@@ -111,7 +111,7 @@ class Entity<P extends Property> {
111111
* @param name
112112
* @return
113113
*/
114-
Entity connection(String name) {
114+
Entity<P> connection(String name) {
115115
this.datasources = [name]
116116
return this
117117
}
@@ -123,7 +123,7 @@ class Entity<P extends Property> {
123123
* @param name
124124
* @return
125125
*/
126-
Entity connections(String...names) {
126+
Entity<P> connections(String...names) {
127127
connections(Arrays.asList(names))
128128
return this
129129
}
@@ -134,7 +134,7 @@ class Entity<P extends Property> {
134134
* @param name
135135
* @return
136136
*/
137-
Entity connections(List<String> names) {
137+
Entity<P> connections(List<String> names) {
138138
if(names != null && names.size() > 0) {
139139
this.datasources = names
140140
}
@@ -172,7 +172,7 @@ class Entity<P extends Property> {
172172
* @param identityConfig The id config
173173
* @return This mapping
174174
*/
175-
Entity<P> id(@DelegatesTo(Property) Closure identityConfig) {
175+
Entity<P> id(@DelegatesTo(type='P') Closure identityConfig) {
176176
Property.configureExisting(
177177
getOrInitializePropertyConfig(GormProperties.IDENTITY),
178178
identityConfig
@@ -185,7 +185,7 @@ class Entity<P extends Property> {
185185
*
186186
* @param isVersioned True if a version property should be configured
187187
*/
188-
Entity version(@DelegatesTo(Property) Closure versionConfig) {
188+
Entity<P> version(@DelegatesTo(type='P') Closure versionConfig) {
189189
P pc = getOrInitializePropertyConfig(GormProperties.VERSION)
190190
Property.configureExisting(pc, versionConfig)
191191
return this
@@ -196,7 +196,7 @@ class Entity<P extends Property> {
196196
*
197197
* @param isVersioned True if a version property should be configured
198198
*/
199-
Entity version(Map versionConfig) {
199+
Entity<P> version(Map versionConfig) {
200200
P pc = getOrInitializePropertyConfig(GormProperties.VERSION)
201201
Property.configureExisting(pc, versionConfig)
202202
return this
@@ -207,7 +207,7 @@ class Entity<P extends Property> {
207207
*
208208
* @param tenantIdProperty The tenant id property
209209
*/
210-
Entity tenantId(String tenantIdProperty) {
210+
Entity<P> tenantId(String tenantIdProperty) {
211211
P pc = getOrInitializePropertyConfig(GormProperties.TENANT_IDENTITY)
212212
pc.name = tenantIdProperty
213213
return this
@@ -218,7 +218,7 @@ class Entity<P extends Property> {
218218
* @param propertyConfig The property config
219219
* @return This mapping
220220
*/
221-
Entity property(String name, @DelegatesTo(Property) Closure propertyConfig) {
221+
Entity<P> property(String name, @DelegatesTo(type='P') Closure propertyConfig) {
222222
P pc = getOrInitializePropertyConfig(name)
223223
Property.configureExisting(pc, propertyConfig)
224224
return this
@@ -230,7 +230,7 @@ class Entity<P extends Property> {
230230
* @param propertyConfig The property config
231231
* @return This mapping
232232
*/
233-
Entity property(String name, Map propertyConfig) {
233+
Entity<P> property(String name, Map propertyConfig) {
234234
P pc = getOrInitializePropertyConfig(name)
235235
Property.configureExisting(pc, propertyConfig)
236236
return this
@@ -242,7 +242,7 @@ class Entity<P extends Property> {
242242
* @param propertyConfig The property config
243243
* @return This mapping
244244
*/
245-
P property(@DelegatesTo(Property) Closure propertyConfig) {
245+
P property(@DelegatesTo(type='P') Closure propertyConfig) {
246246
if(propertyConfigs.containsKey('*')) {
247247
P cloned = cloneGlobalConstraint()
248248
return Property.configureExisting(cloned, propertyConfig)
@@ -277,7 +277,7 @@ class Entity<P extends Property> {
277277
* @param config The configuration
278278
* @return The new instance
279279
*/
280-
static <T extends Entity> T configureExisting(T mapping, @DelegatesTo(Entity) Closure config) {
280+
static <T extends Entity> T configureExisting(@DelegatesTo.Target T mapping, @DelegatesTo(genericTypeIndex = 0) Closure config) {
281281
config.setDelegate(mapping)
282282
config.setResolveStrategy(Closure.DELEGATE_ONLY)
283283
config.call()

0 commit comments

Comments
 (0)