Lines Matching refs:self
47 def __init__(self, path, desired_version):
48 self.path = path
49 self.buildToolsVersion = SDKEnv.selectBuildToolsVersion(self.path, desired_version)
82 def getPlatformLibrary (self, apiVersion):
83 return os.path.join(self.path, "platforms", "android-%d" % apiVersion, "android.jar")
85 def getBuildToolsPath (self):
86 return os.path.join(self.path, "build-tools", "%d.%d.%d" % self.buildToolsVersion)
89 def __init__(self, path):
90 self.path = path
91 self.version = NDKEnv.detectVersion(self.path)
92 self.hostOsName = NDKEnv.detectHostOsName(self.path)
169 def __init__(self, sdk, ndk):
170 self.sdk = sdk
171 self.ndk = ndk
174 def __init__(self, env, buildPath, abis, nativeApi, javaApi, minApi, nativeBuildType, gtfTarget, verbose, layers, angle):
175 self.env = env
176 self.sourcePath = DEQP_DIR
177 self.buildPath = buildPath
178 self.abis = abis
179 self.nativeApi = nativeApi
180 self.javaApi = javaApi
181 self.minApi = minApi
182 self.nativeBuildType = nativeBuildType
183 self.gtfTarget = gtfTarget
184 self.verbose = verbose
185 self.layers = layers
186 self.angle = angle
187 self.dCompilerName = "d8"
188 self.cmakeGenerator = selectFirstAvailableGenerator([NINJA_GENERATOR, MAKEFILE_GENERATOR, NMAKE_GENERATOR])
190 def check (self):
191 if self.cmakeGenerator == None:
194 if not os.path.exists(self.env.ndk.path):
195 raise Exception("Android NDK not found at %s" % self.env.ndk.path)
197 if not NDKEnv.isHostOsSupported(self.env.ndk.hostOsName):
198 raise Exception("NDK '%s' is not supported on this machine" % self.env.ndk.hostOsName)
200 if self.env.ndk.version[0] < 15:
201 raise Exception("Android NDK version %d is not supported; build requires NDK version >= 15" % (self.env.ndk.version[0]))
203 if not (self.minApi <= self.javaApi <= self.nativeApi):
204 raise Exception("Requires: min-api (%d) <= java-api (%d) <= native-api (%d)" % (self.minApi, self.javaApi, self.nativeApi))
206 if self.env.sdk.buildToolsVersion == (0,0,0):
207 raise Exception("No build tools directory found at %s" % os.path.join(self.env.sdk.path, "build-tools"))
209 if not os.path.exists(os.path.join(self.env.sdk.path, "platforms", "android-%d" % self.javaApi)):
210 raise Exception("No SDK with api version %d directory found at %s for Java Api" % (self.javaApi, os.path.join(self.env.sdk.path, "platforms")))
213 if which(self.dCompilerName, [self.env.sdk.getBuildToolsPath()]) == None:
214 print("Couldn't find %s, will try to find dx", self.dCompilerName)
215 self.dCompilerName = "dx"
217 androidBuildTools = ["aapt", "zipalign", "apksigner", self.dCompilerName]
219 if which(tool, [self.env.sdk.getBuildToolsPath()]) == None:
220 raise Exception("Missing Android build tool: %s in %s" % (tool, self.env.sdk.getBuildToolsPath()))
239 def __init__ (self):
243 def resolve (self, config):
247 def resolve (self, config):
251 def __init__ (self, abiName):
252 self.abiName = abiName
254 def resolve (self, config):
255 return getNativeBuildPath(config, self.abiName)
258 def __init__ (self, package):
259 self.package = package
261 def resolve (self, config):
262 packageComps = self.package.getPackageName(config).split('.')
265 return os.path.join(config.buildPath, self.package.getAppDirName(), "src", packageDir, "R.java")
282 def __init__ (self):
285 def getInputs (self):
288 def getOutputs (self):
312 def isUpToDate (self, config):
313 inputs = resolvePaths(config, self.getInputs())
314 outputs = resolvePaths(config, self.getOutputs())
407 def __init__ (self, appDirName, appName, hasResources = True):
408 self.appDirName = appDirName
409 self.appName = appName
410 self.hasResources = hasResources
412 def getAppName (self):
413 return self.appName
415 def getAppDirName (self):
416 return self.appDirName
418 def getPackageName (self, config):
419 manifestPath = resolvePath(config, self.getManifestPath())
423 def getManifestPath (self):
424 return [SourceRoot(), "android", self.appDirName, "AndroidManifest.xml"]
426 def getResPath (self):
427 return [SourceRoot(), "android", self.appDirName, "res"]
429 def getSourcePaths (self):
431 [SourceRoot(), "android", self.appDirName, "src"]
434 def getAssetsPath (self):
435 return [BuildRoot(), self.appDirName, "assets"]
437 def getClassesJarPath (self):
438 return [BuildRoot(), self.appDirName, "bin", "classes.jar"]
440 def getClassesDexDirectory (self):
441 return [BuildRoot(), self.appDirName, "bin",]
443 def getClassesDexPath (self):
444 return [BuildRoot(), self.appDirName, "bin", "classes.dex"]
446 def getAPKPath (self):
447 return [BuildRoot(), self.appDirName, "bin", self.appName + ".apk"]
452 def __init__ (self, abi):
453 self.abi = abi
455 def isUpToDate (self, config):
458 def update (self, config):
459 log(config, "BuildNativeLibrary: %s" % self.abi)
460 buildNativeLibrary(config, self.abi)
463 def __init__ (self, package):
464 self.package = package
466 def getInputs (self):
467 return [self.package.getResPath(), self.package.getManifestPath()]
469 def getOutputs (self):
470 return [[GeneratedResSourcePath(self.package)]]
472 def update (self, config):
474 dstDir = os.path.dirname(resolvePath(config, [GeneratedResSourcePath(self.package)]))
484 "-S", resolvePath(config, self.package.getResPath()),
485 "-M", resolvePath(config, self.package.getManifestPath()),
486 "-J", resolvePath(config, [BuildRoot(), self.package.getAppDirName(), "src"]),
492 def __init__ (self, package, libraries = []):
493 self.package = package
494 self.libraries = libraries
496 def getSourcePaths (self):
497 srcPaths = self.package.getSourcePaths()
499 if self.package.hasResources:
500 srcPaths.append([BuildRoot(), self.package.getAppDirName(), "src"]) # Generated sources
504 def getInputs (self):
505 inputs = self.getSourcePaths()
507 for lib in self.libraries:
512 def getOutputs (self):
513 return [self.package.getClassesJarPath()]
515 def update (self, config):
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]
555 def __init__ (self, package, libraries):
556 self.package = package
557 self.libraries = libraries
559 def getInputs (self):
560 return [self.package.getClassesJarPath()] + [lib.getClassesJarPath() for lib in self.libraries]
562 def getOutputs (self):
563 return [self.package.getClassesDexPath()]
565 def update (self, config):
567 dexPath = resolvePath(config, self.package.getClassesDexDirectory())
568 jarPaths = [resolvePath(config, self.package.getClassesJarPath())]
570 for lib in self.libraries:
585 def __init__ (self):
586 self.keystorePath = [BuildRoot(), "debug.keystore"]
588 def getOutputs (self):
589 return [self.keystorePath]
591 def isUpToDate (self, config):
592 return os.path.exists(resolvePath(config, self.keystorePath))
594 def update (self, config):
598 "-keystore", resolvePath(config, self.keystorePath),
610 def __init__ (self, package, libraries = []):
611 self.package = package
612 self.libraries = libraries
613 self.dstPath = [BuildRoot(), self.package.getAppDirName(), "tmp", "base.apk"]
615 def getResPaths (self):
617 for pkg in [self.package] + self.libraries:
622 def getInputs (self):
623 return [self.package.getManifestPath()] + self.getResPaths()
625 def getOutputs (self):
626 return [self.dstPath]
628 def update (self, config):
630 dstPath = resolvePath(config, self.dstPath)
641 "-M", resolvePath(config, self.package.getManifestPath()),
647 for resPath in self.getResPaths():
684 def __init__ (self, package):
685 self.package = package
686 self.srcPath = BuildBaseAPK(self.package).getOutputs()[0]
687 self.dstPath = [BuildRoot(), self.package.getAppDirName(), "tmp", "with-java.apk"]
689 def getInputs (self):
691 self.srcPath,
692 self.package.getClassesDexPath(),
695 def getOutputs (self):
696 return [self.dstPath]
698 def update (self, config):
699 srcPath = resolvePath(config, self.srcPath)
700 dstPath = resolvePath(config, self.getOutputs()[0])
701 dexPath = resolvePath(config, self.package.getClassesDexPath())
707 def __init__ (self, package, abi):
708 self.package = package
709 self.buildPath = [NativeBuildPath(abi)]
710 self.srcPath = AddJavaToAPK(self.package).getOutputs()[0]
711 self.dstPath = [BuildRoot(), self.package.getAppDirName(), "tmp", "with-assets.apk"]
713 def getInputs (self):
715 self.srcPath,
716 self.buildPath + ["assets"]
719 def getOutputs (self):
720 return [self.dstPath]
727 def update (self, config):
728 srcPath = resolvePath(config, self.srcPath)
729 dstPath = resolvePath(config, self.getOutputs()[0])
730 buildPath = resolvePath(config, self.buildPath)
738 def __init__ (self, package, abis):
739 self.package = package
740 self.abis = abis
741 self.srcPath = AddAssetsToAPK(self.package, "").getOutputs()[0]
742 self.dstPath = [BuildRoot(), self.package.getAppDirName(), "tmp", "with-native-libs.apk"]
744 def getInputs (self):
745 paths = [self.srcPath]
746 for abi in self.abis:
750 def getOutputs (self):
751 return [self.dstPath]
753 def update (self, config):
754 srcPath = resolvePath(config, self.srcPath)
755 dstPath = resolvePath(config, self.getOutputs()[0])
756 pkgPath = resolvePath(config, [BuildRoot(), self.package.getAppDirName()])
760 for abi in self.abis:
798 def __init__ (self, package):
799 self.package = package
800 self.srcPath = AlignAPK(self.package).getOutputs()[0]
801 self.dstPath = [BuildRoot(), getBuildRootRelativeAPKPath(self.package)]
802 self.keystorePath = CreateKeystore().getOutputs()[0]
804 def getInputs (self):
805 return [self.srcPath, self.keystorePath]
807 def getOutputs (self):
808 return [self.dstPath]
810 def update (self, config):
812 srcPath = resolvePath(config, self.srcPath)
813 dstPath = resolvePath(config, self.dstPath)
818 "--ks", resolvePath(config, self.keystorePath),
832 def __init__ (self, package):
833 self.package = package
834 self.srcPath = AddNativeLibsToAPK(self.package, []).getOutputs()[0]
835 self.dstPath = [BuildRoot(), self.package.getAppDirName(), "tmp", "aligned.apk"]
836 self.keystorePath = CreateKeystore().getOutputs()[0]
838 def getInputs (self):
839 return [self.srcPath]
841 def getOutputs (self):
842 return [self.dstPath]
844 def update (self, config):
845 srcPath = resolvePath(config, self.srcPath)
846 dstPath = resolvePath(config, self.dstPath)