Lines Matching +full:min +full:- +full:os +full:- +full:version
1 # -*- coding: utf-8 -*-
3 #-------------------------------------------------------------------------
5 # --------------------------------------
9 # Licensed under the Apache License, Version 2.0 (the "License");
13 # http://www.apache.org/licenses/LICENSE-2.0
21 #-------------------------------------------------------------------------
23 # \todo [2017-04-10 pyry]
25 # * cmake -E copy_directory doesn't copy timestamps which will cause
26 # assets to be always re-packaged
29 import os
40 sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
53 buildToolsPath = os.path.join(path, "build-tools")
56 if os.path.exists(buildToolsPath):
57 for item in os.listdir(buildToolsPath):
58 m = re.match(r'^([0-9]+)\.([0-9]+)\.([0-9]+)$', item)
78 return versions[-1]
81 return os.path.join(self.path, "platforms", "android-%d" % apiVersion, "android.jar")
84 return os.path.join(self.path, "build-tools", "%d.%d.%d" % self.buildToolsVersion)
89 self.version = NDKEnv.detectVersion(self.path)
94 return ["armeabi-v7a", "arm64-v8a", "x86", "x86_64"]
99 "armeabi-v7a": 'android-arm',
100 "arm64-v8a": 'android-arm64',
101 "x86": 'android-x86',
102 "x86_64": 'android-x86_64',
112 propFilePath = os.path.join(path, "source.properties")
125 …raise Exception("Failed to detect NDK version (does %s/source.properties have Pkg.Revision?)" % pa…
129 os = HostInfo.getOs()
131 hostOsParts = hostOsName.split('-')
140 if os == HostInfo.OS_WINDOWS:
142 elif os == HostInfo.OS_LINUX:
144 elif os == HostInfo.OS_OSX:
147 raise Exception("Unhandled HostInfo.getOs() '%d'" % os)
153 "windows-x86_64",
154 "darwin-x86",
155 "darwin-x86_64",
156 "linux-x86",
157 "linux-x86_64"
161 if os.path.exists(os.path.join(path, "prebuilt", name)):
164 raise Exception("Failed to determine NDK host OS")
191 if not os.path.exists(self.env.ndk.path):
197 if self.env.ndk.version[0] < 15:
198 …raise Exception("Android NDK version %d is not supported; build requires NDK version >= 15" % (sel…
201 …raise Exception("Requires: min-api (%d) <= java-api (%d) <= native-api (%d)" % (self.minApi, self.…
204 …raise Exception("No build tools directory found at %s" % os.path.join(self.env.sdk.path, "build-to…
252 packageDir = os.path.join(*packageComps)
254 return os.path.join(config.buildPath, self.package.getAppDirName(), "src", packageDir, "R.java")
265 return os.path.join(*resolvedComps)
284 of files. Any non-existent input paths are preserved as is.
288 for root, dirs, files in os.walk(dirPath):
290 yield os.path.join(root, file)
294 if os.path.isdir(path):
310 existingInputs = list(filter(os.path.exists, expandedInputs))
311 existingOutputs = list(filter(os.path.exists, expandedOutputs))
322 lastInputChange = max(map(os.path.getmtime, existingInputs))
323 firstOutputChange = min(map(os.path.getmtime, existingOutputs))
331 …return os.path.join(config.buildPath, "%s-%s-%d" % (abiName, config.nativeBuildType, config.native…
335 args.append('-UANGLE_LIBS')
336 args.append('-UGLES1_LIBRARY')
337 args.append('-UGLES2_LIBRARY')
338 args.append('-UEGL_LIBRARY')
341 def makeNDKVersionString (version): argument
342 minorVersionString = (chr(ord('a') + version[1]) if version[1] > 0 else "")
343 return "r%d%s" % (version[0], minorVersionString)
346 args = ['-DDEQP_TARGET=android',
347 '-DDEQP_TARGET_TOOLCHAIN=ndk-modern',
348 '-DCMAKE_C_FLAGS=-Werror',
349 '-DCMAKE_CXX_FLAGS=-Werror',
350 '-DANDROID_NDK_PATH=%s' % config.env.ndk.path,
351 '-DANDROID_ABI=%s' % abiName,
352 '-DDE_ANDROID_API=%s' % config.nativeApi,
353 '-DGLCTS_GTF_TARGET=%s' % config.gtfTarget]
358 cMakeCachePath = os.path.join(getNativeBuildPath(config, abi), "CMakeCache.txt")
365 cMakeCachePath = os.path.join(getNativeBuildPath(config, abiName), "CMakeCache.txt")
366 angleLibsDir = os.path.join(config.angle, abiName)
373 args.append('-DANGLE_LIBS=%s' % angleLibsDir)
460 dstDir = os.path.dirname(resolvePath(config, [GeneratedResSourcePath(self.package)]))
462 if not os.path.exists(dstDir):
463 os.makedirs(dstDir)
468 "-f",
469 "-m",
470 "-S", resolvePath(config, self.package.getResPath()),
471 "-M", resolvePath(config, self.package.getManifestPath()),
472 "-J", resolvePath(config, [BuildRoot(), self.package.getAppDirName(), "src"]),
473 "-I", config.env.sdk.getPlatformLibrary(config.javaApi)
509 if os.path.exists(objPath):
512 os.makedirs(objPath)
517 "-source", "1.7",
518 "-target", "1.7",
519 "-d", objPath,
520 "-bootclasspath", config.env.sdk.getPlatformLibrary(config.javaApi),
521 "-classpath", pathSep.join(classPaths),
522 "-sourcepath", pathSep.join(srcPaths),
526 if not os.path.exists(os.path.dirname(jarPath)):
527 os.makedirs(os.path.dirname(jarPath))
562 "--dex",
563 "--output", dexPath
574 return os.path.exists(resolvePath(config, self.keystorePath))
579 "-genkey",
580 "-keystore", resolvePath(config, self.keystorePath),
581 "-storepass", "android",
582 "-alias", "androiddebugkey",
583 "-keypass", "android",
584 "-keyalg", "RSA",
585 "-keysize", "2048",
586 "-validity", "10000",
587 "-dname", "CN=, OU=, O=, L=, S=, C=",
614 if not os.path.exists(os.path.dirname(dstPath)):
615 os.makedirs(os.path.dirname(dstPath))
620 "-f",
621 "--min-sdk-version", str(config.minApi),
622 "--target-sdk-version", str(config.javaApi),
623 "-M", resolvePath(config, self.package.getManifestPath()),
624 "-I", config.env.sdk.getPlatformLibrary(config.javaApi),
625 "-F", dstPath,
629 args += ["-S", resolvePath(config, resPath)]
632 args.append("-v")
645 batchSize = min(len(workQueue), maxBatchSize)
651 "-f", apkPath,
665 self.dstPath = [BuildRoot(), self.package.getAppDirName(), "tmp", "with-java.apk"]
682 addFileToAPK(config, dstPath, os.path.dirname(dexPath), os.path.basename(dexPath))
689 self.dstPath = [BuildRoot(), self.package.getAppDirName(), "tmp", "with-assets.apk"]
702 allFiles = BuildStep.expandPathsToFiles([os.path.join(buildPath, "assets")])
703 return [os.path.relpath(p, buildPath) for p in allFiles]
720 self.dstPath = [BuildRoot(), self.package.getAppDirName(), "tmp", "with-native-libs.apk"]
740 libRelPath = os.path.join("lib", abi, "libdeqp.so")
741 libAbsPath = os.path.join(pkgPath, libRelPath)
743 if not os.path.exists(os.path.dirname(libAbsPath)):
744 os.makedirs(os.path.dirname(libAbsPath))
750 layersGlob = os.path.join(config.layers, abi, "libVkLayer_*.so")
753 layerFilename = os.path.basename(layer)
754 layerRelPath = os.path.join("lib", abi, layerFilename)
755 layerAbsPath = os.path.join(pkgPath, layerRelPath)
761 angleGlob = os.path.join(config.angle, abi, "lib*_angle.so")
764 libFilename = os.path.basename(lib)
765 libRelPath = os.path.join("lib", abi, libFilename)
766 libAbsPath = os.path.join(pkgPath, libRelPath)
793 "-keystore", resolvePath(config, self.keystorePath),
794 "-storepass", "android",
795 "-keypass", "android",
796 "-signedjar", dstPath,
802 return os.path.join(package.getAppDirName(), package.getAppName() + ".apk")
820 zipalignPath = os.path.join(config.env.sdk.getBuildToolsPath(), "zipalign")
824 "-f", "4",
869 ctsPackage = PackageDescription("openglcts", "Khronos-CTS", hasResources = False)
879 ndkBuildPath = which('ndk-build')
881 return os.path.dirname(ndkBuildPath)
888 return os.path.dirname(os.path.dirname(sdkBuildPath))
893 return os.path.join(tempfile.gettempdir(), "deqp-android-build")
901 parser = argparse.ArgumentParser(os.path.basename(__file__),
903 parser.add_argument('--native-build-type',
908 parser.add_argument('--build-root',
912 parser.add_argument('--abis',
916 parser.add_argument('--native-api',
921 parser.add_argument('--min-api',
926 parser.add_argument('--sdk',
931 parser.add_argument('--ndk',
936 parser.add_argument('-v', '--verbose',
941 parser.add_argument('--target',
946 parser.add_argument('--kc-cts-target',
950 help="KC-CTS (GTF) target API (only used in openglcts target)")
951 parser.add_argument('--layers-path',
955 parser.add_argument('--angle-path',
978 raise Exception("--abis can't be empty")
982 sys.exit(-1)
989 ndk = NDKEnv(os.path.realpath(args.ndkPath))
990 sdk = SDKEnv(os.path.realpath(args.sdkPath))
991 buildPath = os.path.realpath(args.buildRoot)
1002 print(" --sdk=%s" % args.sdkPath)
1003 print(" --ndk=%s" % args.ndkPath)
1004 sys.exit(-1)
1012 print("Built %s" % os.path.join(buildPath, getBuildRootRelativeAPKPath(pkg)))