From bcf90cbcc8f625b787596fb95eda4355e35b403b Mon Sep 17 00:00:00 2001 From: William Orr Date: Sun, 17 May 2015 14:18:51 -0700 Subject: [PATCH 1/4] fix(make): fix clean target for docs/cli clean-all-docs and clean-all-cli aren't valid targets. The current mako template causes `make clean` to abend reporting that it can't make these targets. --- src/mako/deps.mako | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mako/deps.mako b/src/mako/deps.mako index cb8e6819c2..17ede4b2c1 100644 --- a/src/mako/deps.mako +++ b/src/mako/deps.mako @@ -132,7 +132,12 @@ ${api_clean}: % endfor % endfor +% if agsuffix not in ["-api", "-cli"]: clean-all${agsuffix}: ${space_join(1)} docs-clean${agsuffix} +% else: +clean-all${agsuffix}: ${space_join(1)} +% endif + cargo${agsuffix}: ${space_join(2)} publish${agsuffix}: | gen-all${agsuffix} ${space_join(4)} gen-all${agsuffix}: ${space_join(0)} From d9ed001b46cc6e510ea2267fa205abd036be10b6 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 18 May 2015 10:11:02 +0200 Subject: [PATCH 2/4] fix(make): clean was depending on unknown targets There are no per-program-type docs clean, just made it depend on docs-all-clean. Also added the `docs-api|cli` target to the generated per-program-type make help. It was just missing, even though it existed. --- Makefile | 4 ++-- src/mako/deps.mako | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 8b3a451d1d..d97c834999 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: clean help deps regen-apis license ubuntu-build +.PHONY: help deps regen-apis license ubuntu-build wheezy-build clean .SUFFIXES: VENV = .virtualenv/virtualenv.py @@ -86,6 +86,6 @@ wheezy-build: regen-apis: | clean-all-api clean-all-cli gen-all-api gen-all-cli license -clean: clean-all-api clean-all-cli +clean: clean-all-api clean-all-cli docs-all-clean -rm -Rf $(VENV_DIR) -rm $(API_DEPS) $(CLI_DEPS) diff --git a/src/mako/deps.mako b/src/mako/deps.mako index 17ede4b2c1..9596689d5b 100644 --- a/src/mako/deps.mako +++ b/src/mako/deps.mako @@ -132,12 +132,7 @@ ${api_clean}: % endfor % endfor -% if agsuffix not in ["-api", "-cli"]: -clean-all${agsuffix}: ${space_join(1)} docs-clean${agsuffix} -% else: clean-all${agsuffix}: ${space_join(1)} -% endif - cargo${agsuffix}: ${space_join(2)} publish${agsuffix}: | gen-all${agsuffix} ${space_join(4)} gen-all${agsuffix}: ${space_join(0)} @@ -164,6 +159,7 @@ docs${agsuffix}: ${' '.join(central_api_index(util.library_to_crate_name(a[0])) help${agsuffix}: $(info gen-all${agsuffix} - make all ${make.target_name}) + $(info docs${agsuffix} - make all ${make.target_name} documentation) $(info clean-all${agsuffix} - delete all generated ${make.target_name}) $(info cargo${agsuffix} - run cargo on all ${make.target_name}, use ARGS="args ..." to specify cargo arguments) $(info publish${agsuffix} - run cargo publish on all ${make.target_name} and remember successful ones with marker files) From 129fd38e003d2ab23bad2ceb84f59bb74b4ae45b Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 18 May 2015 10:19:32 +0200 Subject: [PATCH 3/4] imp(CLI): disallow empty values explicitly [skip ci] --- etc/api/type-cli.yaml | 2 +- src/mako/cli/lib/argparse.mako | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/etc/api/type-cli.yaml b/etc/api/type-cli.yaml index 82f29a1772..a78262a082 100644 --- a/etc/api/type-cli.yaml +++ b/etc/api/type-cli.yaml @@ -30,4 +30,4 @@ cargo: - yup-hyper-mock = "*" - serde = ">= 0.3.0" - serde_macros = "*" - - clap = "*" + - clap = ">= 0.9.1" diff --git a/src/mako/cli/lib/argparse.mako b/src/mako/cli/lib/argparse.mako index 2c2ae7cfcb..d4f7afc356 100644 --- a/src/mako/cli/lib/argparse.mako +++ b/src/mako/cli/lib/argparse.mako @@ -272,7 +272,8 @@ for &(main_command_name, ref about, ref subcommands) in arg_data.iter() { (_ , &Some(f)) => f, _ => unreachable!(), }; - let mut arg = Arg::with_name(arg_name_str); + let mut arg = Arg::with_name(arg_name_str) + .empty_values(false); if let &Some(short_flag) = flag { arg = arg.short(short_flag); } From ed0debe999c201a82be5134b3dbec7bd5400085e Mon Sep 17 00:00:00 2001 From: William Orr Date: Sun, 17 May 2015 15:26:14 -0700 Subject: [PATCH 4/4] chore(dependencies): bump hyper dep to 0.5.0 google-apis-rs no longer builds with hyper 0.4.0, due to the use of a now-undefined macro --- src/mako/Cargo.toml.mako | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mako/Cargo.toml.mako b/src/mako/Cargo.toml.mako index 9f48de8a47..e95a7a4552 100644 --- a/src/mako/Cargo.toml.mako +++ b/src/mako/Cargo.toml.mako @@ -23,7 +23,7 @@ name = "${util.program_name()}" % endif [dependencies] -hyper = ">= 0.4.0" +hyper = ">= 0.5.0" mime = "*" yup-oauth2 = "*" % for dep in cargo.get('dependencies', list()):