-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
38 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,39 @@ | ||
.PHONY: clean create-proto compile-proto run | ||
|
||
clean: | ||
rm -rf ./docs/* | ||
rm -rf ./output/* | ||
install-protoc-linux: | ||
sudo apt-get update | ||
sudo apt-get install -y protobuf-compiler | ||
export PATH="$PATH:$(go env GOPATH)/bin" | ||
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest | ||
protoc --version | ||
|
||
clean-output-java: | ||
rm -rf ./output/java/* | ||
clean-output-golang: | ||
rm -rf ./output/golang/* | ||
clean-output-proto: | ||
rm -rf ./output/proto/* | ||
clean-bin: | ||
rm -rf ./bin/* | ||
|
||
docs: | ||
clean-docs: | ||
rm -rf ./docs/* | ||
|
||
clean-all: clean-output clean-bin clean-docs | ||
|
||
build-docs: clean-docs | ||
go run doc-generator/doc-generator.go | ||
|
||
build: | ||
build-project: clean-bin | ||
mkdir -p ./bin/ | ||
go build -o ./bin/ocsf-tool | ||
|
||
compile-proto: | ||
test-compile-proto: clean-output-java clean-output-golang | ||
mkdir -p ./output/java | ||
mkdir -p ./output/golang | ||
find ./output/proto -type f -name "*.proto" | xargs protoc --proto_path=./output/proto --java_out=./output/java --go_opt=paths=source_relative --go_out=./output/golang | ||
|
||
test-run: | ||
./bin/ocsf-tool generate-proto file_activity security_finding | ||
test-create-proto: clean-output-proto | ||
./bin/ocsf-tool generate-proto file_activity | ||
|
||
run: clean docs build test-run | ||
run: build-docs build-project test-create-proto test-compile-proto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,5 +95,6 @@ type mapper struct { | |
Enums Enums | ||
Cache CacheMap | ||
RootPackage *Pkg | ||
OutputPath string | ||
Fs afero.Fs | ||
} |