Skip to content

Commit

Permalink
Reverted changes that made environment names and user names immutable…
Browse files Browse the repository at this point in the history
…, and updated the changelog
  • Loading branch information
stevesaliman committed May 8, 2014
1 parent 3277b7b commit c74a11f
Show file tree
Hide file tree
Showing 4 changed files with 162 additions and 235 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG
@@ -1,3 +1,14 @@
Changes for 1.3.2
=================
With Björn Kautler's help, we've made the following changes for 1.3.2.
- Errors and omissions from the README have been corrected.

- The names of the properties where the plugin will get the environment name
and the user name are now configurable (Issue #9).

- The maven central credentials are now only required if I'm actually uploading
to maven central, so other users can now build the plugin. (Issue #10).

Changes for 1.3.1
=================
- Filter tokens used to contain property names in dot notation (some.var.name),
Expand Down
5 changes: 3 additions & 2 deletions README.md
Expand Up @@ -2,7 +2,8 @@
The Properties plugin is a useful plugin that changes the way Gradle loads
properties from the various properties files. See the [CHANGELOG]
(http://github.com/stevesaliman/gradle-properties-plugin/blob/master/CHANGELOG)
for recent changes.
for recent changes, with a thank you to Björn Kautler for his work on the
1.3.2 release.

Gradle can add properties to your project in several ways, as documented in the
Gradle [User Guide]
Expand Down Expand Up @@ -172,7 +173,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'net.saliman:gradle-properties-plugin:1.3.1'
classpath 'net.saliman:gradle-properties-plugin:1.3.2'
}
}
Expand Down
Expand Up @@ -107,17 +107,6 @@ class PropertiesPlugin implements Plugin<Project> {
def envName = project."$project.propertiesPluginEnvironmentNameProperty"
project.ext.filterTokens = [:]

// Remember values of unmodifiable properties
def unmodifiableProperties = [:]
[
'propertiesPluginEnvironmentNameProperty',
project.propertiesPluginEnvironmentNameProperty,
'propertiesPluginGradleUserNameProperty',
project.propertiesPluginGradleUserNameProperty
].each {
unmodifiableProperties."$it" = project.hasProperty(it) ? project."$it" : null
}

// process files from least significant to most significant. With gradle
// properties, Last one in wins.
def foundEnvFile = false
Expand All @@ -143,14 +132,6 @@ class PropertiesPlugin implements Plugin<Project> {
throw new FileNotFoundException("No environment files were found for the '$envName' environment")
}

// Check values of unmodifiable properties for modifications
unmodifiableProperties.each { key, value ->
if (project.hasProperty(key) ? value != project."$key" : value) {
throw new GradleException("The property '$key' must not change its value by applying the property file ordering of the properties plugin. " +
"Current value: '$value'; New value: '${project.hasProperty(key) ? project."$key" : ''}'")
}
}

// Register a task listener that adds the property checking helper methods.
registerTaskListener(project)
}
Expand Down

0 comments on commit c74a11f

Please sign in to comment.