mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2025-12-31 00:21:44 +01:00
fix(make): dependency handling:dirs with timestamp
That way, make will not regenerate unnecessarily
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
.timestamp
|
||||
.pyenv
|
||||
*.pyc
|
||||
**target/
|
||||
|
||||
@@ -7,7 +7,7 @@ name = "youtube3"
|
||||
version = "0.0.1"
|
||||
authors = ["Sebastian Thiel <byronimo@gmail>"]
|
||||
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"
|
||||
|
||||
@@ -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<String>,
|
||||
pub commentCount: Option<i64>,
|
||||
/// The number of times the video has been viewed.
|
||||
pub viewCount: Option<String>,
|
||||
pub viewCount: Option<i64>,
|
||||
/// The number of users who currently have the video marked as a favorite video.
|
||||
pub favoriteCount: Option<String>,
|
||||
pub favoriteCount: Option<i64>,
|
||||
/// The number of users who have indicated that they disliked the video by giving it a negative rating.
|
||||
pub dislikeCount: Option<String>,
|
||||
pub dislikeCount: Option<i64>,
|
||||
/// The number of users who have indicated that they liked the video by giving it a positive rating.
|
||||
pub likeCount: Option<String>,
|
||||
pub likeCount: Option<i64>,
|
||||
}
|
||||
|
||||
/// 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<String>,
|
||||
pub commentCount: Option<i64>,
|
||||
/// The number of subscribers that the channel has.
|
||||
pub subscriberCount: Option<String>,
|
||||
pub subscriberCount: Option<i64>,
|
||||
/// The number of videos uploaded to the channel.
|
||||
pub videoCount: Option<String>,
|
||||
pub videoCount: Option<i64>,
|
||||
/// Whether or not the number of subscribers is shown for this user.
|
||||
pub hiddenSubscriberCount: Option<bool>,
|
||||
/// The number of times the channel has been viewed.
|
||||
pub viewCount: Option<String>,
|
||||
pub viewCount: Option<i64>,
|
||||
}
|
||||
|
||||
/// Details about a social network post.
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -84,6 +84,8 @@ def to_rust_type(sn, pn, t, allow_optionals=True):
|
||||
elif t.type == 'object':
|
||||
rust_type = "%s<String, %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:
|
||||
|
||||
Reference in New Issue
Block a user