OLD | NEW |
1 # -*- mode: ruby -*- | 1 # -*- mode: ruby -*- |
2 # vi: set ft=ruby fenc=utf-8 et ts=2 sts=2: | 2 # vi: set ft=ruby fenc=utf-8 et ts=2 sts=2: |
3 # coding: utf-8 | 3 # coding: utf-8 |
4 require "vagrant" | 4 require "vagrant" |
5 | 5 |
6 VAGRANT_API_VERSION = "2" | 6 VAGRANT_API_VERSION = "2" |
7 | 7 |
8 Vagrant.configure(VAGRANT_API_VERSION) do |config| | 8 Vagrant.configure(VAGRANT_API_VERSION) do |config| |
9 | 9 |
10 if defined? Uplink | 10 if defined? Uplink |
11 | 11 |
12 config.uplink.command "build" do |command| | 12 config.uplink.command "build" do |command| |
13 command.inline = <<-eof | 13 command.inline = <<-eof |
14 export ANDROID_HOME="/home/vagrant/android-sdk-linux" | 14 export ANDROID_HOME="/home/vagrant/android-sdk-linux" |
15 set -e | 15 set -e |
16 mkdir -p build && cd build | 16 rm -rf ./build/src |
| 17 mkdir -p ./build/src && cd ./build/src |
17 # BEG: WIP and temporary sync step | 18 # BEG: WIP and temporary sync step |
18 cp -rf /vagrant/. . | 19 cp -rf /vagrant/. . |
19 rm -fv `find . -name local.properties` | 20 rm -fv `find . -name local.properties` |
20 # END: WIP and temporary sync step | 21 # END: WIP and temporary sync step |
21 ./ensure_dependencies.py | 22 ./ensure_dependencies.py |
22 cd libadblockplus-android | 23 cd libadblockplus-android |
23 echo "sdk.dir = /home/vagrant/android-sdk-linux" > local.properties | 24 echo "sdk.dir = /home/vagrant/android-sdk-linux" > local.properties |
24 echo "ndk.dir = /home/vagrant/android-ndk-linux" >> local.properties | 25 echo "ndk.dir = /home/vagrant/android-ndk-linux" >> local.properties |
25 cp local.properties ../libadblockplus-android-tests | 26 ./gradlew assemble |
26 mvn clean install | |
27 eof | 27 eof |
28 end | 28 end |
29 | 29 |
30 config.uplink.command "test" do |command| | 30 config.uplink.command "test" do |command| |
31 # Disabled for testing | 31 # Disabled for testing |
32 # command.require = "build" | 32 # command.require = "build" |
33 end | 33 end |
34 | 34 |
35 end | 35 end |
36 | 36 |
37 config.vm.define "debian-jessie-amd64" do |config| | 37 config.vm.provider "virtualbox" do |v| |
| 38 |
| 39 v.memory = 2048 # 2Gb (for android emulator mostly) |
| 40 |
| 41 end |
| 42 |
| 43 config.vm.define "libadblockplus-android-ci-vm" do |config| |
38 | 44 |
39 config.vm.box = "debian/contrib-jessie64" | 45 config.vm.box = "debian/contrib-jessie64" |
40 config.vm.box_url = "https://atlas.hashicorp.com/debian/boxes/contrib-jessie
64" | 46 config.vm.box_url = "https://atlas.hashicorp.com/debian/boxes/contrib-jessie
64" |
41 config.vm.provision "shell", path: "vagrant-provision.sh" | 47 config.vm.provision "shell", path: "vagrant-provision.sh" |
42 | 48 |
43 end | 49 end |
44 | 50 |
45 # https://github.com/mitchellh/vagrant/issues/1673 | 51 # https://github.com/mitchellh/vagrant/issues/1673 |
46 config.ssh.shell = "sh -c 'BASH_ENV=/etc/profile exec bash'" | 52 config.ssh.shell = "sh -c 'BASH_ENV=/etc/profile exec bash'" |
47 | 53 |
48 end | 54 end |
49 | 55 |
OLD | NEW |