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
2b937f6d
Commit
2b937f6d
authored
Sep 23, 2016
by
Tim Hockin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix openapi Make rules to emit 1 file
parent
bd9c04cf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
22 deletions
+12
-22
Makefile.generated_files
Makefile.generated_files
+12
-21
openapi.go
cmd/libs/go2idl/openapi-gen/generators/openapi.go
+0
-1
No files found.
Makefile.generated_files
View file @
2b937f6d
...
@@ -311,20 +311,11 @@ OPENAPI_DIRS := $(shell \
...
@@ -311,20 +311,11 @@ OPENAPI_DIRS := $(shell \
|
sort
-u
\
|
sort
-u
\
)
)
OPENAPI_
FILES
:=
$
(
addsuffix /
$(OPENAPI_FILENAME)
,
$(OPENAPI_DIRS)
)
OPENAPI_
OUTFILE
:=
$(OPENAPI_OUTPUT_PKG)
/
$(OPENAPI_FILENAME
)
# This rule aggregates the set of files to generate and then generates them all
# This rule is the user-friendly entrypoint for openapi generation.
# in a single run of the tool.
.PHONY
:
gen_openapi
.PHONY
:
gen_openapi
gen_openapi
:
$(OPENAPI_FILES)
gen_openapi
:
$(OPENAPI_OUTFILE)
if
[[
-f
$(META_DIR)
/
$(OPENAPI_GEN)
.todo
]]
;
then
\
./hack/run-in-gopath.sh
$(OPENAPI_GEN)
\
--v
$(KUBE_VERBOSE)
\
--logtostderr
\
-i
$$
(
cat
$(META_DIR)
/
$(OPENAPI_GEN)
.todo |
paste
-sd
, -
)
\
-p
$(PRJ_SRC_PATH)
/
$(OPENAPI_OUTPUT_PKG)
\
-O
$(OPENAPI_BASENAME)
;
\
fi
# For each dir in OPENAPI_DIRS, this establishes a dependency between the
# For each dir in OPENAPI_DIRS, this establishes a dependency between the
# output file and the input files that should trigger a rebuild.
# output file and the input files that should trigger a rebuild.
...
@@ -339,18 +330,18 @@ gen_openapi: $(OPENAPI_FILES)
...
@@ -339,18 +330,18 @@ gen_openapi: $(OPENAPI_FILES)
# We depend on the $(GOFILES_META).stamp to detect when the set of input files
# We depend on the $(GOFILES_META).stamp to detect when the set of input files
# has changed. This allows us to detect deleted input files.
# has changed. This allows us to detect deleted input files.
$(foreach
dir,
$(OPENAPI_DIRS),
$(eval
\
$(foreach
dir,
$(OPENAPI_DIRS),
$(eval
\
$(
dir)/$(OPENAPI_FILENAME)
:
$(META_DIR)/$(dir)/$(GOFILES_META).stamp
\
$(
OPENAPI_OUTFILE)
:
$(META_DIR)/$(dir)/$(GOFILES_META).stamp
\
$(gofiles__$(dir))
\
$(gofiles__$(dir))
\
))
))
#
Unilaterally remove any leftovers from previous run
s.
#
How to regenerate open-api code. This emits a single file for all result
s.
$(
shell
rm
-f
$(META_DIR)/$(OPENAPI_GEN)*.todo
)
$(
OPENAPI_OUTFILE)
:
$(OPENAPI_GEN
)
./hack/run-in-gopath.sh
$(OPENAPI_GEN)
\
# How to regenerate open-api code. We need to collect these up and trigger one
--v
$(KUBE_VERBOSE)
\
# single run to generate definition for all types.
--logtostderr
\
$(OPENAPI_FILES)
:
$(OPENAPI_GEN)
-i
$$
(
echo
$
(
addprefix
$(PRJ_SRC_PATH)
/,
$(OPENAPI_DIRS)
)
|
sed
's/ /,/g'
)
\
mkdir
-p
$$
(
dirname
$(META_DIR)
/
$(OPENAPI_GEN)
)
-p
$(PRJ_SRC_PATH)
/
$(OPENAPI_OUTPUT_PKG)
\
echo
$(PRJ_SRC_PATH)
/
$
(
@D
)
>>
$(META_DIR)
/
$(OPENAPI_GEN)
.todo
-O
$(OPENAPI_BASENAME)
# This calculates the dependencies for the generator tool, so we only rebuild
# This calculates the dependencies for the generator tool, so we only rebuild
# it when needed. It is PHONY so that it always runs, but it only updates the
# it when needed. It is PHONY so that it always runs, but it only updates the
...
...
cmd/libs/go2idl/openapi-gen/generators/openapi.go
View file @
2b937f6d
...
@@ -112,7 +112,6 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat
...
@@ -112,7 +112,6 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat
},
},
},
},
}
}
return
generator
.
Packages
{}
}
}
const
(
const
(
...
...
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