Bläddra i källkod

travis: adding java builds to Travis CI

Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Mihai Tudor Panu 9 år sedan
förälder
incheckning
a96a2ff44c
1 ändrade filer med 6 tillägg och 2 borttagningar
  1. 6
    2
      .travis.yml

+ 6
- 2
.travis.yml Visa fil

@@ -8,10 +8,14 @@ install:
8 8
   - sudo apt-get update -qq
9 9
   - sudo apt-get install -y -qq swig3.0 python git cmake
10 10
   - sudo ln -s /usr/bin/swig3.0 /usr/bin/swig
11
+  - sudo update-java-alternatives -s java-8-oracle
12
+before_script:
13
+  - if [ "$CC" = "gcc" ]; then export BUILDJAVA=ON; else export BUILDJAVA=OFF; fi
14
+  - export JAVA_HOME=/usr/lib/jvm/java-8-oracle
11 15
 script:
12 16
   - git clone --branch=master https://github.com/intel-iot-devkit/mraa.git
13
-  - cd mraa && mkdir build && cd build && cmake -DENABLEEXAMPLES=OFF -DCMAKE_INSTALL_PREFIX:PATH=. -DNODE_ROOT_DIR:PATH=/home/travis/.nvm/v0.10.36/include .. && make && make install
17
+  - cd mraa && mkdir build && cd build && cmake -DBUILDSWIGJAVA=$BUILDJAVA -DENABLEEXAMPLES=OFF -DCMAKE_INSTALL_PREFIX:PATH=. -DNODE_ROOT_DIR:PATH=/home/travis/.nvm/v0.10.36/include .. && make && make install
14 18
   - export PKG_CONFIG_PATH=$PWD/lib/pkgconfig:$PWD/lib/x86_64-linux-gnu/pkgconfig
15 19
   - export CPLUS_INCLUDE_PATH=$PWD/include
16 20
   - export LIBRARY_PATH=$PWD/lib:$PWD/lib/x86_64-linux-gnu
17
-  - cd ../.. && mkdir build && cd build && cmake -DNODE_ROOT_DIR:PATH=/home/travis/.nvm/v0.10.36/include -DBUILDEXAMPLES=ON .. && make
21
+  - cd ../.. && mkdir build && cd build && cmake -DBUILDSWIGJAVA=$BUILDJAVA -DNODE_ROOT_DIR:PATH=/home/travis/.nvm/v0.10.36/include -DBUILDEXAMPLES=ON .. && make