2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-07 15:20:38 +00:00
iceraven-browser/automation/taskcluster/lib/build_variants.py
2019-04-02 13:36:35 +02:00

25 lines
795 B
Python

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import print_function
import json
import subprocess
def from_gradle():
process = subprocess.Popen([
"./gradlew", "--no-daemon", "--quiet", "printBuildVariants"
], stdout=subprocess.PIPE)
(output, err) = process.communicate()
exit_code = process.wait()
if exit_code != 0:
print("Gradle command returned error: {}".format(exit_code))
variants_line = [line for line in output.split('\n') if line.startswith('variants: ')][0]
variants_json = variants_line.split(' ', 1)[1]
variants = json.loads(variants_json)
return variants