Lines Matching +full:- +full:p

7 //     http://www.apache.org/licenses/LICENSE-2.0
44 // the version-specific properties that apply to python modules.
82 // Srcs has to be non-empty.
86 // This is most useful in the arch/multilib variants to remove non-common files
100 // Python2-specific properties, including whether Python2 is supported for this module
101 // and version-specific sources, exclusions and dependencies.
104 // Python3-specific properties, including whether Python3 is supported for this module
105 // and version-specific sources, exclusions and dependencies.
115 // this is set by the python version mutator based on version-specific properties
119 // this is set by the python version mutator based on version-specific properties
168 // Map to ensure sub-part of the AndroidMk for this module is only added once
205 func (p *Module) getSrcsPathMappings() []pathMapping {
206 return p.srcsPathMappings
210 func (p *Module) getDataPathMappings() []pathMapping {
211 return p.dataPathMappings
215 func (p *Module) getSrcsZip() android.Path {
216 return p.srcsZip
223 func (p *Module) init(additionalProps ...interface{}) android.Module {
224 p.AddProperties(&p.properties, &p.protoProperties)
229 if p.bootstrapper != nil {
230 p.AddProperties(p.bootstrapper.bootstrapperProps()...)
233 android.InitAndroidArchModule(p, p.hod, p.multilib)
234 android.InitDefaultableModule(p)
236 return p
239 // Python-specific tag to transfer information on the purpose of a dependency.
247 // Python-specific tag that indicates that installed files of this module should depend on installed
261 pathComponentRegexp = regexp.MustCompile(`^[a-zA-Z_][a-zA-Z0-9_-]*$`)
273 // versionSplitMutator creates version variants for modules and appends the version-specific
279 // collect version specific properties, so that we can merge version-specific properties
312 func (p *Module) HostToolPath() android.OptionalPath {
313 if p.installer == nil {
317 // TODO: This should only be set when building host binaries -- tests built for device would be
319 return android.OptionalPathForPath(p.installer.(*binaryDecorator).path)
323 func (p *Module) OutputFiles(tag string) (android.Paths, error) {
326 if outputFile := p.installSource; outputFile.Valid() {
335 func (p *Module) isEmbeddedLauncherEnabled() bool {
336 return p.installer != nil && Bool(p.properties.Embedded_launcher)
340 for _, p := range paths {
341 if filepath.Ext(p) == ext {
349 func (p *Module) anySrcHasExt(ctx android.BottomUpMutatorContext, ext string) bool {
350 return anyHasExt(p.properties.Srcs, ext)
357 func (p *Module) DepsMutator(ctx android.BottomUpMutatorContext) {
358 android.ProtoDeps(ctx, &p.protoProperties)
361 {"python_version", p.properties.Actual_version},
364 // If sources contain a proto file, add dependency on libprotobuf-python
365 if p.anySrcHasExt(ctx, protoExt) && p.Name() != "libprotobuf-python" {
366 ctx.AddVariationDependencies(versionVariation, pythonLibTag, "libprotobuf-python")
370 …ctx.AddVariationDependencies(versionVariation, pythonLibTag, android.LastUniqueStrings(p.propertie…
376 if p.installer != nil && p.isEmbeddedLauncherEnabled() {
386 // Add launcher-specific dependencies for bionic
391 switch p.properties.Actual_version {
393 stdLib = "py2-stdlib"
395 launcherModule = "py2-launcher"
396 if p.bootstrapper.autorun() {
397 launcherModule = "py2-launcher-autorun"
402 stdLib = "py3-stdlib"
404 launcherModule = "py3-launcher"
405 if p.bootstrapper.autorun() {
406 launcherModule = "py3-launcher-autorun"
414 p.properties.Actual_version, ctx.ModuleName()))
424 ctx.AddVariationDependencies(javaDataVariation, javaDataTag, p.properties.Java_data...)
427 func (p *Module) GenerateAndroidBuildActions(ctx android.ModuleContext) {
428 p.generatePythonBuildActions(ctx)
430 // Only Python binary and test modules have non-empty bootstrapper.
431 if p.bootstrapper != nil {
434 p.collectPathsFromTransitiveDeps(ctx)
438 p.installSource = p.bootstrapper.bootstrap(ctx, p.properties.Actual_version,
439 p.isEmbeddedLauncherEnabled(), p.srcsPathMappings, p.srcsZip, p.depsSrcsZips)
442 // Only Python binary and test modules have non-empty installer.
443 if p.installer != nil {
451 p.installer.setAndroidMkSharedLibs(sharedLibs)
454 if p.installSource.Valid() {
455 p.installer.install(ctx, p.installSource.Path())
461 func (p *Module) generatePythonBuildActions(ctx android.ModuleContext) {
462 …expandedSrcs := android.PathsForModuleSrcExcludes(ctx, p.properties.Srcs, p.properties.Exclude_src…
464 if p.bootstrapper != nil && !p.bootstrapper.autorun() {
472 expandedData := android.PathsForModuleSrc(ctx, p.properties.Data)
480 pkgPath := String(p.properties.Pkg_path)
483 pkgPath = filepath.Clean(String(p.properties.Pkg_path))
488 String(p.properties.Pkg_path))
493 if proptools.BoolDefault(p.properties.Is_internal, false) {
498 p.genModulePathMappings(ctx, pkgPath, expandedSrcs, expandedData)
501 p.srcsZip = p.createSrcsZip(ctx, pkgPath)
520 func (p *Module) genModulePathMappings(ctx android.ModuleContext, pkgPath string,
536 if !checkForDuplicateOutputPath(ctx, destToPySrcs, runfilesPath, s.String(), p.Name(), p.Name()) {
537 p.srcsPathMappings = append(p.srcsPathMappings, pathMapping{dest: runfilesPath, src: s})
547 if !checkForDuplicateOutputPath(ctx, destToPyData, runfilesPath, d.String(), p.Name(), p.Name()) {
548 p.dataPathMappings = append(p.dataPathMappings,
555 func (p *Module) createSrcsZip(ctx android.ModuleContext, pkgPath string) android.Path {
557 pathMappings := append(p.srcsPathMappings, p.dataPathMappings...)
578 protoFlags := android.GetProtoFlags(ctx, &p.protoProperties)
579 protoFlags.OutTypeFlag = "--python_out"
594 parArgs = append(parArgs, `-P `+pkgPath)
598 // specify relative root of file in following -f arguments
599 parArgs = append(parArgs, `-C `+root)
601 parArgs = append(parArgs, `-f `+path.String())
650 func (p *Module) collectPathsFromTransitiveDeps(ctx android.ModuleContext) {
655 for _, path := range p.srcsPathMappings {
658 for _, path := range p.dataPathMappings {
692 p.depsSrcsZips = append(p.depsSrcsZips, dep.getSrcsZip())
716 func (p *Module) InstallInData() bool {