Skip to content

Commit

Permalink
reduce usages of at execution time and document methods running at ex…
Browse files Browse the repository at this point in the history
…ecution time
  • Loading branch information
mgroth0 committed Oct 18, 2024
1 parent de785be commit 54e1050
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ abstract class AbstractAnalyze extends ConfiguredTask {
@Internal
String currentProjectName = project.getName()

@Internal
String currentProjectGroup = project.getGroup()

@Internal
String currentProjectVersion = project.getVersion().toString()



/**
* Gets the projects display name. Project.getDisplayName() has been
* introduced with Gradle 3.3, thus we need to check for the method's
Expand Down Expand Up @@ -123,8 +131,8 @@ abstract class AbstractAnalyze extends ConfiguredTask {
try {
String name = currentProjectName
String displayName = currentProjectDisplayName
String groupId = project.getGroup()
String version = project.getVersion().toString()
String groupId = currentProjectGroup
String version = currentProjectVersion
File output = new File(config.outputDirectory)
for (String f : getReportFormats(config.format, config.formats)) {
engine.writeReports(displayName, groupId, name, version, output, f, exCol)
Expand Down Expand Up @@ -219,6 +227,7 @@ abstract class AbstractAnalyze extends ConfiguredTask {

/**
* Loads the projects dependencies into the dependency-check analysis engine.
* Runs at execution time
*/
abstract scanDependencies(Engine engine)

Expand Down Expand Up @@ -404,6 +413,7 @@ abstract class AbstractAnalyze extends ConfiguredTask {

/**
* Process the incoming artifacts for the given project's configurations.
* Runs at execution time.
* @param project the project to analyze
* @param engine the dependency-check engine
*/
Expand All @@ -416,7 +426,7 @@ abstract class AbstractAnalyze extends ConfiguredTask {
if (CUTOVER_GRADLE_VERSION.compareTo(GradleVersion.current()) > 0) {
processConfigLegacy configuration, engine
} else {
processConfigV4 project.name, configuration, engine, true
processConfigV4 currentProjectName, configuration, engine, true
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class Aggregate extends AbstractAnalyze {

/**
* Loads the projects dependencies into the dependency-check analysis engine.
* Runs at execution time
*/
def scanDependencies(Engine engine) {
logger.lifecycle("Verifying dependencies for project ${currentProjectName}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class Analyze extends AbstractAnalyze {

/**
* Loads the projects dependencies into the dependency-check analysis engine.
* Runs at execution time
*/
def scanDependencies(Engine engine) {
if (shouldBeScanned(currentProjectPath) && !shouldBeSkipped(currentProjectPath)) {
Expand Down

0 comments on commit 54e1050

Please sign in to comment.