-
Notifications
You must be signed in to change notification settings - Fork 105
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
963: Bug during composer json generation #972
963: Bug during composer json generation #972
Conversation
Iamwade
commented
Feb 9, 2022
- Fixes Bug during composer json generation if in dependent module version tag is not specified #963
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.
Hello, @Iamwade!
Please, check my suggestions.
@@ -184,16 +184,15 @@ private String getDependenciesString(final List dependenciesList) { | |||
composerJsonFile.getText() | |||
); | |||
final JSONObject jsonObject = (JSONObject) obj; |
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.
jsonObject can be null as well.
@@ -184,16 +184,15 @@ private String getDependenciesString(final List dependenciesList) { | |||
composerJsonFile.getText() | |||
); | |||
final JSONObject jsonObject = (JSONObject) obj; | |||
final String versionJsonElement = jsonObject.get("version").toString(); | |||
final String versionJsonElement = jsonObject.get("version") == null | |||
? "*" : jsonObject.get("version").toString(); | |||
final String nameJsonElement = jsonObject.get("name").toString(); |
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.
jsonObject.get("name") can be null as well.
.toString(); | ||
} | ||
version = versionJsonElement; | ||
final int minorVersionSeparator = version.lastIndexOf('.'); |
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.
We should not do this if there is no version specified.
…plugin into 963-bug-composer-json-generation
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.
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.
Looks good 👍