feat(cli): can now be published

This works as the API version is now explicitly specified,
allowing cargo-publish to work as usual.
This commit is contained in:
Sebastian Thiel
2016-09-11 13:13:09 +02:00
parent c4c49015f5
commit 91a657b8cf
5 changed files with 14 additions and 3 deletions

View File

@@ -59,7 +59,14 @@ directories:
mako_src: src/mako
# The subdirectory to contain documentation from all APIs and related programs
doc_subdir: doc
# This somewhat intricate setup allows the CLI to access certain cargo-API values,
# without having us duplicate them.
cargo_api: &cargo_api
build_version: "0.1.15"
cargo:
# This means that the API must not specify the shared variables from cargo_api
# anymore
<<: *cargo_api
repo_base_url: https://github.com/Byron/google-apis-rs
doc_base_url: http://byron.github.io/google-apis-rs
authors:
@@ -76,3 +83,5 @@ copyright:
years: '2015-2016'
authors:
- 'Sebastian Thiel'

View File

@@ -25,7 +25,6 @@ make:
- source: build.rs
output_dir: src
cargo:
build_version: "0.1.15"
build_script: src/build.rs
keywords: [protocol, web, api]
dependencies:

View File

@@ -12,6 +12,7 @@ make:
target_suffix: -cli
aggregated_target_suffix: -cli
depends_on_suffix: ''
depends_on_id: 'api'
documentation_engine: mkdocs
templates:
- source: ../LICENSE.md

View File

@@ -41,12 +41,15 @@ ${dep}
<%
api_name = util.library_name()
crate_name_we_depend_on = None
crate_version_we_depend_on = None
nightly_features = ["serde_macros", "yup-oauth2/nightly"]
default_features = ["serde_codegen", "yup-oauth2/with-serde-codegen"]
if make.depends_on_suffix is not None:
crate_name_we_depend_on = library_to_crate_name(api_name, suffix=make.depends_on_suffix)
depends_on_key = 'cargo_' + make.depends_on_id
crate_version_we_depend_on = self.context.get(depends_on_key).get('build_version')
nightly_features.append(crate_name_we_depend_on + '/nightly')
default_features.append(crate_name_we_depend_on + '/with-serde-codegen')
%>\
@@ -61,7 +64,7 @@ serde_codegen = { version = "^ 0.8", optional = true }
[dependencies.${crate_name_we_depend_on}]
path = "../${api_name}"
version = "*"
version = "${crate_version_we_depend_on}"
optional = true
default-features = false
% endif

View File

@@ -76,7 +76,6 @@
i.get('output_dir', '') + '/' + i.source.strip('../')) for i in make.templates]
api_json = directories.api_base + '/' + an + '/' + version + '/' + an + '-api.json'
api_meta_dir = os.path.dirname(api_json)
print api_json
api_crate_publish_file = api_meta_dir + '/crates/' + util.crate_version(cargo.build_version +
make.aggregated_target_suffix, json.load(open(api_json, 'r')).get('revision', '00000000'))
api_json_overrides = api_meta_dir + '/' + an + '-api_overrides.yaml'