Commit a4d1fa22 authored by Daniel Martí's avatar Daniel Martí

Install Java 1.8 alongside 1.7 for retrolambda

Fixes #103.
parent 6812390e
Pipeline #220052 passed with stage
......@@ -3,3 +3,7 @@ ndk_paths = {
'r9b': "/home/vagrant/android-ndk/r9b",
'r10e': "/home/vagrant/android-ndk/r10e",
}
java_paths = {
'1.7': "/usr/lib/jvm/java-7-openjdk",
'1.8': "/usr/lib/jvm/java-8-openjdk",
}
......@@ -10,7 +10,7 @@ execute "apt-get-update" do
command "apt-get update"
end
%w{ant ant-contrib autoconf autoconf2.13 automake1.11 autopoint bison bzr cmake curl expect faketime flex gettext git-core git-svn gperf graphviz imagemagick inkscape javacc libarchive-zip-perl liblzma-dev librsvg2-bin libsaxonb-java libssl-dev libssl1.0.0 libtool make maven mercurial nasm openjdk-7-jdk optipng pandoc perlmagick pkg-config python python-yaml python-gnupg python-magic python-setuptools python3-gnupg quilt realpath scons subversion swig texinfo transfig unzip vorbis-tools xsltproc yasm zip}.each do |pkg|
%w{ant ant-contrib autoconf autoconf2.13 automake1.11 autopoint bison bzr cmake curl expect faketime flex gettext git-core git-svn gperf graphviz imagemagick inkscape javacc libarchive-zip-perl liblzma-dev librsvg2-bin libsaxonb-java libssl-dev libssl1.0.0 libtool make maven mercurial nasm openjdk-7-jdk openjdk-8-jdk optipng pandoc perlmagick pkg-config python python-yaml python-gnupg python-magic python-setuptools python3-gnupg quilt realpath scons subversion swig texinfo transfig unzip vorbis-tools xsltproc yasm zip}.each do |pkg|
package pkg do
action :install
end
......@@ -35,4 +35,8 @@ execute "add-bsenv" do
not_if "grep bsenv /home/#{user}/.bashrc"
end
execute "set-default-java" do
user user
command "update-java-alternatives --set java-7-openjdk"
end
......@@ -15,6 +15,13 @@
# 'r10e': "$ANDROID_NDK",
# }
# If you want to build apps that use retrolambda and Java 1.8, you'll need to
# have both 1.7 and 1.8 installed.
# java_paths = {
# '1.7': "/usr/lib/jvm/java-7-openjdk",
# '1.8': None,
# }
# Build tools version to be used
# build_tools = "23.0.1"
......
......@@ -57,6 +57,10 @@ default_config = {
'r10e': "$ANDROID_NDK",
},
'build_tools': "23.0.1",
'java_paths': {
'1.7': "/usr/lib/jvm/java-7-openjdk",
'1.8': None,
},
'ant': "ant",
'mvn3': "mvn",
'gradle': 'gradle',
......@@ -122,7 +126,7 @@ def fill_config_defaults(thisconfig):
thisconfig[k] = exp
thisconfig[k + '_orig'] = v
for k in ['ndk_paths']:
for k in ['ndk_paths', 'java_paths']:
d = thisconfig[k]
for k2 in d.copy():
v = d[k2]
......@@ -185,6 +189,11 @@ def read_config(opts, config_file='config.py'):
for n in ['ANDROID_HOME', 'ANDROID_SDK']:
env[n] = config['sdk_path']
for v in ['7', '8']:
cpath = config['java_paths']['1.%s' % v]
if cpath:
env['JAVA%s_HOME' % v] = cpath
for k in ["keystorepass", "keypass"]:
if k in config:
write_password_file(k)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment