snyk-gradle-plugin
Advanced tools
Comparing version 3.0.2 to 3.1.0
@@ -1,2 +0,2 @@ | ||
import { legacyPlugin as api, legacyCommon } from '@snyk/cli-interface'; | ||
import { legacyCommon, legacyPlugin as api } from '@snyk/cli-interface'; | ||
declare type DepTree = legacyCommon.DepTree; | ||
@@ -3,0 +3,0 @@ export interface GradleInspectOptions { |
@@ -11,4 +11,4 @@ "use strict"; | ||
const chalk_1 = require("chalk"); | ||
const cli_interface_1 = require("@snyk/cli-interface"); | ||
const debugModule = require("debug"); | ||
const cli_interface_1 = require("@snyk/cli-interface"); | ||
// To enable debugging output, use `snyk -d` | ||
@@ -55,5 +55,7 @@ let logger = null; | ||
} | ||
const scannedProjects = yield getAllDepsAllProjects(root, targetFile, options); | ||
plugin.meta = plugin.meta || {}; | ||
return { | ||
plugin, | ||
scannedProjects: yield getAllDepsAllProjects(root, targetFile, options), | ||
scannedProjects, | ||
}; | ||
@@ -69,2 +71,5 @@ } | ||
package: depTreeAndDepRootNames.depTree, | ||
meta: { | ||
gradleProjectName: depTreeAndDepRootNames.gradleProjectName, | ||
}, | ||
}; | ||
@@ -104,10 +109,12 @@ }); | ||
const allSubProjectNames = allProjectDeps.allSubProjectNames; | ||
let depDict = {}; | ||
if (subProject) { | ||
const { depTree, meta } = getDepsSubProject(root, subProject, allProjectDeps); | ||
return { | ||
depTree: getDepsSubProject(root, subProject, allProjectDeps), | ||
depTree, | ||
allSubProjectNames, | ||
gradleProjectName: meta.gradleProjectName, | ||
}; | ||
} | ||
depDict = allProjectDeps.projects[allProjectDeps.defaultProject].depDict; | ||
const { projects, defaultProject } = allProjectDeps; | ||
const { depDict } = projects[defaultProject]; | ||
return { | ||
@@ -123,2 +130,3 @@ depTree: { | ||
allSubProjectNames, | ||
gradleProjectName: defaultProject, | ||
}; | ||
@@ -129,14 +137,19 @@ }); | ||
const packageName = `${path.basename(root)}/${subProject}`; | ||
let depDict = {}; | ||
const gradleProjectName = `${allProjectDeps.defaultProject}/${subProject}`; | ||
if (!allProjectDeps.projects || !allProjectDeps.projects[subProject]) { | ||
throw new errors_1.MissingSubProjectError(subProject, Object.keys(allProjectDeps)); | ||
} | ||
depDict = allProjectDeps.projects[subProject].depDict; | ||
const depDict = allProjectDeps.projects[subProject].depDict; | ||
return { | ||
dependencies: depDict, | ||
name: packageName, | ||
// TODO: extract from project | ||
// https://snyksec.atlassian.net/browse/BST-558 | ||
version: '0.0.0', | ||
packageFormatVersion, | ||
depTree: { | ||
dependencies: depDict, | ||
name: packageName, | ||
// TODO: extract from project | ||
// https://snyksec.atlassian.net/browse/BST-558 | ||
version: '0.0.0', | ||
packageFormatVersion, | ||
}, | ||
meta: { | ||
gradleProjectName, | ||
}, | ||
}; | ||
@@ -150,5 +163,10 @@ } | ||
return Object.keys(allProjectDeps.projects).map((proj) => { | ||
const packageName = proj === allProjectDeps.defaultProject ? basePackageName : basePackageName + '/' + proj; | ||
const packageName = proj === allProjectDeps.defaultProject ? basePackageName : `${basePackageName}/${proj}`; | ||
const defaultProject = allProjectDeps.defaultProject; | ||
const gradleProjectName = proj === defaultProject ? defaultProject : `${defaultProject}/${proj}`; | ||
return { | ||
targetFile: targetFileFilteredForCompatibility(allProjectDeps.projects[proj].targetFile), | ||
meta: { | ||
gradleProjectName, | ||
}, | ||
depTree: { | ||
@@ -155,0 +173,0 @@ dependencies: allProjectDeps.projects[proj].depDict, |
@@ -29,3 +29,2 @@ { | ||
"devDependencies": { | ||
"@snyk/cli-interface": "^2.0.1", | ||
"@types/chalk": "^2.2.0", | ||
@@ -45,2 +44,3 @@ "@types/jest": "^24.0.13", | ||
"dependencies": { | ||
"@snyk/cli-interface": "^2.1.0", | ||
"@types/debug": "^4.1.4", | ||
@@ -53,3 +53,3 @@ "chalk": "^2.4.2", | ||
}, | ||
"version": "3.0.2" | ||
"version": "3.1.0" | ||
} |
@@ -7,18 +7,55 @@ ![Snyk logo](https://snyk.io/style/asset/logo/snyk-print.svg) | ||
## Snyk Gradle CLI Plugin | ||
# Snyk Gradle CLI Plugin | ||
This plugin provides dependency metadata for Gradle projects that use `gradle` and have a `build.gradle` file. | ||
Supported Snyk command line arguments: | ||
# Support | ||
❓No issues expected but test not updated yet to verify | ||
✅Supported and verified with tests | ||
## Supported OS | ||
| OS | Supported | | ||
|---|---| | ||
| Windows | ✅| | ||
| Linux | ✅| | ||
| OSX | ✅| | ||
## Supported Node versions | ||
| Node | Supported | | ||
|---|---| | ||
| 6 | ✅| | ||
| 8 | ✅| | ||
| 10 | ✅| | ||
| 12 | ❓| | ||
## Supported Java & Gradle versions | ||
| Java / Gradle | 2.* | 3.* | 4.* | 5.* | | ||
|---|---|---|---|---| | ||
| 8 | ✅ | ✅ | ✅ | ✅ | | ||
| 9 | ✅ | ✅ | ✅ | ✅ | | ||
| 10 | ✅ | ✅ | ✅ | ✅ | | ||
| 11 | ✅ | ✅ | ✅ | ✅ | | ||
| 13 | ❓ | ❓ | ❓ | ❓ | | ||
# Supported Snyk command line arguments: | ||
* `--gradle-sub-project=foo` return dependencies for a specific subproject (by default, return only the | ||
dependencies for the top-level project) | ||
Additional command line arguments to Gradle can be provided after `--`, for example: | ||
Additional command line arguments: | ||
* `-- --configuration=foo` only fetch dependencies for a certain configuration (by default, merged deps for | ||
all the configurations are returned). | ||
- `--all-sub-projects` for "multi project" configurations, test all sub-projects. | ||
- `--configuration-matching=<string>` Resolve dependencies using only configuration(s) that match the provided Java regular expression, e.g. '^releaseRuntimeClasspath$'. | ||
- `--configuration-attributes=<string>` Select certain values of configuration attributes to resolve the dependencies. E.g.: 'buildtype:release,usage:java-runtime' | ||
## Under the hood | ||
See `lib/init.gradle` for the Groovy script injected in Gradle builds to gather and resolve the dependencies. |
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
49435
12
467
61
7
+ Added@snyk/cli-interface@^2.1.0
+ Added@snyk/cli-interface@2.14.0(transitive)
+ Added@snyk/dep-graph@2.9.0(transitive)
+ Added@types/graphlib@2.1.12(transitive)
+ Addedevent-loop-spinner@2.3.2(transitive)
+ Addedlodash.clone@4.5.0(transitive)
+ Addedlodash.constant@3.0.0(transitive)
+ Addedlodash.filter@4.6.0(transitive)
+ Addedlodash.foreach@4.5.0(transitive)
+ Addedlodash.isempty@4.4.0(transitive)
+ Addedlodash.isequal@4.5.0(transitive)
+ Addedlodash.isfunction@3.0.9(transitive)
+ Addedlodash.isundefined@3.0.1(transitive)
+ Addedlodash.map@4.6.0(transitive)
+ Addedlodash.reduce@4.6.0(transitive)
+ Addedlodash.size@4.2.0(transitive)
+ Addedlodash.transform@4.6.0(transitive)
+ Addedlodash.union@4.6.0(transitive)
+ Addedlodash.values@4.3.0(transitive)
+ Addedobject-hash@3.0.0(transitive)
+ Addedpackageurl-js@1.2.0(transitive)
+ Addedsemver@7.6.3(transitive)
+ Addedtslib@2.8.0(transitive)