Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bb04b60

Browse files
committed
fix(make): dependency handling:dirs with timestamp
That way, make will not regenerate unnecessarily
1 parent d8edf1d commit bb04b60

5 files changed

Lines changed: 17 additions & 13 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.timestamp
12
.pyenv
23
*.pyc
34
**target/

gen/youtube3/cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "youtube3"
77
version = "0.0.1"
88
authors = ["Sebastian Thiel <byronimo@gmail>"]
99
description = "A complete library to interact with YouTube (protocol v3)"
10-
repository = "https://github.com/Byron/google-apis-rs/gen/youtube3"
10+
repository = "https://github.com/Byron/google-apis-rs/gen/youtube3/.timestamp"
1111
homepage = "https://developers.google.com/youtube/v3"
1212
documentation = "http://byron.github.io/google-apis-rs"
1313
license = "MIT"

gen/youtube3/src/lib.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ extern crate cmn;
77
extern crate "rustc-serialize" as rustc_serialize;
88
extern crate "yup-oauth2" as oauth2;
99

10-
use std::default::Default;
1110
use std::collections::HashMap;
1211

1312
/// There is no detailed description.
@@ -292,15 +291,15 @@ pub struct ChannelSettings {
292291
#[derive(RustcEncodable, RustcDecodable, Default, Clone)]
293292
pub struct VideoStatistics {
294293
/// The number of comments for the video.
295-
pub commentCount: Option<String>,
294+
pub commentCount: Option<i64>,
296295
/// The number of times the video has been viewed.
297-
pub viewCount: Option<String>,
296+
pub viewCount: Option<i64>,
298297
/// The number of users who currently have the video marked as a favorite video.
299-
pub favoriteCount: Option<String>,
298+
pub favoriteCount: Option<i64>,
300299
/// The number of users who have indicated that they disliked the video by giving it a negative rating.
301-
pub dislikeCount: Option<String>,
300+
pub dislikeCount: Option<i64>,
302301
/// The number of users who have indicated that they liked the video by giving it a positive rating.
303-
pub likeCount: Option<String>,
302+
pub likeCount: Option<i64>,
304303
}
305304

306305
/// Brief description of the live stream cdn settings.
@@ -1225,15 +1224,15 @@ pub struct Channel {
12251224
#[derive(RustcEncodable, RustcDecodable, Default, Clone)]
12261225
pub struct ChannelStatistics {
12271226
/// The number of comments for the channel.
1228-
pub commentCount: Option<String>,
1227+
pub commentCount: Option<i64>,
12291228
/// The number of subscribers that the channel has.
1230-
pub subscriberCount: Option<String>,
1229+
pub subscriberCount: Option<i64>,
12311230
/// The number of videos uploaded to the channel.
1232-
pub videoCount: Option<String>,
1231+
pub videoCount: Option<i64>,
12331232
/// Whether or not the number of subscribers is shown for this user.
12341233
pub hiddenSubscriberCount: Option<bool>,
12351234
/// The number of times the channel has been viewed.
1236-
pub viewCount: Option<String>,
1235+
pub viewCount: Option<i64>,
12371236
}
12381237

12391238
/// Details about a social network post.

src/mako/deps.mako

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<%
88
import util
99
gen_root = directories.output + '/' + a.name + util.to_api_version(a.version)
10+
gen_root_stamp = gen_root + '/.timestamp'
1011
api_name = util.library_name(a.name, a.version)
1112
api_clean = api_name + '-clean'
1213
# source, destination of individual output files
@@ -16,10 +17,11 @@
1617
api_json_inputs = api_json + " $(API_SHARED_INFO)"
1718
api_info.append((api_name, api_clean, gen_root))
1819
%>\
19-
${gen_root}: ${' '.join(i[0] for i in sds)} ${api_json_inputs} $(MAKO_LIB_FILES) $(MAKO_RENDER)
20+
${gen_root_stamp}: ${' '.join(i[0] for i in sds)} ${api_json_inputs} $(MAKO_LIB_FILES) $(MAKO_RENDER)
2021
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}
22+
@touch $@
2123
22-
${api_name}: ${gen_root}
24+
${api_name}: ${gen_root_stamp}
2325
2426
${api_clean}:
2527
-rm -Rf ${gen_root}

src/mako/lib/util.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ def nested_type(nt):
8484
elif t.type == 'object':
8585
rust_type = "%s<String, %s>" % (rust_type, nested_type(t))
8686
is_pod = False
87+
elif t.type == 'string' and 'Count' in pn:
88+
rust_type = 'i64'
8789
elif rust_type == USE_FORMAT:
8890
rust_type = TYPE_MAP[t.format]
8991
if is_pod and allow_optionals:

0 commit comments

Comments
 (0)