Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

Fix properties in release script #82

Merged
merged 2 commits into from Feb 14, 2018
Merged

Fix properties in release script #82

merged 2 commits into from Feb 14, 2018

Conversation

tasomaniac
Copy link
Contributor

The release script failed with MissingPropertyException while trying to set the property.

It seems that setProperty is meant to be used when the property is already available. If not, it throws an exception. The following map interface through properties map seems to be the way to do it.

While doing so, I also used or operator instead of the or method. Since it has less parenthesis, I think it is easier to see what's going on. I can revert that if wanted.

@@ -70,10 +70,10 @@ publishGhPages.dependsOn prepareGhCredentials

task prepareGradlePluginsRepoRelease {
doLast {
String key = buildProperties.env['GRADLE_PLUGINS_REPO_KEY'].or(buildProperties.secrets['gradle.publish.key']).string
String secret = buildProperties.env['GRADLE_PLUGINS_REPO_SECRET'].or(buildProperties.secrets['gradle.publish.secret']).string
project.setProperty('gradle.publish.key', key)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assumed this was working as @tobiasheine did the last release to Gradle Plugins Portal; does it mean that it wasn't the case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that release properties were read from a file. This change was not tested.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mr-archano the last release was not yet automated. This is the first one.

@tobiasheine tobiasheine merged commit ab30cbe into master Feb 14, 2018
@tobiasheine tobiasheine deleted the fix-properties branch February 14, 2018 09:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants