-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Gradle init doesn't escape single quotes #20981
Comments
h0tk3y
added
in:build-init-plugin
🌱 internal-onboarding
Good issues to onboard new Gradle team members
and removed
to-triage
labels
Jun 10, 2022
I can try to fix this 🙂 |
13 tasks
nice one. 👍🏼 |
bot-gradle
added a commit
that referenced
this issue
Jul 11, 2022
<!--- The issue this PR addresses --> Fixes #20981 ### Context <!--- Why do you believe many users will benefit from this change? --> <!--- Link to relevant issues or forum discussions here --> Currently, the gradle init command doesn't escape quotes in literal strings (e.g. the value of the description field) in generated build.gradle.kts files. This commit causes Gradle to correctly escape quotes in these strings (single quotes when generating Groovy and double quotes for Kotlin). ### Contributor Checklist - [x] [Review Contribution Guidelines](https://github.com/gradle/gradle/blob/master/CONTRIBUTING.md) - [x] Make sure that all commits are [signed off](https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---signoff) to indicate that you agree to the terms of [Developer Certificate of Origin](https://developercertificate.org/). - [x] Make sure all contributed code can be distributed under the terms of the [Apache License 2.0](https://github.com/gradle/gradle/blob/master/LICENSE), e.g. the code was written by yourself or the original code is licensed under [a license compatible to Apache License 2.0](https://apache.org/legal/resolved.html). - [x] Check ["Allow edit from maintainers" option](https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) in pull request so that additional changes can be pushed by Gradle team - [x] Provide integration tests (under `<subproject>/src/integTest`) to verify changes from a user perspective - [x] Provide unit tests (under `<subproject>/src/test`) to verify logic - [x] Update User Guide, DSL Reference, and Javadoc for public-facing changes - [x] Ensure that tests pass sanity check: `./gradlew sanityCheck` - [x] Ensure that tests pass locally: `./gradlew <changed-subproject>:quickTest` ### Gradle Core Team Checklist - [x] Verify design and implementation - [x] Verify test coverage and CI build status - [x] Verify documentation - [x] Recognize contributor in release notes Co-authored-by: Thomas Broadley <buriedunderbooks@hotmail.com>
@tbroadley thanks again for the code contribution. |
This was referenced Jan 5, 2023
Closed
lptr
added
good first issue
Good for newcomers
and removed
🌱 internal-onboarding
Good issues to onboard new Gradle team members
labels
Jun 15, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using
gradle init
(with default settings / groovy output) to convert a maven-based project to gradle, I noticed that, when thename
property in pom.xml contains a single quote, it produces an invalid line in build.gradle.Expected Behavior
gradle should ensure escaping of single-quotes when copying over strings from pom.xml to build.gradle
Current Behavior
Worth noting that with kotlin output the same lack of escaping happens for double-quotes.
Steps to Reproduce
POC repository: https://github.com/otrosien/gradle-init-bug-poc
Your Environment
The text was updated successfully, but these errors were encountered: