-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
418 additions
and
38 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
kotlin.code.style=official | ||
version=1.0.0-SNAPSHOT | ||
version=1.0.0 |
This file contains 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 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 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
57 changes: 57 additions & 0 deletions
57
src/main/java/io/gofannon/gradle/cots/report/ReportFormatter.java
This file contains 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,57 @@ | ||
/* | ||
* Copyright (c) 2024 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.gofannon.gradle.cots.report; | ||
|
||
import org.gradle.api.NonNullApi; | ||
import org.gradle.api.tasks.diagnostics.internal.ProjectDetails; | ||
import org.gradle.internal.logging.text.StyledTextOutput; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Formatter for dependency report | ||
*/ | ||
@NonNullApi | ||
public interface ReportFormatter { | ||
|
||
/** | ||
* Inject the console output | ||
* | ||
* @param output the console output | ||
*/ | ||
void setOutput(StyledTextOutput output); | ||
|
||
/** | ||
* Print the header of the project | ||
* | ||
* @param project the project to print | ||
*/ | ||
void printProjectHeader(ProjectDetails project); | ||
|
||
/** | ||
* Print the configurations in the project | ||
* | ||
* @param configurationNames the names of the configurations | ||
*/ | ||
void printConfigurations(List<String> configurationNames); | ||
|
||
/** | ||
* Print the dependencies in the project | ||
* | ||
* @param dependencyIdList the list of the dependency identifiers | ||
*/ | ||
void printDependencies(List<String> dependencyIdList); | ||
} |
62 changes: 62 additions & 0 deletions
62
src/main/java/io/gofannon/gradle/cots/report/TextReportFormatter.java
This file contains 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,62 @@ | ||
/* | ||
* Copyright (c) 2024 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.gofannon.gradle.cots.report; | ||
|
||
import org.gradle.api.NonNullApi; | ||
import org.gradle.api.tasks.diagnostics.internal.ProjectDetails; | ||
import org.gradle.internal.logging.text.StyledTextOutput; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Dependency report formatter that generates report in text format | ||
*/ | ||
@NonNullApi | ||
public class TextReportFormatter implements ReportFormatter { | ||
|
||
private StyledTextOutput output; | ||
|
||
@Override | ||
public void setOutput(StyledTextOutput output) { | ||
this.output = output; | ||
} | ||
|
||
@Override | ||
public void printProjectHeader(ProjectDetails project) { | ||
output.println("---------------------------------") | ||
.println("--- " + project.getDisplayName()) | ||
.println("---------------------------------"); | ||
} | ||
|
||
@Override | ||
public void printConfigurations(List<String> configurationNames) { | ||
output.println("--- COTS configurations"); | ||
configurationNames.stream() | ||
.sorted(String::compareTo) | ||
.forEach(output::println); | ||
output.println(); | ||
} | ||
|
||
|
||
@Override | ||
public void printDependencies(List<String> dependencyIdList) { | ||
output.println("--- COTS dependencies"); | ||
dependencyIdList.stream() | ||
.sorted(String::compareTo) | ||
.forEach(output::println); | ||
} | ||
} |
Oops, something went wrong.