File tree Expand file tree Collapse file tree 3 files changed +26
-20
lines changed Expand file tree Collapse file tree 3 files changed +26
-20
lines changed Original file line number Diff line number Diff line change 2424 distribution : temurin
2525 java-version : 21
2626 - uses : gradle/actions/setup-gradle@v4
27- - name : Set up Go
28- uses : actions/setup-go@v5
29- with :
30- go-version : stable
31- cache : false
3227 - name : Scan
3328 run : make scan
Original file line number Diff line number Diff line change 22# SPDX-License-Identifier: Apache-2.0
33#
44
5- .PHONEY : scan
6- scan :
7- go install github.com/google/osv-scanner/cmd/osv-scanner@latest
8- ./gradlew --quiet resolveAndLockAll --write-locks
9- osv-scanner scan --lockfile=fabric-chaincode-shim/gradle.lockfile
5+ bin_dir := bin
6+ osv-scanner := $(bin_dir ) /osv-scanner
7+
8+ kernel_name := $(shell uname -s | tr '[:upper:]' '[:lower:]')
9+ machine_hardware := $(shell uname -m)
10+ ifeq ($(machine_hardware ) , x86_64)
11+ machine_hardware := amd64
12+ endif
13+ ifeq ($(machine_hardware ) , aarch64)
14+ machine_hardware := arm64
15+ endif
16+
17+ .PHONY : scan
18+ scan : $(osv-scanner )
19+ ./gradlew --quiet :fabric-chaincode-shim:dependencies --write-locks --configuration runtimeClasspath
20+ bin/osv-scanner scan --lockfile=fabric-chaincode-shim/gradle.lockfile
21+
22+ .PHONY : install-osv-scanner
23+ install-osv-scanner :
24+ mkdir -p ' $(bin_dir)'
25+ curl --fail --location --show-error --silent --output ' $(osv-scanner)' \
26+ 'https ://github.com/google/osv-scanner/releases/latest/download/osv-scanner_$(kernel_name ) _$(machine_hardware ) '
27+ chmod u+x ' $(osv-scanner)'
28+
29+ $(osv-scanner ) :
30+ $(MAKE ) install-osv-scanner
Original file line number Diff line number Diff line change @@ -26,16 +26,6 @@ configurations {
2626 }
2727}
2828
29- tasks. register(' resolveAndLockAll' ) {
30- notCompatibleWithConfigurationCache(" Filters configurations at execution time" )
31- doFirst {
32- assert gradle. startParameter. writeDependencyLocks : " $path must be run from the command line with the `--write-locks` flag"
33- }
34- doLast {
35- configurations. findAll { it. canBeResolved }. each { it. resolve() }
36- }
37- }
38-
3929tasks. withType(org.gradle.api.tasks.testing.Test ) {
4030 systemProperty ' CORE_CHAINCODE_LOGGING_LEVEL' , ' DEBUG'
4131}
You can’t perform that action at this time.
0 commit comments