def get_tagged_releases(archive_path): u = urlparse.urlparse(archive_path) bucket = get_bucket(u.hostname) tags = run.shell_command( "git for-each-ref --sort=taggerdate --format '%(*objectname) %(refname)' refs/tags" ).split('\n') tags.reverse() releases = [] for line in tags: line = line.strip() if not line: continue m = re.match('(.*?) refs/tags/(.*?)$', line) if not m: continue sha1, tag = m.groups() epoch = run.shell_command('git log -n1 --pretty=%%ct %s' % sha1.strip()) date = datetime.fromtimestamp(float(epoch)) files = get_files(archive_path, bucket, sha1) if len(files) > 0: releases.append({ 'tag': tag, 'sha1': sha1, 'abbrevsha1': sha1[:7], 'date': str(date), 'files': files }) return releases
def get_local_compiler_from_bash(): path = run.shell_command('which clang++') if path != None: return "clang++" path = run.shell_command('which g++') if path != None: return "g++" return None
def get_local_darwin_toolchain_version(): if not os.path.exists('/usr/bin/xcodebuild'): return None # Xcode 12.5.1 # Build version 12E507 xcode_version_full = run.shell_command('/usr/bin/xcodebuild -version') xcode_version_lines = xcode_version_full.split("\n") xcode_version = xcode_version_lines[0].split()[1].strip() return xcode_version
def get_current_repo(): # [email protected]:defold/defold.git # https://github.com/defold/defold.git url = run.shell_command('git remote get-url origin') url = url.replace('.git', '').strip() domain = "github.com" index = url.index(domain) if index < 0: return None return url[index + len(domain) + 1:]
def get_local_compiler_path(): tool = get_local_compiler_from_bash() if tool is None: return None path = run.shell_command('which %s' % tool) substr = '/bin' if substr in path: i = path.find(substr) path = path[:i] return path return None
def get_local_darwin_toolchain_path(): default_path = '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain' if os.path.exists(default_path): return default_path path = run.shell_command( 'xcrun -f --show-sdk-path' ) # /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk substr = 'Contents/Developer' if substr in path: i = path.find(substr) path = path[:i + len(substr)] + 'XcodeDefault.xctoolchain' return path return None
def get_windows_local_sdk_info(platform): global windows_info if windows_info is not None: return windows_info vswhere_path = '%s/../../scripts/windows/vswhere2/vswhere2.exe' % os.environ[ 'DYNAMO_HOME'] if not os.path.exists(vswhere_path): vswhere_path = './scripts/windows/vswhere2/vswhere2.exe' vswhere_path = path.normpath(vswhere_path) if not os.path.exists(vswhere_path): print "Couldn't find executable '%s'" % vswhere_path return None sdk_root = run.shell_command('%s --sdk_root' % vswhere_path).strip() sdk_version = run.shell_command('%s --sdk_version' % vswhere_path).strip() includes = run.shell_command('%s --includes' % vswhere_path).strip() lib_paths = run.shell_command('%s --lib_paths' % vswhere_path).strip() bin_paths = run.shell_command('%s --bin_paths' % vswhere_path).strip() vs_root = run.shell_command('%s --vs_root' % vswhere_path).strip() vs_version = run.shell_command('%s --vs_version' % vswhere_path).strip() if platform == 'win32': arch64 = 'x64' arch32 = 'x86' bin_paths = bin_paths.replace(arch64, arch32) lib_paths = lib_paths.replace(arch64, arch32) info = {} info['sdk_root'] = sdk_root info['sdk_version'] = sdk_version info['includes'] = includes info['lib_paths'] = lib_paths info['bin_paths'] = bin_paths info['vs_root'] = vs_root info['vs_version'] = vs_version windows_info = info return windows_info
def get_local_compiler_version(): tool = get_local_compiler_from_bash() if tool is None: return None return run.shell_command('%s -dumpversion' % tool).strip()
def get_local_darwin_sdk_version(platform): return run.shell_command('xcrun -f --sdk %s --show-sdk-platform-version' % _convert_darwin_platform(platform)).strip()
def get_git_branch(): return run.shell_command('git rev-parse --abbrev-ref HEAD').strip()
def get_default_repo(): url = run.shell_command('git remote get-url origin') if not 'github.com' in url: return None # [email protected]:defold/defold.git return url.replace('[email protected]:', '').replace('.git', '').strip()