snyk-gradle-plugin
Advanced tools
Comparing version 3.24.3 to 3.24.4
@@ -20,2 +20,3 @@ import { DepGraph } from '@snyk/dep-graph'; | ||
defaultProject: string; | ||
defaultProjectKey: string; | ||
projects: ProjectsDict; | ||
@@ -22,0 +23,0 @@ allSubProjectNames: string[]; |
@@ -130,6 +130,13 @@ "use strict"; | ||
function getTargetProject(subProject, allProjectDeps, allSubProjectNames) { | ||
const { projects, defaultProject, versionBuildInfo } = allProjectDeps; | ||
const targetProject = subProject || defaultProject; | ||
const { projects, defaultProject, defaultProjectKey, versionBuildInfo } = allProjectDeps; | ||
let gradleProjectName = defaultProject; | ||
if (subProject) { | ||
// TODO: we don't want to break the existing implementation of --sub-project using name | ||
// we would like a relative path instead to have a unique identifier | ||
if (subProject != '.') { | ||
subProject = | ||
allSubProjectNames.find((it) => it === subProject) || | ||
allSubProjectNames.find((it) => it.match(`/${subProject}`)) || | ||
subProject; | ||
} | ||
if (!allProjectDeps.projects || !allProjectDeps.projects[subProject]) { | ||
@@ -140,2 +147,3 @@ throw new errors_1.MissingSubProjectError(subProject, allSubProjectNames); | ||
} | ||
const targetProject = subProject || defaultProjectKey; | ||
const { depGraph } = projects[targetProject]; | ||
@@ -388,3 +396,3 @@ return { | ||
for (const projectId in extractedJSON.projects) { | ||
const { defaultProject } = extractedJSON; | ||
const { defaultProject, defaultProjectKey } = extractedJSON; | ||
const { snykGraph, projectVersion } = extractedJSON.projects[projectId]; | ||
@@ -396,3 +404,3 @@ if (!snykGraph) { | ||
const isValidRootDir = invalidValues.indexOf(root) === -1; | ||
const isSubProject = projectId !== defaultProject; | ||
const isSubProject = projectId !== defaultProjectKey; | ||
let projectName = isValidRootDir ? path.basename(root) : defaultProject; | ||
@@ -399,0 +407,0 @@ if (isSubProject) { |
@@ -60,3 +60,3 @@ { | ||
}, | ||
"version": "3.24.3" | ||
"version": "3.24.4" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
84938
838