-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add generate-sequential
make target
#259
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and Gardener contributors | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set -e | ||
|
||
echo "> Generate" | ||
|
||
go generate $@ |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//go:build tools | ||
// +build tools | ||
|
||
/* | ||
SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and Gardener contributors | ||
|
||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
// This package imports things required by build scripts, to force `go mod` to see them as dependencies | ||
package tools | ||
|
||
import ( | ||
_ "github.com/golang/mock/mockgen" | ||
) |
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and Gardener contributors | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
TOOLS_BIN_DIR := $(TOOLS_DIR)/bin | ||
MOCKGEN := $(TOOLS_BIN_DIR)/mockgen | ||
|
||
export TOOLS_BIN_DIR := $(TOOLS_BIN_DIR) | ||
export PATH := $(abspath $(TOOLS_BIN_DIR)):$(PATH) | ||
|
||
######################################### | ||
# Common # | ||
######################################### | ||
|
||
# Tool targets should declare go.mod as a prerequisite, if the tool's version is managed via go modules. This causes | ||
# make to rebuild the tool in the desired version, when go.mod is changed. | ||
# For tools where the version is not managed via go.mod, we use a file per tool and version as an indicator for make | ||
# whether we need to install the tool or a different version of the tool (make doesn't rerun the rule if the rule is | ||
# changed). | ||
|
||
# Use this "function" to add the version file as a prerequisite for the tool target: e.g. | ||
# $(HELM): $(call tool_version_file,$(HELM),$(HELM_VERSION)) | ||
tool_version_file = $(TOOLS_BIN_DIR)/.version_$(subst $(TOOLS_BIN_DIR)/,,$(1))_$(2) | ||
|
||
# This target cleans up any previous version files for the given tool and creates the given version file. | ||
# This way, we can generically determine, which version was installed without calling each and every binary explicitly. | ||
$(TOOLS_BIN_DIR)/.version_%: | ||
@version_file=$@; rm -f $${version_file%_*}* | ||
@touch $@ | ||
|
||
.PHONY: clean-tools-bin | ||
clean-tools-bin: | ||
rm -rf $(TOOLS_BIN_DIR)/* | ||
|
||
######################################### | ||
# Tools # | ||
######################################### | ||
|
||
$(MOCKGEN): go.mod | ||
go build -o $(MOCKGEN) github.com/golang/mock/mockgen |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why this incomplete renaming could ever has worked??