Skip to content

Commit 5b87328

Browse files
committed
1 parent 2a23c9e commit 5b87328

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

build-dist.gradle

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@
1919
* publish to a Maven repository.
2020
*/
2121

22-
assert cpFileTree.files.size() > 0:
22+
assert ext.cpFileTree.files.size() > 0:
2323
'''Due to boot-strapping issue, you must build the jar with 'build.gradle'
2424
before you can use build file 'build-dist.gradle'.
2525
'''
26-
assert cpFileTree.files.size() < 2:
26+
assert ext.cpFileTree.files.size() < 2:
2727
'''Due to boot-strapping issue, you must have just one project jar before
2828
you can use build file 'build-dist.gradle'. Please run 'gradlew clean jar'.
2929
'''
3030
buildscript {
31-
cpFileTree = fileTree(
31+
ext.cpFileTree = fileTree(
3232
dir: 'build/libs',
3333
excludes: ['*-sources.jar', '*-javadoc.jar'],
3434
include: 'gradle-javaPropFile-plugin-*.jar'
3535
)
36-
dependencies { classpath cpFileTree }
36+
dependencies { classpath ext.cpFileTree }
3737
}
3838

3939
apply plugin: 'maven'
@@ -85,7 +85,9 @@ uploadArchives {
8585

8686
repositories.mavenDeployer {
8787
configuration = configurations.deployJars
88-
beforeDeployment { MavenDeployment deployment -> signPom(deployment) }
88+
beforeDeployment {
89+
MavenDeployment deployment -> signing.signPom(deployment)
90+
}
8991
if (project.hasProperty('mavenRepository.dest.url'))
9092
repository(url: project.property('mavenRepository.dest.url')) {
9193
authentication(authMap)

src/main/groovy/com/admc/gradle/JavaPropFile.groovy

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -944,9 +944,14 @@ Failed to resolve DomainExtensionObject ref though succeeded earlier:
944944
*/
945945
private static void setPossiblyNestedValue(Boolean dotDeref,
946946
Object topObject, String propertyPath, Object newValue) {
947+
/* For the two tests beginning with 'topObject.hasProperty' and
948+
* 'object.hasProperty', see
949+
* http://forums.gradle.org/gradle/topics/project_description_vs_project_ext_description
950+
*/
947951
if (!dotDeref) {
948952
if (topObject.hasProperty('ext') && ExtraPropertiesExtension.
949-
isAssignableFrom(topObject.ext.getClass()))
953+
isAssignableFrom(topObject.ext.getClass()) &&
954+
!topObject.hasProperty(propertyPath))
950955
topObject.ext[propertyPath] = newValue
951956
else
952957
topObject[propertyPath] = newValue
@@ -960,7 +965,8 @@ Failed to resolve DomainExtensionObject ref though succeeded earlier:
960965
object = object[it.replace('\u001F', '.')]
961966
}
962967
if (object.hasProperty('ext') &&
963-
ExtraPropertiesExtension.isAssignableFrom(object.ext.getClass()))
968+
ExtraPropertiesExtension.isAssignableFrom(object.ext.getClass()) &&
969+
!object.hasProperty(propertyName))
964970
object.ext[propertyName.replace('\u001F', '.')] = newValue
965971
else
966972
object[propertyName.replace('\u001F', '.')] = newValue

0 commit comments

Comments
 (0)