Skip to content
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

Task to update plugin and dependencies #193

Merged
merged 16 commits into from
Dec 7, 2021
Merged

Task to update plugin and dependencies #193

merged 16 commits into from
Dec 7, 2021

Conversation

santitigaga
Copy link
Contributor

@santitigaga santitigaga commented Dec 3, 2021

Before submitting a pull request, please read
https://github.com/bancolombia/scaffold-clean-architecture/wiki/Contributing

Description

In this pull request append the task to update the dependency plugin and another dependencies

Category

  • Feature
  • Fix

Checklist

  • The pull request is complete according to the guide of contributing
  • Automated tests are written
  • The documentation is up-to-date
  • The pull request has a descriptive title that describes what has changed, and provides enough context for the changelog

@santitigaga santitigaga self-assigned this Dec 3, 2021
@santitigaga santitigaga added the enhancement New feature or request label Dec 3, 2021
public static List<String> getAllFilesWithExtension(boolean isKotlin) throws IOException {
String extension = isKotlin ? "gradle.kts" : "gradle";
List<String> paths;
try (Stream<Path> walk = Files.walk(Paths.get("."))) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you explain us why you are looking for the extensions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jakspok that is because in tests this function walk in all directories, and found files that are not found in the project folder, if you have another solution i am open to change that.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 6, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 10 Code Smells

83.5% 83.5% Coverage
0.0% 0.0% Duplication

@@ -66,7 +72,18 @@ public ModuleBuilder(Project project) {
}

public void persist() throws IOException {
Release latestRelease = restService.getLatestPluginVersion();
if (latestRelease != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

if (latestRelease != null && !latestRelease.getTagName().equals(Utils.getVersionPlugin()))
in a if the evaluation is left to right

logger.lifecycle("Updating dependencies");
List<String> gradleFiles = Utils.getAllFilesWithExtension(builder.isKotlin());

if (dependencies.isEmpty()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe that this 'if' can be removed because if the collections is empty don't do noting. the only inconvenient in when the collection is null, i don know if this case occur

@santitigaga santitigaga merged commit 59cec31 into master Dec 7, 2021
@santitigaga santitigaga deleted the updateTask branch December 7, 2021 19:46
@github-actions
Copy link

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants