-
-
Notifications
You must be signed in to change notification settings - Fork 970
Preserving Parameter Names #15382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rahulshishodia
wants to merge
10
commits into
apache:8.0.x
Choose a base branch
from
rahulshishodia:preserve-param-names
base: 8.0.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Preserving Parameter Names #15382
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
38e1ed7
Preserving Parameter Names
rahulshishodia 127f01e
updated skeleton build.gradle
rahulshishodia 13675ab
Merge branch '8.0.x' into preserve-param-names
rahulshishodia 7661d1c
removed hardcoded UTF_8 encoding as not all files are UTF-8 encoded a…
rahulshishodia 1a83ae0
Added preserve parameter in grails-gradle-plugin
rahulshishodia 88586a0
reverted previous changes in build.gradle
rahulshishodia 8ec535d
improved logging
rahulshishodia aa0afee
addressed review comments
rahulshishodia f231d92
addressed review comments #2
rahulshishodia 90b8a5a
Merge branch '8.0.x' into preserve-param-names
rahulshishodia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...s/src/test/groovy/org/grails/gradle/plugin/core/GrailsGradlePreserveParametersSpec.groovy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| package org.grails.gradle.plugin.core | ||
|
|
||
| class GrailsGradlePreserveParametersSpec extends GradleSpecification { | ||
|
|
||
| def "Grails extension is created with default preserveParameterNames = true"() { | ||
| given: | ||
| setupTestResourceProject('preserve-params-default') | ||
|
|
||
| when: | ||
| def result = executeTask('inspectPreserveParam') | ||
|
|
||
| then: | ||
| result.output.contains("HAS_PRESERVE_PARAM_ENABLED=true") | ||
| } | ||
|
|
||
| def "preserveParameterNames can be configured to false via grails block"() { | ||
| given: | ||
| setupTestResourceProject('preserve-params-disabled') | ||
|
|
||
| when: | ||
| def result = executeTask('inspectPreserveParam') | ||
|
|
||
| then: | ||
| result.output.contains("HAS_PRESERVE_PARAM_ENABLED=false") | ||
| } | ||
|
|
||
| def "GroovyCompile tasks get parameters = true when preserveParameterNames is enabled"() { | ||
| given: | ||
| setupTestResourceProject('preserve-params-enabled') | ||
|
|
||
| when: | ||
| def result = executeTask('inspectPreserveParam') | ||
|
|
||
| then: | ||
| result.output.contains("HAS_PRESERVE_PARAM_ENABLED=true") | ||
| } | ||
|
|
||
| } |
11 changes: 11 additions & 0 deletions
11
grails-gradle/plugins/src/test/resources/test-projects/preserve-params-default/build.gradle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| plugins { | ||
| id 'org.apache.grails.gradle.grails-app' | ||
| } | ||
|
|
||
| tasks.register('inspectPreserveParam') { | ||
| doLast { | ||
| def compileTasks = tasks.withType(GroovyCompile) | ||
| def paramsEnabled = compileTasks.every { it.groovyOptions.parameters } | ||
| println "HAS_PRESERVE_PARAM_ENABLED=${paramsEnabled}" | ||
| } | ||
| } |
1 change: 1 addition & 0 deletions
1
...gradle/plugins/src/test/resources/test-projects/preserve-params-default/gradle.properties
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| grailsVersion=__PROJECT_VERSION__ |
Empty file.
1 change: 1 addition & 0 deletions
1
...s-gradle/plugins/src/test/resources/test-projects/preserve-params-default/settings.gradle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| rootProject.name = 'test-preserve-params-default' |
15 changes: 15 additions & 0 deletions
15
grails-gradle/plugins/src/test/resources/test-projects/preserve-params-disabled/build.gradle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| plugins { | ||
| id 'org.apache.grails.gradle.grails-app' | ||
| } | ||
|
|
||
| grails { | ||
| preserveParameterNames = false | ||
| } | ||
|
|
||
| tasks.register('inspectPreserveParam') { | ||
| doLast { | ||
| def compileTasks = tasks.withType(GroovyCompile) | ||
| def paramsEnabled = compileTasks.every { it.groovyOptions.parameters } | ||
| println "HAS_PRESERVE_PARAM_ENABLED=${paramsEnabled}" | ||
| } | ||
| } |
1 change: 1 addition & 0 deletions
1
...radle/plugins/src/test/resources/test-projects/preserve-params-disabled/gradle.properties
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| grailsVersion=__PROJECT_VERSION__ |
Empty file.
1 change: 1 addition & 0 deletions
1
...-gradle/plugins/src/test/resources/test-projects/preserve-params-disabled/settings.gradle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| rootProject.name = 'test-preserve-params-disabled' |
15 changes: 15 additions & 0 deletions
15
grails-gradle/plugins/src/test/resources/test-projects/preserve-params-enabled/build.gradle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| plugins { | ||
| id 'org.apache.grails.gradle.grails-app' | ||
| } | ||
|
|
||
| grails { | ||
| preserveParameterNames = true | ||
| } | ||
|
|
||
| tasks.register('inspectPreserveParam') { | ||
| doLast { | ||
| def compileTasks = tasks.withType(GroovyCompile) | ||
| def paramsEnabled = compileTasks.every { it.groovyOptions.parameters } | ||
| println "HAS_PRESERVE_PARAM_ENABLED=${paramsEnabled}" | ||
| } | ||
| } | ||
1 change: 1 addition & 0 deletions
1
...gradle/plugins/src/test/resources/test-projects/preserve-params-enabled/gradle.properties
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| grailsVersion=__PROJECT_VERSION__ |
Empty file.
1 change: 1 addition & 0 deletions
1
...s-gradle/plugins/src/test/resources/test-projects/preserve-params-enabled/settings.gradle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| rootProject.name = 'test-preserve-params-enabled' |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for adding tests as you make these changes