Lines Matching refs:j
491 func (j *Module) CheckStableSdkVersion(ctx android.BaseModuleContext) error {
492 sdkVersion := j.SdkVersion(ctx)
497 if useLegacyCorePlatformApi(ctx, j.BaseModuleName()) {
509 func (j *Module) checkSdkVersions(ctx android.ModuleContext) {
510 if j.RequiresStableAPIs(ctx) {
528 j.checkSdkLinkType(ctx, module.(moduleWithSdkDep), tag.(dependencyTag))
534 func (j *Module) checkPlatformAPI(ctx android.ModuleContext) {
536 usePlatformAPI := proptools.Bool(j.deviceProperties.Platform_apis)
547 func (j *Module) addHostProperties() {
548 j.AddProperties(
549 &j.properties,
550 &j.protoProperties,
551 &j.usesLibraryProperties,
555 func (j *Module) addHostAndDeviceProperties() {
556 j.addHostProperties()
557 j.AddProperties(
558 &j.deviceProperties,
559 &j.overridableDeviceProperties,
560 &j.dexer.dexProperties,
561 &j.dexpreoptProperties,
562 &j.linter.properties,
566 func (j *Module) OutputFiles(tag string) (android.Paths, error) {
569 return append(android.Paths{j.outputFile}, j.extraOutputFiles...), nil
571 return android.Paths{j.outputFile}, nil
573 return android.Paths{j.implementationAndResourcesJar}, nil
575 if j.dexer.proguardDictionary.Valid() {
576 return android.Paths{j.dexer.proguardDictionary.Path()}, nil
604 func (j *Module) shouldInstrument(ctx android.BaseModuleContext) bool {
605 return j.properties.Instrument &&
610 func (j *Module) shouldInstrumentStatic(ctx android.BaseModuleContext) bool {
611 return j.properties.Supports_static_instrumentation &&
612 j.shouldInstrument(ctx) &&
617 func (j *Module) shouldInstrumentInApex(ctx android.BaseModuleContext) bool {
623 if j.DirectlyInAnyApex() && !isJacocoAgent && !apexInfo.IsForPlatform() {
633 func (j *Module) SdkVersion(ctx android.EarlyModuleContext) android.SdkSpec {
634 return android.SdkSpecFrom(ctx, String(j.deviceProperties.Sdk_version))
637 func (j *Module) SystemModules() string {
638 return proptools.String(j.deviceProperties.System_modules)
641 func (j *Module) MinSdkVersion(ctx android.EarlyModuleContext) android.SdkSpec {
642 if j.deviceProperties.Min_sdk_version != nil {
643 return android.SdkSpecFrom(ctx, *j.deviceProperties.Min_sdk_version)
645 return j.SdkVersion(ctx)
648 func (j *Module) MaxSdkVersion(ctx android.EarlyModuleContext) android.SdkSpec {
649 maxSdkVersion := proptools.StringDefault(j.deviceProperties.Max_sdk_version, "")
655 func (j *Module) MinSdkVersionString() string {
656 return j.minSdkVersion.Raw
659 func (j *Module) TargetSdkVersion(ctx android.EarlyModuleContext) android.SdkSpec {
660 if j.deviceProperties.Target_sdk_version != nil {
661 return android.SdkSpecFrom(ctx, *j.deviceProperties.Target_sdk_version)
663 return j.SdkVersion(ctx)
666 func (j *Module) AvailableFor(what string) bool {
667 if what == android.AvailableToPlatform && Bool(j.deviceProperties.Hostdex) {
673 return j.ApexModuleBase.AvailableFor(what)
676 func (j *Module) deps(ctx android.BottomUpMutatorContext) {
678 j.linter.deps(ctx)
680 sdkDeps(ctx, android.SdkContext(j), j.dexer)
682 if j.deviceProperties.SyspropPublicStub != "" {
686 ctx.AddVariationDependencies(nil, syspropPublicStubDepTag, j.deviceProperties.SyspropPublicStub)
690 libDeps := ctx.AddVariationDependencies(nil, libTag, j.properties.Libs...)
691 ctx.AddVariationDependencies(nil, staticLibTag, j.properties.Static_libs...)
694 …ctx.AddVariationDependencies(nil, hiddenApiAnnotationsTag, j.properties.Hiddenapi_additional_annot…
706 for idx := range j.properties.Libs {
718 j.checkPartitionsForJavaDependency(ctx, "libs", javaDep)
738 …ctx.AddFarVariationDependencies(ctx.Config().BuildOSCommonTarget.Variations(), pluginTag, j.proper…
739 …dencies(ctx.Config().BuildOSCommonTarget.Variations(), errorpronePluginTag, j.properties.Errorpron…
740 …endencies(ctx.Config().BuildOSCommonTarget.Variations(), exportedPluginTag, j.properties.Exported_…
742 android.ProtoDeps(ctx, &j.protoProperties)
743 if j.hasSrcExt(".proto") {
744 protoDeps(ctx, &j.protoProperties)
747 if j.hasSrcExt(".kt") {
760 j.properties.Instrument = true
762 } else if j.shouldInstrumentStatic(ctx) {
766 if j.useCompose() {
782 func (j *Module) hasSrcExt(ext string) bool {
783 return hasSrcExt(j.properties.Srcs, ext)
786 func (j *Module) individualAidlFlags(ctx android.ModuleContext, aidlFile android.Path) string {
789 if Bool(j.deviceProperties.Aidl.Enforce_permissions) {
790 if !android.InList(aidlFile.String(), j.ignoredAidlPermissionList.Strings()) {
797 func (j *Module) aidlFlags(ctx android.ModuleContext, aidlPreprocess android.OptionalPath,
800 aidlIncludes := android.PathsForModuleSrc(ctx, j.deviceProperties.Aidl.Local_include_dirs)
802 android.PathsForModuleSrc(ctx, j.deviceProperties.Aidl.Export_include_dirs)...)
804 android.PathsForSource(ctx, j.deviceProperties.Aidl.Include_dirs)...)
809 flags = append(flags, j.deviceProperties.Aidl.Flags...)
818 if len(j.exportAidlIncludeDirs) > 0 {
819 flags = append(flags, android.JoinWithPrefix(j.exportAidlIncludeDirs.Strings(), "-I"))
831 if Bool(j.deviceProperties.Aidl.Generate_traces) {
835 if Bool(j.deviceProperties.Aidl.Generate_get_transaction_name) {
839 if Bool(j.deviceProperties.Aidl.Enforce_permissions) {
840 exceptions := j.deviceProperties.Aidl.Enforce_permissions_exceptions
841 j.ignoredAidlPermissionList = android.PathsForModuleSrcExcludes(ctx, exceptions, nil)
844 aidlMinSdkVersion := j.MinSdkVersion(ctx).ApiLevel.String()
850 func (j *Module) collectBuilderFlags(ctx android.ModuleContext, deps deps) javaBuilderFlags {
855 flags.javaVersion = getJavaVersion(ctx, String(j.properties.Java_version), android.SdkContext(j))
857 epEnabled := j.properties.Errorprone.Enabled
867 errorProneFlags = append(errorProneFlags, j.properties.Errorprone.Javacflags...)
886 decodeSdkDep(ctx, android.SdkContext(j)).hasStandardLibs() {
904 if Bool(j.properties.Use_tools_jar) {
914 flags.aidlFlags, flags.aidlDeps = j.aidlFlags(ctx, deps.aidlPreprocess, deps.aidlIncludeDirs)
919 func (j *Module) collectJavacFlags(
922 javacFlags := j.properties.Javacflags
932 javacFlags = append(javacFlags, j.properties.Openjdk9.Javacflags...)
934 if j.properties.Patch_module != nil {
977 "--patch-module="+String(j.properties.Patch_module)+"="+strings.Join(patchPaths, ":"))
990 func (j *Module) AddJSONData(d *map[string]interface{}) {
991 (&j.ModuleBase).AddJSONData(d)
993 "SourceExtensions": j.sourceExtensions,
998 func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) {
999 …j.exportAidlIncludeDirs = android.PathsForModuleSrc(ctx, j.deviceProperties.Aidl.Export_include_di…
1001 deps := j.collectDeps(ctx)
1002 flags := j.collectBuilderFlags(ctx, deps)
1005 j.properties.Srcs = append(j.properties.Srcs, j.properties.Openjdk9.Srcs...)
1008 srcFiles := android.PathsForModuleSrcExcludes(ctx, j.properties.Srcs, j.properties.Exclude_srcs)
1009 j.sourceExtensions = []string{}
1012 j.sourceExtensions = append(j.sourceExtensions, ext)
1016 flags = protoFlags(ctx, &j.properties, &j.protoProperties, flags)
1019 kotlinCommonSrcFiles := android.PathsForModuleSrcExcludes(ctx, j.properties.Common_srcs, nil)
1024 srcFiles = j.genSources(ctx, srcFiles, flags)
1028 flags = j.collectJavacFlags(ctx, flags, srcFiles)
1037 if j.properties.Jarjar_rules != nil {
1038 j.expandJarjarRules = android.PathForModuleSrc(ctx, *j.properties.Jarjar_rules)
1060 j.expandIDEInfoCompiledSrcs = append(j.expandIDEInfoCompiledSrcs, uniqueSrcFiles.Strings()...)
1072 kotlincFlags := j.properties.Kotlincflags
1102 …j.expandIDEInfoCompiledSrcs = append(j.expandIDEInfoCompiledSrcs, srcFiles.FilterByExt(".kt").Stri…
1103 …j.expandIDEInfoCompiledSrcs = append(j.expandIDEInfoCompiledSrcs, kotlinCommonSrcFiles.Strings()..…
1137 if BoolDefault(j.properties.Static_kotlin_stdlib, true) {
1151 j.compiledJavaSrcs = uniqueSrcFiles
1152 j.compiledSrcJars = srcJars
1157 if j.properties.Javac_shard_size != nil && *(j.properties.Javac_shard_size) > 0 {
1165 headerJarFileWithoutDepsOrJarjar, j.headerJarFile =
1166 j.compileJavaHeader(ctx, uniqueSrcFiles, srcJars, deps, flags, jarName, kotlinHeaderJars)
1173 if Bool(j.properties.Errorprone.Enabled) {
1177 } else if ctx.Config().RunErrorProne() && j.properties.Errorprone.Enabled == nil {
1197 shardSize := int(*(j.properties.Javac_shard_size))
1202 classes := j.compileJavaClasses(ctx, jarName, idx, shardSrc,
1208 classes := j.compileJavaClasses(ctx, jarName, len(shardSrcs),
1213 classes := j.compileJavaClasses(ctx, jarName, -1, uniqueSrcFiles, srcJars, flags, extraJarDeps)
1221 j.srcJarArgs, j.srcJarDeps = resourcePathsToJarArgs(srcFiles), srcFiles
1224 if Bool(j.properties.Include_srcs) {
1226 TransformResourcesToJar(ctx, includeSrcJar, j.srcJarArgs, j.srcJarDeps)
1229 dirArgs, dirDeps := ResourceDirsToJarArgs(ctx, j.properties.Java_resource_dirs,
1230 j.properties.Exclude_java_resource_dirs, j.properties.Exclude_java_resources)
1231 …fileArgs, fileDeps := ResourceFilesToJarArgs(ctx, j.properties.Java_resources, j.properties.Exclud…
1232 extraArgs, extraDeps := resourcePathsToJarArgs(j.extraResources), j.extraResources
1249 j.resourceJar = resourceJar
1256 if j.resourceJar != nil {
1257 resourceJars = append(resourceJars, j.resourceJar)
1259 if Bool(j.properties.Include_srcs) {
1268 j.resourceJar = combinedJar
1270 j.resourceJar = resourceJars[0]
1277 manifest := j.overrideManifest
1278 if !manifest.Valid() && j.properties.Manifest != nil {
1279 manifest = android.OptionalPathForPath(android.PathForModuleSrc(ctx, *j.properties.Manifest))
1282 services := android.PathsForModuleSrc(ctx, j.properties.Services)
1344 if j.expandJarjarRules != nil {
1347 TransformJarJar(ctx, jarjarFile, outputFile, j.expandJarjarRules)
1351 if j.resourceJar != nil {
1353 TransformJarJar(ctx, resourceJarJarFile, j.resourceJar, j.expandJarjarRules)
1354 j.resourceJar = resourceJarJarFile
1363 if len(j.properties.Permitted_packages) > 0 {
1382 CheckJarPackages(ctx, pkgckFile, outputFile, j.properties.Permitted_packages)
1389 j.implementationJarFile = outputFile
1390 if j.headerJarFile == nil {
1391 j.headerJarFile = j.implementationJarFile
1394 if j.shouldInstrumentInApex(ctx) {
1395 j.properties.Instrument = true
1399 specs := j.jacocoModuleToZipCommand(ctx)
1404 if j.shouldInstrument(ctx) {
1405 outputFile = j.instrument(ctx, flags, outputFile, jarName, specs)
1410 if j.resourceJar != nil {
1411 jars := android.Paths{j.resourceJar, implementationAndResourcesJar}
1418 j.implementationAndResourcesJar = implementationAndResourcesJar
1422 if j.DirectlyInAnyApex() && !apexInfo.IsForPlatform() {
1423 if j.dexProperties.Compile_dex == nil {
1424 j.dexProperties.Compile_dex = proptools.BoolPtr(true)
1426 if j.deviceProperties.Hostdex == nil {
1427 j.deviceProperties.Hostdex = proptools.BoolPtr(true)
1431 if ctx.Device() && (Bool(j.properties.Installable) || Bool(j.dexProperties.Compile_dex)) {
1432 if j.hasCode(ctx) {
1433 if j.shouldInstrumentStatic(ctx) {
1434 j.dexer.extraProguardFlagFiles = append(j.dexer.extraProguardFlagFiles,
1439 …dexOutputFile = j.dexer.compileDex(ctx, flags, j.MinSdkVersion(ctx), implementationAndResourcesJar…
1445 if j.resourceJar != nil {
1446 jars := android.Paths{dexOutputFile, j.resourceJar}
1450 if *j.dexProperties.Uncompress_dex {
1461 …j.initHiddenAPI(ctx, makeDexJarPathFromPath(dexOutputFile), j.implementationJarFile, j.dexProperti…
1464 dexOutputFile = j.hiddenAPIEncodeDex(ctx, dexOutputFile)
1466 j.dexJarFile = makeDexJarPathFromPath(dexOutputFile)
1469 j.dexpreopt(ctx, dexOutputFile)
1476 j.dexJarFile = makeDexJarPathFromPath(j.resourceJar)
1495 j.linter.name = ctx.ModuleName()
1496 j.linter.srcs = srcFiles
1497 j.linter.srcJars = srcJars
1498 …j.linter.classpath = append(append(android.Paths(nil), flags.bootClasspath...), flags.classpath...)
1499 j.linter.classes = j.implementationJarFile
1500 j.linter.minSdkVersion = lintSDKVersion(j.MinSdkVersion(ctx))
1501 j.linter.targetSdkVersion = lintSDKVersion(j.TargetSdkVersion(ctx))
1502 j.linter.compileSdkVersion = lintSDKVersion(j.SdkVersion(ctx))
1503 j.linter.compileSdkKind = j.SdkVersion(ctx).Kind
1504 j.linter.javaLanguageLevel = flags.javaVersion.String()
1505 j.linter.kotlinLanguageLevel = "1.3"
1507 j.linter.buildModuleReportZip = true
1509 j.linter.lint(ctx)
1515 HeaderJars: android.PathsIfNonNil(j.headerJarFile),
1516 ImplementationAndResourcesJars: android.PathsIfNonNil(j.implementationAndResourcesJar),
1517 ImplementationJars: android.PathsIfNonNil(j.implementationJarFile),
1518 ResourceJars: android.PathsIfNonNil(j.resourceJar),
1519 AidlIncludeDirs: j.exportAidlIncludeDirs,
1520 SrcJarArgs: j.srcJarArgs,
1521 SrcJarDeps: j.srcJarDeps,
1522 ExportedPlugins: j.exportedPluginJars,
1523 ExportedPluginClasses: j.exportedPluginClasses,
1524 ExportedPluginDisableTurbine: j.exportedDisableTurbine,
1525 JacocoReportClassesFile: j.jacocoReportClassesFile,
1529 j.outputFile = outputFile.WithoutRel()
1532 func (j *Module) useCompose() bool {
1533 return android.InList("androidx.compose.runtime_runtime", j.properties.Static_libs)
1551 func (j *Module) compileJavaClasses(ctx android.ModuleContext, jarName string, idx int,
1566 j.kytheFiles = append(j.kytheFiles, extractionFile)
1597 func (j *Module) compileJavaHeader(ctx android.ModuleContext, srcFiles, srcJars android.Paths,
1626 if j.expandJarjarRules != nil {
1629 TransformJarJar(ctx, jarjarFile, jarjarAndDepsHeaderJar, j.expandJarjarRules)
1639 func (j *Module) instrument(ctx android.ModuleContext, flags javaBuilderFlags,
1647 j.jacocoReportClassesFile = jacocoReportClassesFile
1652 func (j *Module) HeaderJars() android.Paths {
1653 if j.headerJarFile == nil {
1656 return android.Paths{j.headerJarFile}
1659 func (j *Module) ImplementationJars() android.Paths {
1660 if j.implementationJarFile == nil {
1663 return android.Paths{j.implementationJarFile}
1666 func (j *Module) DexJarBuildPath() OptionalDexJarPath {
1667 return j.dexJarFile
1670 func (j *Module) DexJarInstallPath() android.Path {
1671 return j.installFile
1674 func (j *Module) ImplementationAndResourcesJars() android.Paths {
1675 if j.implementationAndResourcesJar == nil {
1678 return android.Paths{j.implementationAndResourcesJar}
1681 func (j *Module) AidlIncludeDirs() android.Paths {
1683 return j.exportAidlIncludeDirs
1686 func (j *Module) ClassLoaderContexts() dexpreopt.ClassLoaderContextMap {
1687 return j.classLoaderContexts
1691 func (j *Module) IDEInfo(dpInfo *android.IdeInfo) {
1692 dpInfo.Deps = append(dpInfo.Deps, j.CompilerDeps()...)
1693 dpInfo.Srcs = append(dpInfo.Srcs, j.expandIDEInfoCompiledSrcs...)
1694 dpInfo.SrcJars = append(dpInfo.SrcJars, j.compiledSrcJars.Strings()...)
1695 …dpInfo.Aidl_include_dirs = append(dpInfo.Aidl_include_dirs, j.deviceProperties.Aidl.Include_dirs..…
1696 if j.expandJarjarRules != nil {
1697 dpInfo.Jarjar_rules = append(dpInfo.Jarjar_rules, j.expandJarjarRules.String())
1699 dpInfo.Paths = append(dpInfo.Paths, j.modulePaths...)
1700 dpInfo.Static_libs = append(dpInfo.Static_libs, j.properties.Static_libs...)
1701 dpInfo.Libs = append(dpInfo.Libs, j.properties.Libs...)
1704 func (j *Module) CompilerDeps() []string {
1706 jdeps = append(jdeps, j.properties.Libs...)
1707 jdeps = append(jdeps, j.properties.Static_libs...)
1711 func (j *Module) hasCode(ctx android.ModuleContext) bool {
1712 srcFiles := android.PathsForModuleSrcExcludes(ctx, j.properties.Srcs, j.properties.Exclude_srcs)
1717 func (j *Module) DepIsInSameApex(ctx android.BaseModuleContext, dep android.Module) bool {
1718 return j.depIsInSameApex(ctx, dep)
1722 func (j *Module) ShouldSupportSdkVersion(ctx android.BaseModuleContext, sdkVersion android.ApiLevel…
1723 sdkSpec := j.MinSdkVersion(ctx)
1736 func (j *Module) Stem() string {
1737 return proptools.StringDefault(j.overridableDeviceProperties.Stem, j.Name())
1740 func (j *Module) JacocoReportClassesFile() android.Path {
1741 return j.jacocoReportClassesFile
1744 func (j *Module) IsInstallable() bool {
1745 return Bool(j.properties.Installable)
1839 func (j *Module) checkSdkLinkType(
1845 myLinkType, stubs := j.getSdkLinkType(ctx, ctx.ModuleName())
1860 func (j *Module) collectDeps(ctx android.ModuleContext) deps {
1864 sdkDep := decodeSdkDep(ctx, android.SdkContext(j))
1878 sdkLinkType, _ := j.getSdkLinkType(ctx, ctx.ModuleName())
1896 depHeaderJars := dep.SdkHeaderJars(ctx, j.SdkVersion(ctx))
1956 j.exportedPluginJars = append(j.exportedPluginJars, dep.ImplementationAndResourcesJars...)
1958 …j.exportedPluginClasses = append(j.exportedPluginClasses, *plugin.pluginProperties.Processor_class)
1963 j.exportedDisableTurbine = Bool(plugin.pluginProperties.Generates_api)
2013 addCLCFromDep(ctx, module, j.classLoaderContexts)
2030 func (j *Module) ProvidesUsesLib() *string {
2031 return j.usesLibraryProperties.Provides_uses_lib
2040 func (j *Module) ConvertWithBp2build(ctx android.TopDownMutatorContext) {