action :install
end
-execute "add-bsenv" do
- user user
- command "echo \". ./.bsenv \" >> /home/#{user}/.bashrc"
- not_if "grep bsenv /home/#{user}/.bashrc"
-end
-
execute "set-default-java" do
command "update-java-alternatives --set java-1.7.0-openjdk-i386"
end
chmod a+x /opt/gradle/bin/gradle
"
end
-
-execute "add-android-ndk-path" do
- user user
- command "echo \"export PATH=\\$PATH:/opt/gradle/bin #PATH-GRADLE\" >> /home/#{user}/.bsenv"
- not_if "grep PATH-GRADLE /home/#{user}/.bsenv"
-end
--- /dev/null
+#!/bin/sh
+#
+# sets up the environment vars needed by the build process
+
+set -e
+set -x
+
+bsenv=/etc/profile.d/bsenv.sh
+
+echo "# generated on "`date` > $bsenv
+
+echo export ANDROID_HOME=$1 >> $bsenv
+echo export ANDROID_NDK_HOME=$2 >> $bsenv
+echo 'export PATH=$PATH:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:/opt/gradle/bin' >> $bsenv
+
+chmod 0644 $bsenv
if options.verbose:
cmdline += ' --verbose'
cmdline += " %s:%s" % (app.id, build.vercode)
- chan.exec_command('bash -c ". ~/.bsenv && ' + cmdline + '"')
+ chan.exec_command('bash -c "' + cmdline + '"')
output = bytes()
while not chan.exit_status_ready():
while chan.recv_ready():
""".format(aptcachedir)
vagrantfile += """
+
+ config.vm.provision "shell" do |shell|
+ shell.path = "setup-env-vars"
+ shell.args = ["/home/vagrant/android-sdk", "/home/vagrant/android-ndk"]
+ end
+
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "cookbooks"
chef.log_level = :debug