Lines Matching +full:- +full:- +full:config
1 # -*- coding: utf-8 -*-
3 #-------------------------------------------------------------------------
5 # --------------------------------------
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
43 from ctsbuild.config import *
53 buildToolsPath = os.path.join(path, "build-tools")
58 m = re.match(r'^([0-9]+)\.([0-9]+)\.([0-9]+)$', item)
71 if preferred == -1:
83 return os.path.join(self.path, "platforms", "android-%d" % apiVersion, "android.jar")
86 return os.path.join(self.path, "build-tools", "%d.%d.%d" % self.buildToolsVersion)
96 return ["armeabi-v7a", "arm64-v8a", "x86", "x86_64"]
101 "armeabi-v7a": 'android-arm',
102 "arm64-v8a": 'android-arm64',
103 "x86": 'android-x86',
104 "x86_64": 'android-x86_64',
133 hostOsParts = hostOsName.split('-')
155 "windows-x86_64",
156 "darwin-x86",
157 "darwin-x86_64",
158 "linux-x86",
159 "linux-x86_64"
204 …raise Exception("Requires: min-api (%d) <= java-api (%d) <= native-api (%d)" % (self.minApi, self.…
207 …raise Exception("No build tools directory found at %s" % os.path.join(self.env.sdk.path, "build-to…
209 if not os.path.exists(os.path.join(self.env.sdk.path, "platforms", "android-%d" % self.javaApi)):
227 def log (config, msg): argument
228 if config.verbose:
231 def executeAndLog (config, args): argument
232 if config.verbose:
243 def resolve (self, config): argument
244 return config.sourcePath
247 def resolve (self, config): argument
248 return config.buildPath
254 def resolve (self, config): argument
255 return getNativeBuildPath(config, self.abiName)
261 def resolve (self, config): argument
262 packageComps = self.package.getPackageName(config).split('.')
265 return os.path.join(config.buildPath, self.package.getAppDirName(), "src", packageDir, "R.java")
267 def resolvePath (config, path): argument
272 resolvedComps.append(component.resolve(config))
278 def resolvePaths (config, paths): argument
279 return list(map(lambda p: resolvePath(config, p), paths))
295 of files. Any non-existent input paths are preserved as is.
312 def isUpToDate (self, config): argument
313 inputs = resolvePaths(config, self.getInputs())
314 outputs = resolvePaths(config, self.getOutputs())
338 def update (config): argument
341 def getNativeBuildPath (config, abiName): argument
342 …return os.path.join(config.buildPath, "%s-%s-%d" % (abiName, config.nativeBuildType, config.native…
346 args.append('-UANGLE_LIBS')
347 args.append('-UGLES1_LIBRARY')
348 args.append('-UGLES2_LIBRARY')
349 args.append('-UEGL_LIBRARY')
351 def buildNativeLibrary (config, abiName): argument
356 def getBuildArgs (config, abiName): argument
357 args = ['-DDEQP_TARGET=android',
358 '-DDEQP_TARGET_TOOLCHAIN=ndk-modern',
359 '-DCMAKE_C_FLAGS=-Werror',
360 '-DCMAKE_CXX_FLAGS=-Werror',
361 '-DANDROID_NDK_PATH=%s' % config.env.ndk.path,
362 '-DANDROID_ABI=%s' % abiName,
363 '-DDE_ANDROID_API=%s' % config.nativeApi,
364 '-DGLCTS_GTF_TARGET=%s' % config.gtfTarget]
366 if config.angle is None:
369 cMakeCachePath = os.path.join(getNativeBuildPath(config, abi), "CMakeCache.txt")
376 cMakeCachePath = os.path.join(getNativeBuildPath(config, abiName), "CMakeCache.txt")
377 angleLibsDir = os.path.join(config.angle, abiName)
384 args.append('-DANGLE_LIBS=%s' % angleLibsDir)
388 nativeBuildPath = getNativeBuildPath(config, abiName)
389 buildConfig = BuildConfig(nativeBuildPath, config.nativeBuildType, getBuildArgs(config, abiName))
391 build(buildConfig, config.cmakeGenerator, ["deqp"])
393 def executeSteps (config, steps): argument
395 if not step.isUpToDate(config):
396 step.update(config)
418 def getPackageName (self, config): argument
419 manifestPath = resolvePath(config, self.getManifestPath())
455 def isUpToDate (self, config): argument
458 def update (self, config): argument
459 log(config, "BuildNativeLibrary: %s" % self.abi)
460 buildNativeLibrary(config, self.abi)
472 def update (self, config): argument
473 aaptPath = which("aapt", [config.env.sdk.getBuildToolsPath()])
474 dstDir = os.path.dirname(resolvePath(config, [GeneratedResSourcePath(self.package)]))
479 executeAndLog(config, [
482 "-f",
483 "-m",
484 "-S", resolvePath(config, self.package.getResPath()),
485 "-M", resolvePath(config, self.package.getManifestPath()),
486 "-J", resolvePath(config, [BuildRoot(), self.package.getAppDirName(), "src"]),
487 "-I", config.env.sdk.getPlatformLibrary(config.javaApi)
515 def update (self, config): argument
516 srcPaths = resolvePaths(config, self.getSourcePaths())
518 jarPath = resolvePath(config, self.package.getClassesJarPath())
519 objPath = resolvePath(config, [BuildRoot(), self.package.getAppDirName(), "obj"])
520 classPaths = [objPath] + [resolvePath(config, lib.getClassesJarPath()) for lib in self.libraries]
529 executeAndLog(config, [
531 "-source", "1.7",
532 "-target", "1.7",
533 "-d", objPath,
534 "-bootclasspath", config.env.sdk.getPlatformLibrary(config.javaApi),
535 "-classpath", pathSep.join(classPaths),
536 "-sourcepath", pathSep.join(srcPaths),
545 executeAndLog(config, [
565 def update (self, config): argument
566 dxPath = which(config.dCompilerName, [config.env.sdk.getBuildToolsPath()])
567 dexPath = resolvePath(config, self.package.getClassesDexDirectory())
568 jarPaths = [resolvePath(config, self.package.getClassesJarPath())]
571 jarPaths.append(resolvePath(config, lib.getClassesJarPath()))
574 if config.dCompilerName == "d8":
575 args.append("--lib")
576 args.append(config.env.sdk.getPlatformLibrary(config.javaApi))
578 args.append("--dex")
579 args.append("--output")
582 executeAndLog(config, args + jarPaths)
591 def isUpToDate (self, config): argument
592 return os.path.exists(resolvePath(config, self.keystorePath))
594 def update (self, config): argument
595 executeAndLog(config, [
597 "-genkeypair",
598 "-keystore", resolvePath(config, self.keystorePath),
599 "-storepass", "android",
600 "-alias", "androiddebugkey",
601 "-keypass", "android",
602 "-keyalg", "RSA",
603 "-keysize", "2048",
604 "-validity", "10000",
605 "-dname", "CN=, OU=, O=, L=, S=, C=",
628 def update (self, config): argument
629 aaptPath = which("aapt", [config.env.sdk.getBuildToolsPath()])
630 dstPath = resolvePath(config, self.dstPath)
638 "-f",
639 "--min-sdk-version", str(config.minApi),
640 "--target-sdk-version", str(config.javaApi),
641 "-M", resolvePath(config, self.package.getManifestPath()),
642 "-I", config.env.sdk.getPlatformLibrary(config.javaApi),
643 "-F", dstPath,
644 "-0", "arsc" # arsc files need to be uncompressed for SDK version 30 and up
648 args += ["-S", resolvePath(config, resPath)]
650 if config.verbose:
651 args.append("-v")
653 executeAndLog(config, args)
655 def addFilesToAPK (config, apkPath, baseDir, relFilePaths): argument
656 aaptPath = which("aapt", [config.env.sdk.getBuildToolsPath()])
670 executeAndLog(config, [
673 "-f", apkPath,
680 def addFileToAPK (config, apkPath, baseDir, relFilePath): argument
681 addFilesToAPK(config, apkPath, baseDir, [relFilePath])
687 self.dstPath = [BuildRoot(), self.package.getAppDirName(), "tmp", "with-java.apk"]
698 def update (self, config): argument
699 srcPath = resolvePath(config, self.srcPath)
700 dstPath = resolvePath(config, self.getOutputs()[0])
701 dexPath = resolvePath(config, self.package.getClassesDexPath())
704 addFileToAPK(config, dstPath, os.path.dirname(dexPath), os.path.basename(dexPath))
711 self.dstPath = [BuildRoot(), self.package.getAppDirName(), "tmp", "with-assets.apk"]
727 def update (self, config): argument
728 srcPath = resolvePath(config, self.srcPath)
729 dstPath = resolvePath(config, self.getOutputs()[0])
730 buildPath = resolvePath(config, self.buildPath)
735 addFilesToAPK(config, dstPath, buildPath, assetFiles)
742 self.dstPath = [BuildRoot(), self.package.getAppDirName(), "tmp", "with-native-libs.apk"]
753 def update (self, config): argument
754 srcPath = resolvePath(config, self.srcPath)
755 dstPath = resolvePath(config, self.getOutputs()[0])
756 pkgPath = resolvePath(config, [BuildRoot(), self.package.getAppDirName()])
761 libSrcPath = resolvePath(config, [NativeBuildPath(abi), "libdeqp.so"])
771 if config.layers:
773 layersGlob = os.path.join(config.layers, abi, "*")
783 if config.angle:
784 angleGlob = os.path.join(config.angle, abi, "lib*_angle.so")
795 addFilesToAPK(config, dstPath, pkgPath, libFiles)
810 def update (self, config): argument
811 apksigner = which("apksigner", [config.env.sdk.getBuildToolsPath()])
812 srcPath = resolvePath(config, self.srcPath)
813 dstPath = resolvePath(config, self.dstPath)
815 executeAndLog(config, [
818 "--ks", resolvePath(config, self.keystorePath),
819 "--ks-key-alias", "androiddebugkey",
820 "--ks-pass", "pass:android",
821 "--key-pass", "pass:android",
822 "--min-sdk-version", str(config.minApi),
823 "--max-sdk-version", str(config.javaApi),
824 "--out", dstPath,
844 def update (self, config): argument
845 srcPath = resolvePath(config, self.srcPath)
846 dstPath = resolvePath(config, self.dstPath)
847 zipalignPath = os.path.join(config.env.sdk.getBuildToolsPath(), "zipalign")
849 executeAndLog(config, [
851 "-f", "4",
896 ctsPackage = PackageDescription("openglcts", "Khronos-CTS", hasResources = False)
906 ndkBuildPath = which('ndk-build')
920 return os.path.join(tempfile.gettempdir(), "deqp-android-build")
930 parser.add_argument('--native-build-type',
935 parser.add_argument('--build-root',
939 parser.add_argument('--abis',
943 parser.add_argument('--native-api',
948 parser.add_argument('--java-api',
953 parser.add_argument('--tool-api',
956 default=-1,
957 help="Android Tools level to target (-1 being maximum present)")
958 parser.add_argument('--min-api',
963 parser.add_argument('--sdk',
968 parser.add_argument('--ndk',
973 parser.add_argument('-v', '--verbose',
978 parser.add_argument('--target',
983 parser.add_argument('--kc-cts-target',
987 help="KC-CTS (GTF) target API (only used in openglcts target)")
988 parser.add_argument('--layers-path',
992 parser.add_argument('--angle-path',
1015 raise Exception("--abis can't be empty")
1019 sys.exit(-1)
1030 …config = Configuration(env, buildPath, abis=args.abis, nativeApi=args.nativeApi, javaApi=args.jav… variable
1034 config.check()
1039 print(" --sdk=%s" % args.sdkPath)
1040 print(" --ndk=%s" % args.ndkPath)
1041 sys.exit(-1)
1044 steps = getBuildStepsForPackage(config.abis, pkg, libs)
1046 executeSteps(config, steps)