Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
2a4495cf
Commit
2a4495cf
authored
Jul 13, 2016
by
Tim Hockin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow make to run from outside GOPATH
parent
e967a773
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
7 deletions
+42
-7
Makefile.generated_files
Makefile.generated_files
+9
-7
run-in-gopath.sh
hack/run-in-gopath.sh
+33
-0
No files found.
Makefile.generated_files
View file @
2a4495cf
...
...
@@ -198,11 +198,11 @@ DEEPCOPY_FILES := $(addsuffix /$(DEEPCOPY_FILENAME), $(DEEPCOPY_DIRS))
# in a single run of the tool.
.PHONY
:
gen_deepcopy
gen_deepcopy
:
$(DEEPCOPY_FILES)
if
[[
-f
$(META_DIR)
/
$(DEEPCOPY_GEN)
.todo
]]
;
then
\
$(DEEPCOPY_GEN)
\
if
[[
-f
$(META_DIR)
/
$(DEEPCOPY_GEN)
.todo
]]
;
then
\
./hack/run-in-gopath.sh
$(DEEPCOPY_GEN)
\
-i
$$
(
cat
$(META_DIR)
/
$(DEEPCOPY_GEN)
.todo |
paste
-sd
, -
)
\
--bounding-dirs
$(PRJ_SRC_PATH)
\
-O
$(DEEPCOPY_BASENAME)
;
\
--bounding-dirs
$(PRJ_SRC_PATH)
\
-O
$(DEEPCOPY_BASENAME)
;
\
fi
# For each dir in DEEPCOPY_DIRS, this establishes a dependency between the
...
...
@@ -243,6 +243,7 @@ $(META_DIR)/$(DEEPCOPY_GEN).mk:
-f
'{{range .Deps}}{{.}}{{"\n"}}{{end}}'
\
./cmd/libs/go2idl/deepcopy-gen
\
|
grep
"^
$(PRJ_SRC_PATH)
"
\
|
sed
's|^
$(PRJ_SRC_PATH)
|./|'
\
| xargs go list
-e
-f
'{{.Dir}} {{.Dir}}/*.go'
)
;
\
echo
$$
DIRECT
$$
INDIRECT |
sed
's/ / =,/g'
|
tr
'=,'
'\n\t'
;
\
)
|
sed
"s|
$$
(pwd -P)/||"
>
$@
.tmp
;
\
...
...
@@ -308,10 +309,10 @@ CONVERSION_FILES := $(addsuffix /$(CONVERSION_FILENAME), $(CONVERSION_DIRS))
# in a single run of the tool.
.PHONY
:
gen_conversion
gen_conversion
:
$(CONVERSION_FILES)
if
[[
-f
$(META_DIR)
/
$(CONVERSION_GEN)
.todo
]]
;
then
\
$(CONVERSION_GEN)
\
if
[[
-f
$(META_DIR)
/
$(CONVERSION_GEN)
.todo
]]
;
then
\
./hack/run-in-gopath.sh
$(CONVERSION_GEN)
\
-i
$$
(
cat
$(META_DIR)
/
$(CONVERSION_GEN)
.todo |
paste
-sd
, -
)
\
-O
$(CONVERSION_BASENAME)
;
\
-O
$(CONVERSION_BASENAME)
;
\
fi
# Establish a dependency between the deps file and the dir. Whenever a dir
...
...
@@ -419,6 +420,7 @@ $(META_DIR)/$(CONVERSION_GEN).mk:
-f
'{{range .Deps}}{{.}}{{"\n"}}{{end}}'
\
./cmd/libs/go2idl/conversion-gen
\
|
grep
"^
$(PRJ_SRC_PATH)
"
\
|
sed
's|^
$(PRJ_SRC_PATH)
|./|'
\
| xargs go list
-e
-f
'{{.Dir}} {{.Dir}}/*.go'
)
;
\
echo
$$
DIRECT
$$
INDIRECT |
sed
's/ / =,/g'
|
tr
'=,'
'\n\t'
;
\
)
|
sed
"s|
$$
(pwd -P)/||"
>
$@
.tmp
;
\
...
...
hack/run-in-gopath.sh
0 → 100755
View file @
2a4495cf
#!/bin/bash
# Copyright 2016 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This script sets up a temporary Kubernetes GOPATH and runs an arbitrary
# command under it. Go tooling requires that the current directory be under
# GOPATH or else it fails to find some things, such as the vendor directory for
# the project.
set
-o
errexit
set
-o
nounset
set
-o
pipefail
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/..
source
"
${
KUBE_ROOT
}
/hack/lib/init.sh"
# This sets up a clean GOPATH and makes sure we are currently in it.
kube::golang::setup_env
# Run the user-provided command.
"
${
@
}
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment