def GetJdkHome(): root = os.path.join(JDK_DIR, 'openjdk-9.0.4') if defines.IsLinux(): return os.path.join(root, 'linux') elif defines.IsOsX(): return os.path.join(root, 'osx') elif defines.IsWindows(): return os.path.join(root, 'windows') else: return os.environ['JAVA_HOME']
def GetJavacExecutable(jdkHome=None): jdkHome = jdkHome if jdkHome else GetJdkHome() executable = 'javac.exe' if defines.IsWindows() else 'javac' return os.path.join(jdkHome, 'bin', executable) if jdkHome else executable
def IsWindows(): return defines.IsWindows()
import optparse import os import re import shutil import subprocess import sys import utils import zipfile if defines.IsLinux(): JDK8_JAVAC = os.path.join(defines.THIRD_PARTY, 'openjdk', 'jdk8', 'linux-x86', 'bin', 'javac') elif defines.IsOsX(): JDK8_JAVAC = os.path.join(defines.THIRD_PARTY, 'openjdk', 'jdk8', 'darwin-x86', 'bin', 'javac') elif defines.IsWindows(): raise Exception( 'Cannot compile using JDK8 on Windows hence cannot archive.') CONVERSION_FOLDER = os.path.join(defines.REPO_ROOT, 'src', 'test', 'desugaredLibraryConversions') VERSION_FILE = 'VERSION.txt' LIBRARY_NAME = 'desugar_jdk_libs' def ParseOptions(argv): result = optparse.OptionParser() result.add_option('--dry-run', '--dry_run', help='Running on bot, use third_party dependency.',