elif os.path.exists('makebs.config.py'):
# this is the old name for the config file
exec(compile(open('makebs.config.py').read(), 'makebs.config.py', 'exec'), config)
+if '__builtins__' in config:
+ del(config['__builtins__']) # added by compile/exec
if not os.path.exists('makebuildserver') or not os.path.exists(serverdir):
print('This must be run from the correct directory!')
cachefiles = [
('https://dl.google.com/android/repository/tools_r25.1.7-linux.zip',
'3ca053600a86a5a64d5571edfbb1dad27f2bda3bfd2d38e2fe54322610b1ef0b'),
- ('https://dl.google.com/android/repository/platform-tools_r24-linux.zip',
- '076368b337d042d163364594dda63b7e778835f636fafb2c8af4d4a604175c32'),
- ('https://dl.google.com/android/repository/android_m2repository_r33.zip',
- 'be9bb4a27aeefb1c9adb0cade8771f764447c4cbde74426303db2ac6bde1879c'),
+ ('https://dl.google.com/android/repository/android_m2repository_r35.zip',
+ '2fdfe9a4dff87ee8129d9fc1ed78c242e87f9c0b4d92ad1437b5fde6de1e634c'),
('https://dl.google.com/android/repository/android-1.5_r04-linux.zip',
'85b6c8f9797e56aa415d3a282428bb640c96b0acb17c11d41621bb2a5302fe64'),
('https://dl.google.com/android/repository/android-1.6_r03-linux.zip',
('https://dl.google.com/android/repository/platform-23_r03.zip',
'4b4bcddead3319708275c54c76294707bfaa953d767e34f1a5b599f3edd0076c'),
('https://dl.google.com/android/repository/platform-24_r01.zip',
- '292e556e9ec84b4134e4126c835e4ac467f6950924fec3684792af0fcf426091'),
+ '5c9cef4fb7cf55dee7c4b435d2341f9bf26d5b7e3ae40d0b9e6e3d0391a54553'),
('https://dl.google.com/android/repository/build-tools_r17-linux.zip',
'4c8444972343a19045236f6924bd7f12046287c70dace96ab88b2159c8ec0e74'),
('https://dl.google.com/android/repository/build-tools_r18.0.1-linux.zip',
'd961663d4a9e128841751c0156548a347c882c081c83942e53788d8949bf34e1'),
('https://dl.google.com/android/repository/build-tools_r24-linux.zip',
'b4871f357224c5f660fd2bbee04d8c7d1c187eeddfd9702cc84503529e3b3724'),
+ ('https://dl.google.com/android/repository/build-tools_r24.0.1-linux.zip',
+ '5b58478f8ce0a87512b7894f8fc2588249304a041bb3a2a70259f2a3d17c8c0a'),
# the binaries that Google uses are here:
# https://android.googlesource.com/platform/tools/external/gradle/+/studio-1.5/
('https://services.gradle.org/distributions/gradle-1.4-bin.zip',
'8956e9efeea95f49425ded8bb697013b66e162b064b0f66b5c75628f76e0f532'),
('https://dl.google.com/android/ndk/android-ndk-r9b-linux-x86_64-legacy-toolchains.tar.bz2',
'de93a394f7c8f3436db44568648f87738a8d09801a52f459dcad3fc047e045a1'),
+ ('https://dl.google.com/android/repository/android-ndk-r12b-linux-x86_64.zip',
+ 'eafae2d614e5475a3bcfd7c5f201db5b963cc1290ee3e8ae791ff0c66757781e'),
]
print("\t...shasum verified for " + local_filename)
else:
print("Invalid shasum of '" + v + "' detected for " + local_filename)
+ os.remove(local_filename)
sys.exit(1)
# use VirtualBox software virtualization if hardware is not available,
if 'vmx' in contents or 'svm' in contents:
config['hwvirtex'] = 'on'
-del(config['__builtins__']) # added by compile/exec
-with open(os.path.join(serverdir, 'Vagrantfile.yaml'), 'w') as f:
- yaml.dump(config, f)
-
-# Generate an appropriate Vagrantfile for the buildserver, based on our
-# settings...
-vagrantfile = """
-require 'yaml'
-configfile = YAML.load_file('Vagrantfile.yaml')
-
-Vagrant.configure("2") do |config|
-
- if Vagrant.has_plugin?("vagrant-cachier")
- config.cache.scope = :box
- config.cache.auto_detect = false
- config.cache.enable :apt
- config.cache.enable :chef
- end
-
- config.vm.box = configfile['basebox']
- config.vm.box_url = configfile['baseboxurl']
-
- config.vm.provider "virtualbox" do |v|
- v.customize ["modifyvm", :id, "--memory", configfile['memory']]
- v.customize ["modifyvm", :id, "--cpus", configfile['cpus']]
- v.customize ["modifyvm", :id, "--hwvirtex", configfile['hwvirtex']]
- end
-
- config.vm.boot_timeout = configfile['boot_timeout']
-
- config.vm.provision :shell, :path => "fixpaths.sh"
-
- if configfile.has_key? "aptproxy"
- config.vm.provision :shell, path: "provision-apt-proxy",
- args: [configfile["aptproxy"]]
- end
-
- # buildserver/ is shared to the VM's /vagrant by default so the old
- # default does not need a custom mount
- if configfile["cachedir"] != "buildserver/cache"
- config.vm.synced_folder configfile["cachedir"], '/vagrant/cache',
- owner: 'root', group: 'root', create: true
- end
-
- # cache .deb packages on the host via a mount trick
- if configfile.has_key? "aptcachedir"
- config.vm.synced_folder configfile["aptcachedir"], "/var/cache/apt/archives",
- owner: 'root', group: 'root', create: true
- end
-
- config.vm.provision "shell", path: "setup-env-vars",
- args: ["/home/vagrant/android-sdk"]
- config.vm.provision "shell", path: "provision-apt-get-install",
- args: [configfile['debian_mirror']]
-
- config.vm.provision :chef_solo do |chef|
- chef.cookbooks_path = "cookbooks"
- chef.log_level = :debug
- chef.add_recipe "kivy"
- end
-
- config.vm.provision "shell", path: "provision-android-sdk"
- config.vm.provision "shell", path: "provision-android-ndk",
- args: ["/home/vagrant/android-ndk"]
- config.vm.provision "shell", path: "provision-pip",
- args: ["compare-locales"]
- config.vm.provision "shell", path: "provision-gradle"
- config.vm.provision "file", source: "gradle",
- destination: "/opt/gradle/bin/gradle"
-
- # let Ubuntu/trusty's paramiko work with the VM instance
- if `uname -v`.include? "14.04"
- config.vm.provision "shell", path: "provision-ubuntu-trusty-paramiko"
- end
-
-end
-"""
-
-
-# Check against the existing Vagrantfile, and if they differ, we need to
-# create a new box:
-vf = os.path.join(serverdir, 'Vagrantfile')
+# Check against the existing Vagrantfile.yaml, and if they differ, we
+# need to create a new box:
+vf = os.path.join(serverdir, 'Vagrantfile.yaml')
writevf = True
if os.path.exists(vf):
vagrant(['halt'], serverdir)
- with open(vf, 'r') as f:
- oldvf = f.read()
- if oldvf != vagrantfile:
+ with open(vf, 'r', encoding='utf-8') as f:
+ oldconfig = yaml.load(f)
+ if config != oldconfig:
print("Server configuration has changed, rebuild from scratch is required")
vagrant(['destroy', '-f'], serverdir)
else:
else:
print("No existing server - building from scratch")
if writevf:
- with open(vf, 'w') as f:
- f.write(vagrantfile)
-
+ with open(vf, 'w', encoding='utf-8') as f:
+ yaml.dump(config, f)
print("Configuring build server VM")
returncode, out = vagrant(['up', '--provision'], serverdir, printout=True)