File tree Expand file tree Collapse file tree 4 files changed +19
-2
lines changed Expand file tree Collapse file tree 4 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 1
1
language : rust
2
2
sudo : false
3
+
4
+ os :
5
+ - linux
6
+ - osx
7
+
3
8
env :
4
9
global :
5
10
- secure : gZdvTl4i1QfHQaCUPcVpnLtlrsE4WldSm99AD9C9jiMgjlzhhI4kQmIhssNFhA1BWDW6qDazrKnw4ZT1GA/rlmGSpLxs2lfBNTjPF0CJMVSTEQ1OaFcDGajziTTCSMh7jDml1/CFHuGSc+rS4bNv5wu0bj+pz3ZSRSuB7Vgoa0aRD8JQKc+phnIoXMCCfIh9vxlXWvO9mDMoR84/B35/gN/vWIi3+uuHgvvdKMK8qBbJ0ne25kOIA5CpXzJmOBFHCGblVQM4+AiTWvWtoXJjMcJXn9HZ2g3HWhrnixG07Ee1RrjUPo25tsxrBowHSGq9Bbo+jzmOmx03CRnCBHyXk6e12MXrfVFWRdmFaf7Sl/RBlz8Y2BRgktp8ihB6JQmjNuRptE4RdnWn6CU9liSQ5nzzGEl2ZtBrzN9GR3qyhq5W9e09v93MZfBr0svp/rtBoqDANfkpxvmWqtgO3fjN1fdf092sEcQfq3d7e6NaLSWKkI6V9wJnJ9UulPDAaqGVm8RrA9b0vJR6ouCf5ChZgYirz6LW5uPpMkf+cjESU9JxnX9xVB8tfPSoNrPKolRC/WRZ8gPbRmx0vF4wrDk8z9Fks5nHGwDsPdYe60Qe8m6ZclncCkpUzy2yAZWe/kiDaseOwNbSqEUZW80hLyHpuGi1IFpGBQfc8mYMPvqOHa8=
9
14
- cargo test --verbose
10
15
- cargo doc
11
16
12
- after_success : ' [ $TRAVIS_BRANCH = master ] && [ $TRAVIS_PULL_REQUEST = false ] &&
17
+ after_success : ' [ $TRAVIS_OS_NAME == linux ] && [ $ TRAVIS_BRANCH = master ] && [ $TRAVIS_PULL_REQUEST = false ] &&
13
18
echo "<meta http-equiv=refresh content=0;url=i2cdev/index.html>" > target/doc/index.html
14
19
&& sudo pip install ghp-import && ghp-import -n target/doc && git push -fq https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
15
20
gh-pages'
Original file line number Diff line number Diff line change 11
11
extern crate i2cdev;
12
12
extern crate docopt;
13
13
14
+ #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
14
15
use i2cdev:: linux:: * ;
16
+ #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
15
17
use i2cdev:: sensors:: nunchuck:: * ;
18
+
16
19
use std:: env:: args;
17
20
use docopt:: Docopt ;
18
21
19
-
20
22
const USAGE : & ' static str = "
21
23
Reading Wii Nunchuck data via Linux i2cdev.
22
24
@@ -30,7 +32,10 @@ Options:
30
32
--version Show version.
31
33
" ;
32
34
35
+ #[ cfg( not( any( target_os = "linux" , target_os = "android" ) ) ) ]
36
+ fn main ( ) { }
33
37
38
+ #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
34
39
fn main ( ) {
35
40
let args = Docopt :: new ( USAGE )
36
41
. and_then ( |d| d. argv ( args ( ) . into_iter ( ) ) . parse ( ) )
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ use docopt::Docopt;
21
21
use i2cdev:: sensors:: { Thermometer , Barometer , Accelerometer } ;
22
22
use i2cdev:: sensors:: mpl115a2_barometer:: * ;
23
23
use i2cdev:: sensors:: adxl345_accelerometer:: * ;
24
+ #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
24
25
use i2cdev:: linux:: * ;
25
26
26
27
const USAGE : & ' static str = "
@@ -36,6 +37,10 @@ Options:
36
37
--version Show version.
37
38
" ;
38
39
40
+ #[ cfg( not( any( target_os = "linux" , target_os = "android" ) ) ) ]
41
+ fn main ( ) { }
42
+
43
+ #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
39
44
fn main ( ) {
40
45
let args = Docopt :: new ( USAGE )
41
46
. and_then ( |d| d. argv ( args ( ) . into_iter ( ) ) . parse ( ) )
Original file line number Diff line number Diff line change @@ -23,7 +23,9 @@ extern crate bitflags;
23
23
#[ macro_use]
24
24
extern crate nix;
25
25
26
+ #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
26
27
mod ffi;
28
+
27
29
pub mod core;
28
30
pub mod sensors;
29
31
You can’t perform that action at this time.
0 commit comments