diff --git a/.gitignore b/.gitignore index cda5827075..62fb81bec7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.timestamp .pyenv *.pyc **target/ diff --git a/gen/youtube3/cargo.toml b/gen/youtube3/cargo.toml index 1f9355d97e..8ecf44c468 100644 --- a/gen/youtube3/cargo.toml +++ b/gen/youtube3/cargo.toml @@ -7,7 +7,7 @@ name = "youtube3" version = "0.0.1" authors = ["Sebastian Thiel "] description = "A complete library to interact with YouTube (protocol v3)" -repository = "https://github.com/Byron/google-apis-rs/gen/youtube3" +repository = "https://github.com/Byron/google-apis-rs/gen/youtube3/.timestamp" homepage = "https://developers.google.com/youtube/v3" documentation = "http://byron.github.io/google-apis-rs" license = "MIT" diff --git a/gen/youtube3/src/lib.rs b/gen/youtube3/src/lib.rs index f4953d8054..f878648237 100644 --- a/gen/youtube3/src/lib.rs +++ b/gen/youtube3/src/lib.rs @@ -7,7 +7,6 @@ extern crate cmn; extern crate "rustc-serialize" as rustc_serialize; extern crate "yup-oauth2" as oauth2; -use std::default::Default; use std::collections::HashMap; /// There is no detailed description. @@ -292,15 +291,15 @@ pub struct ChannelSettings { #[derive(RustcEncodable, RustcDecodable, Default, Clone)] pub struct VideoStatistics { /// The number of comments for the video. - pub commentCount: Option, + pub commentCount: Option, /// The number of times the video has been viewed. - pub viewCount: Option, + pub viewCount: Option, /// The number of users who currently have the video marked as a favorite video. - pub favoriteCount: Option, + pub favoriteCount: Option, /// The number of users who have indicated that they disliked the video by giving it a negative rating. - pub dislikeCount: Option, + pub dislikeCount: Option, /// The number of users who have indicated that they liked the video by giving it a positive rating. - pub likeCount: Option, + pub likeCount: Option, } /// Brief description of the live stream cdn settings. @@ -1225,15 +1224,15 @@ pub struct Channel { #[derive(RustcEncodable, RustcDecodable, Default, Clone)] pub struct ChannelStatistics { /// The number of comments for the channel. - pub commentCount: Option, + pub commentCount: Option, /// The number of subscribers that the channel has. - pub subscriberCount: Option, + pub subscriberCount: Option, /// The number of videos uploaded to the channel. - pub videoCount: Option, + pub videoCount: Option, /// Whether or not the number of subscribers is shown for this user. pub hiddenSubscriberCount: Option, /// The number of times the channel has been viewed. - pub viewCount: Option, + pub viewCount: Option, } /// Details about a social network post. diff --git a/src/mako/deps.mako b/src/mako/deps.mako index f74026c4ce..192b61bdff 100644 --- a/src/mako/deps.mako +++ b/src/mako/deps.mako @@ -7,6 +7,7 @@ <% import util gen_root = directories.output + '/' + a.name + util.to_api_version(a.version) + gen_root_stamp = gen_root + '/.timestamp' api_name = util.library_name(a.name, a.version) api_clean = api_name + '-clean' # source, destination of individual output files @@ -16,10 +17,11 @@ api_json_inputs = api_json + " $(API_SHARED_INFO)" api_info.append((api_name, api_clean, gen_root)) %>\ -${gen_root}: ${' '.join(i[0] for i in sds)} ${api_json_inputs} $(MAKO_LIB_FILES) $(MAKO_RENDER) +${gen_root_stamp}: ${' '.join(i[0] for i in sds)} ${api_json_inputs} $(MAKO_LIB_FILES) $(MAKO_RENDER) PYTHONPATH=$(MAKO_LIB_DIR) $(TPL) --template-dir '.' --var OUTPUT_DIR=$@ -io ${' '.join("%s=%s" % (s, d) for s, d in sds)} --data-files ${api_json_inputs} + @touch $@ -${api_name}: ${gen_root} +${api_name}: ${gen_root_stamp} ${api_clean}: -rm -Rf ${gen_root} diff --git a/src/mako/lib/util.py b/src/mako/lib/util.py index 3ea372689b..40af235a7b 100644 --- a/src/mako/lib/util.py +++ b/src/mako/lib/util.py @@ -84,6 +84,8 @@ def to_rust_type(sn, pn, t, allow_optionals=True): elif t.type == 'object': rust_type = "%s" % (rust_type, nested_type(t)) is_pod = False + elif t.type == 'string' and 'Count' in pn: + rust_type = 'i64' elif rust_type == USE_FORMAT: rust_type = TYPE_MAP[t.format] if is_pod and allow_optionals: