|
1 |
| -# Copyright (c) 2022 - 2022, Oracle and/or its affiliates. All rights reserved. |
| 1 | +# Copyright (c) 2022 - 2023, Oracle and/or its affiliates. All rights reserved. |
2 | 2 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/.
|
3 | 3 |
|
4 | 4 | # Use bash as the shell when executing a rule's recipe. For more details:
|
@@ -83,25 +83,27 @@ venv:
|
83 | 83 | # The _build.yaml GitHub Actions workflow expects dist directory to exist.
|
84 | 84 | # So we create the dist dir if it doesn't exist in the setup target.
|
85 | 85 | # See https://packaging.python.org/en/latest/tutorials/packaging-projects/#generating-distribution-archives.
|
86 |
| -# We also install SLSA verifier, mvnw, cyclonedx-go, and compile the Go modules. |
| 86 | +# We also install cyclonedx-go to generate SBOM for Go, compile the Go modules, |
| 87 | +# install SLSA verifier binary, and download mvnw. |
87 | 88 | .PHONY: setup
|
88 |
| -setup: force-upgrade setup-go |
| 89 | +setup: force-upgrade setup-go setup-binaries |
89 | 90 | pre-commit install
|
90 | 91 | mkdir -p dist
|
| 92 | + go install github.com/CycloneDX/cyclonedx-gomod/cmd/ [email protected] |
| 93 | +setup-go: |
| 94 | + go build -o $(MACARON_PATH)/bin/ $(MACARON_PATH)/golang/cmd/... |
| 95 | +setup-binaries: $(MACARON_PATH)/bin/slsa-verifier $(MACARON_PATH)/resources/mvnw |
| 96 | +$(MACARON_PATH)/bin/slsa-verifier: |
91 | 97 | git clone --depth 1 https://github.com/slsa-framework/slsa-verifier.git -b v2.0.1
|
92 | 98 | cd slsa-verifier/cli/slsa-verifier && go build -o $(MACARON_PATH)/bin/
|
93 | 99 | cd $(MACARON_PATH) && rm -rf slsa-verifier
|
94 |
| - go install github.com/CycloneDX/cyclonedx-gomod/cmd/ [email protected] |
95 |
| - echo "GOPATH=$$GOPATH" |
96 |
| - ls $$HOME/go/bin |
| 100 | +$(MACARON_PATH)/resources/mvnw: |
97 | 101 | cd resources \
|
98 | 102 | && wget https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper-distribution/3.1.1/maven-wrapper-distribution-3.1.1-bin.zip \
|
99 | 103 | && unzip -o maven-wrapper-distribution-3.1.1-bin.zip \
|
100 | 104 | && rm -r maven-wrapper-distribution-3.1.1-bin.zip \
|
101 | 105 | && echo -e "distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip\nwrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar" > .mvn/wrapper/maven-wrapper.properties \
|
102 | 106 | && cd $(MACARON_PATH)
|
103 |
| -setup-go: |
104 |
| - go build -o $(MACARON_PATH)/bin/ $(MACARON_PATH)/golang/cmd/... |
105 | 107 |
|
106 | 108 | # Install or upgrade an existing virtual environment based on the
|
107 | 109 | # package dependencies declared in pyproject.toml and go.mod.
|
@@ -258,7 +260,11 @@ clean: dist-clean bin-clean
|
258 | 260 | nuke-caches: clean
|
259 | 261 | find src/ -type d -name __pycache__ -exec rm -fr {} +
|
260 | 262 | find tests/ -type d -name __pycache__ -exec rm -fr {} +
|
261 |
| -nuke: nuke-caches |
| 263 | +nuke-mvnw: |
| 264 | + cd $(MACARON_PATH)/resources \ |
| 265 | + && rm mvnw mvnw.cmd mvnwDebug mvnwDebug.cmd \ |
| 266 | + && cd $(MACARON_PATH) |
| 267 | +nuke: nuke-caches nuke-mvnw |
262 | 268 | if [ ! -z "${VIRTUAL_ENV}" ]; then \
|
263 | 269 | echo "Please deactivate the virtual environment first!" && exit 1; \
|
264 | 270 | fi
|
|
0 commit comments