diff --git a/android/apex.go b/android/apex.go index 934cf723e..b583be309 100644 --- a/android/apex.go +++ b/android/apex.go @@ -711,8 +711,8 @@ type ApexContents struct { // NewApexContents creates and initializes an ApexContents that is suitable // for use with an apex module. -// * contents is a map from a module name to information about its membership within -// the apex. +// - contents is a map from a module name to information about its membership within +// the apex. func NewApexContents(contents map[string]ApexMembership) *ApexContents { return &ApexContents{ contents: contents, diff --git a/android/arch.go b/android/arch.go index b5bd2f080..a0895edf8 100644 --- a/android/arch.go +++ b/android/arch.go @@ -524,26 +524,29 @@ var DarwinUniversalVariantTag = archDepTag{name: "darwin universal binary"} // archMutator splits a module into a variant for each Target requested by the module. Target selection // for a module is in three levels, OsClass, multilib, and then Target. // OsClass selection is determined by: -// - The HostOrDeviceSupported value passed in to InitAndroidArchModule by the module type factory, which selects -// whether the module type can compile for host, device or both. -// - The host_supported and device_supported properties on the module. +// - The HostOrDeviceSupported value passed in to InitAndroidArchModule by the module type factory, which selects +// whether the module type can compile for host, device or both. +// - The host_supported and device_supported properties on the module. +// // If host is supported for the module, the Host and HostCross OsClasses are selected. If device is supported // for the module, the Device OsClass is selected. // Within each selected OsClass, the multilib selection is determined by: -// - The compile_multilib property if it set (which may be overridden by target.android.compile_multilib or -// target.host.compile_multilib). -// - The default multilib passed to InitAndroidArchModule if compile_multilib was not set. +// - The compile_multilib property if it set (which may be overridden by target.android.compile_multilib or +// target.host.compile_multilib). +// - The default multilib passed to InitAndroidArchModule if compile_multilib was not set. +// // Valid multilib values include: -// "both": compile for all Targets supported by the OsClass (generally x86_64 and x86, or arm64 and arm). -// "first": compile for only a single preferred Target supported by the OsClass. This is generally x86_64 or arm64, -// but may be arm for a 32-bit only build. -// "32": compile for only a single 32-bit Target supported by the OsClass. -// "64": compile for only a single 64-bit Target supported by the OsClass. -// "common": compile a for a single Target that will work on all Targets supported by the OsClass (for example Java). -// "common_first": compile a for a Target that will work on all Targets supported by the OsClass -// (same as "common"), plus a second Target for the preferred Target supported by the OsClass -// (same as "first"). This is used for java_binary that produces a common .jar and a wrapper -// executable script. +// +// "both": compile for all Targets supported by the OsClass (generally x86_64 and x86, or arm64 and arm). +// "first": compile for only a single preferred Target supported by the OsClass. This is generally x86_64 or arm64, +// but may be arm for a 32-bit only build. +// "32": compile for only a single 32-bit Target supported by the OsClass. +// "64": compile for only a single 64-bit Target supported by the OsClass. +// "common": compile a for a single Target that will work on all Targets supported by the OsClass (for example Java). +// "common_first": compile a for a Target that will work on all Targets supported by the OsClass +// (same as "common"), plus a second Target for the preferred Target supported by the OsClass +// (same as "first"). This is used for java_binary that produces a common .jar and a wrapper +// executable script. // // Once the list of Targets is determined, the module is split into a variant for each Target. // @@ -1215,11 +1218,13 @@ func (m *ModuleBase) setOSProperties(ctx BottomUpMutatorContext) { // Returns the struct containing the properties specific to the given // architecture type. These look like this in Blueprint files: -// arch: { -// arm64: { -// key: value, -// }, -// }, +// +// arch: { +// arm64: { +// key: value, +// }, +// }, +// // This struct will also contain sub-structs containing to the architecture/CPU // variants and features that themselves contain properties specific to those. func getArchTypeStruct(ctx ArchVariantContext, archProperties interface{}, archType ArchType) (reflect.Value, bool) { @@ -1231,11 +1236,12 @@ func getArchTypeStruct(ctx ArchVariantContext, archProperties interface{}, archT // Returns the struct containing the properties specific to a given multilib // value. These look like this in the Blueprint file: -// multilib: { -// lib32: { -// key: value, -// }, -// }, +// +// multilib: { +// lib32: { +// key: value, +// }, +// }, func getMultilibStruct(ctx ArchVariantContext, archProperties interface{}, archType ArchType) (reflect.Value, bool) { archPropValues := reflect.ValueOf(archProperties).Elem() multilibProp := archPropValues.FieldByName("Multilib").Elem() @@ -2010,9 +2016,10 @@ type ConfigurationAxisToArchVariantProperties map[bazel.ConfigurationAxis]ArchVa // arch-variant properties correspond to the values of the properties of the 'propertySet' struct // that are specific to that axis/configuration. Each axis is independent, containing // non-overlapping configs that correspond to the various "arch-variant" support, at this time: -// arches (including multilib) -// oses -// arch+os combinations +// +// arches (including multilib) +// oses +// arch+os combinations // // For example, passing a struct { Foo bool, Bar string } will return an interface{} that can be // type asserted back into the same struct, containing the config-specific property value specified @@ -2165,17 +2172,21 @@ func (m *ModuleBase) GetArchVariantProperties(ctx ArchVariantContext, propertySe // Returns a struct matching the propertySet interface, containing properties specific to the targetName // For example, given these arguments: -// propertySet = BaseCompilerProperties -// targetName = "android_arm" +// +// propertySet = BaseCompilerProperties +// targetName = "android_arm" +// // And given this Android.bp fragment: -// target: -// android_arm: { -// srcs: ["foo.c"], -// } -// android_arm64: { -// srcs: ["bar.c"], -// } -// } +// +// target: +// android_arm: { +// srcs: ["foo.c"], +// } +// android_arm64: { +// srcs: ["bar.c"], +// } +// } +// // This would return a BaseCompilerProperties with BaseCompilerProperties.Srcs = ["foo.c"] func getTargetStructs(ctx ArchVariantContext, archProperties []interface{}, targetName string) []reflect.Value { var propertyStructs []reflect.Value diff --git a/android/bazel_paths.go b/android/bazel_paths.go index c030aa864..bbdae96e7 100644 --- a/android/bazel_paths.go +++ b/android/bazel_paths.go @@ -221,9 +221,13 @@ func directoryHasBlueprint(fs pathtools.FileSystem, prefix string, components [] // Transform a path (if necessary) to acknowledge package boundaries // // e.g. something like -// async_safe/include/async_safe/CHECK.h +// +// async_safe/include/async_safe/CHECK.h +// // might become -// //bionic/libc/async_safe:include/async_safe/CHECK.h +// +// //bionic/libc/async_safe:include/async_safe/CHECK.h +// // if the "async_safe" directory is actually a package and not just a directory. // // In particular, paths that extend into packages are transformed into absolute labels beginning with //. @@ -303,20 +307,21 @@ func RootToModuleRelativePaths(ctx BazelConversionPathContext, paths Paths) []ba // directory and Bazel target labels, excluding those included in the excludes argument (which // should already be expanded to resolve references to Soong-modules). Valid elements of paths // include: -// * filepath, relative to local module directory, resolves as a filepath relative to the local -// source directory -// * glob, relative to the local module directory, resolves as filepath(s), relative to the local -// module directory. Because Soong does not have a concept of crossing package boundaries, the -// glob as computed by Soong may contain paths that cross package-boundaries that would be -// unknowingly omitted if the glob were handled by Bazel. To allow identification and detect -// (within Bazel) use of paths that cross package boundaries, we expand globs within Soong rather -// than converting Soong glob syntax to Bazel glob syntax. **Invalid for excludes.** -// * other modules using the ":name{.tag}" syntax. These modules must implement SourceFileProducer -// or OutputFileProducer. These resolve as a Bazel label for a target. If the Bazel target is in -// the local module directory, it will be returned relative to the current package (e.g. -// ":"). Otherwise, it will be returned as an absolute Bazel label (e.g. -// "//path/to/dir:"). If the reference to another module cannot be resolved,the function -// will panic. +// - filepath, relative to local module directory, resolves as a filepath relative to the local +// source directory +// - glob, relative to the local module directory, resolves as filepath(s), relative to the local +// module directory. Because Soong does not have a concept of crossing package boundaries, the +// glob as computed by Soong may contain paths that cross package-boundaries that would be +// unknowingly omitted if the glob were handled by Bazel. To allow identification and detect +// (within Bazel) use of paths that cross package boundaries, we expand globs within Soong rather +// than converting Soong glob syntax to Bazel glob syntax. **Invalid for excludes.** +// - other modules using the ":name{.tag}" syntax. These modules must implement SourceFileProducer +// or OutputFileProducer. These resolve as a Bazel label for a target. If the Bazel target is in +// the local module directory, it will be returned relative to the current package (e.g. +// ":"). Otherwise, it will be returned as an absolute Bazel label (e.g. +// "//path/to/dir:"). If the reference to another module cannot be resolved,the function +// will panic. +// // Properties passed as the paths or excludes argument must have been annotated with struct tag // `android:"path"` so that dependencies on other modules will have already been handled by the // path_deps mutator. diff --git a/android/bazel_test.go b/android/bazel_test.go index e14649e3f..da4a9156d 100644 --- a/android/bazel_test.go +++ b/android/bazel_test.go @@ -4,7 +4,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/android/config_bp2build.go b/android/config_bp2build.go index 748be62cc..d6b2bcf97 100644 --- a/android/config_bp2build.go +++ b/android/config_bp2build.go @@ -240,10 +240,12 @@ func (m ExportedStringListDictVariables) asBazel(_ Config, _ ExportedStringVaria // ExportedVariableReferenceDictVariables is a mapping from variable names to a // dictionary which references previously defined variables. This is used to // create a Starlark output such as: -// string_var1 = "string1 -// var_ref_dict_var1 = { -// "key1": string_var1 -// } +// +// string_var1 = "string1 +// var_ref_dict_var1 = { +// "key1": string_var1 +// } +// // This type of variable collection must be expanded last so that it recognizes // previously defined variables. type ExportedVariableReferenceDictVariables map[string]map[string]string diff --git a/android/defaults.go b/android/defaults.go index 54f44bcec..03b2efbac 100644 --- a/android/defaults.go +++ b/android/defaults.go @@ -151,12 +151,12 @@ type DefaultsModuleBase struct { // retrieve the values it is necessary to iterate over properties(). E.g. to get // the commonProperties instance that have the real values: // -// d := myModule.(Defaults) -// for _, props := range d.properties() { -// if cp, ok := props.(*commonProperties); ok { -// ... access property values in cp ... -// } -// } +// d := myModule.(Defaults) +// for _, props := range d.properties() { +// if cp, ok := props.(*commonProperties); ok { +// ... access property values in cp ... +// } +// } // // The rationale is that the properties on a defaults module apply to the // defaultable modules using it, not to the defaults module itself. E.g. setting diff --git a/android/fixture.go b/android/fixture.go index 0690a5a6c..f71893571 100644 --- a/android/fixture.go +++ b/android/fixture.go @@ -420,11 +420,13 @@ type FixturePreparer interface { // instances. // // base - a list of already flattened and deduped preparers that will be applied first before -// the list of additional preparers. Any duplicates of these in the additional preparers -// will be ignored. +// +// the list of additional preparers. Any duplicates of these in the additional preparers +// will be ignored. // // preparers - a list of additional unflattened, undeduped preparers that will be applied after the -// base preparers. +// +// base preparers. // // Returns a deduped and flattened list of the preparers starting with the ones in base with any // additional ones from the preparers list added afterwards. @@ -498,10 +500,10 @@ func newSimpleFixturePreparer(preparer func(fixture *fixture)) FixturePreparer { // FixtureErrorHandler determines how to respond to errors reported by the code under test. // // Some possible responses: -// * Fail the test if any errors are reported, see FixtureExpectsNoErrors. -// * Fail the test if at least one error that matches a pattern is not reported see -// FixtureExpectsAtLeastOneErrorMatchingPattern -// * Fail the test if any unexpected errors are reported. +// - Fail the test if any errors are reported, see FixtureExpectsNoErrors. +// - Fail the test if at least one error that matches a pattern is not reported see +// FixtureExpectsAtLeastOneErrorMatchingPattern +// - Fail the test if any unexpected errors are reported. // // Although at the moment all the error handlers are implemented as simply a wrapper around a // function this is defined as an interface to allow future enhancements, e.g. provide different @@ -866,10 +868,12 @@ func (r *TestResult) NormalizePathsForTesting(paths Paths) []string { // that produced this result. // // e.g. assuming that this result was created by running: -// GroupFixturePreparers(preparer1, preparer2, preparer3).RunTest(t) +// +// GroupFixturePreparers(preparer1, preparer2, preparer3).RunTest(t) // // Then this method will be equivalent to running: -// GroupFixturePreparers(preparer1, preparer2, preparer3) +// +// GroupFixturePreparers(preparer1, preparer2, preparer3) // // This is intended for use by tests whose output is Android.bp files to verify that those files // are valid, e.g. tests of the snapshots produced by the sdk module type. diff --git a/android/module.go b/android/module.go index a75a3cc8e..bf62080a3 100644 --- a/android/module.go +++ b/android/module.go @@ -1109,7 +1109,7 @@ func InitAndroidModule(m Module) { // property structs for architecture-specific versions of generic properties tagged with // `android:"arch_variant"`. // -// InitAndroidModule should not be called if InitAndroidArchModule was called. +// InitAndroidModule should not be called if InitAndroidArchModule was called. func InitAndroidArchModule(m Module, hod HostOrDeviceSupported, defaultMultilib Multilib) { InitAndroidModule(m) diff --git a/android/paths.go b/android/paths.go index f8e701822..74d9f13f4 100644 --- a/android/paths.go +++ b/android/paths.go @@ -387,20 +387,21 @@ func ExistentPathsForSources(ctx PathContext, paths []string) Paths { } // PathsForModuleSrc returns a Paths{} containing the resolved references in paths: -// * filepath, relative to local module directory, resolves as a filepath relative to the local -// source directory -// * glob, relative to the local module directory, resolves as filepath(s), relative to the local -// source directory. -// * other modules using the ":name{.tag}" syntax. These modules must implement SourceFileProducer -// or OutputFileProducer. These resolve as a filepath to an output filepath or generated source -// filepath. +// - filepath, relative to local module directory, resolves as a filepath relative to the local +// source directory +// - glob, relative to the local module directory, resolves as filepath(s), relative to the local +// source directory. +// - other modules using the ":name{.tag}" syntax. These modules must implement SourceFileProducer +// or OutputFileProducer. These resolve as a filepath to an output filepath or generated source +// filepath. +// // Properties passed as the paths argument must have been annotated with struct tag // `android:"path"` so that dependencies on SourceFileProducer modules will have already been handled by the // path_deps mutator. // If a requested module is not found as a dependency: -// * if ctx.Config().AllowMissingDependencies() is true, this module to be marked as having +// - if ctx.Config().AllowMissingDependencies() is true, this module to be marked as having // missing dependencies -// * otherwise, a ModuleError is thrown. +// - otherwise, a ModuleError is thrown. func PathsForModuleSrc(ctx ModuleMissingDepsPathContext, paths []string) Paths { return PathsForModuleSrcExcludes(ctx, paths, nil) } @@ -414,21 +415,22 @@ type SourceInput struct { // PathsForModuleSrcExcludes returns a Paths{} containing the resolved references in paths, minus // those listed in excludes. Elements of paths and excludes are resolved as: -// * filepath, relative to local module directory, resolves as a filepath relative to the local -// source directory -// * glob, relative to the local module directory, resolves as filepath(s), relative to the local -// source directory. Not valid in excludes. -// * other modules using the ":name{.tag}" syntax. These modules must implement SourceFileProducer -// or OutputFileProducer. These resolve as a filepath to an output filepath or generated source -// filepath. +// - filepath, relative to local module directory, resolves as a filepath relative to the local +// source directory +// - glob, relative to the local module directory, resolves as filepath(s), relative to the local +// source directory. Not valid in excludes. +// - other modules using the ":name{.tag}" syntax. These modules must implement SourceFileProducer +// or OutputFileProducer. These resolve as a filepath to an output filepath or generated source +// filepath. +// // excluding the items (similarly resolved // Properties passed as the paths argument must have been annotated with struct tag // `android:"path"` so that dependencies on SourceFileProducer modules will have already been handled by the // path_deps mutator. // If a requested module is not found as a dependency: -// * if ctx.Config().AllowMissingDependencies() is true, this module to be marked as having +// - if ctx.Config().AllowMissingDependencies() is true, this module to be marked as having // missing dependencies -// * otherwise, a ModuleError is thrown. +// - otherwise, a ModuleError is thrown. func PathsForModuleSrcExcludes(ctx ModuleMissingDepsPathContext, paths, excludes []string) Paths { return PathsRelativeToModuleSourceDir(SourceInput{ Context: ctx, @@ -548,13 +550,14 @@ func GetModuleFromPathDep(ctx ModuleWithDepsPathContext, moduleName, tag string) // PathsAndMissingDepsForModuleSrcExcludes returns a Paths{} containing the resolved references in // paths, minus those listed in excludes. Elements of paths and excludes are resolved as: -// * filepath, relative to local module directory, resolves as a filepath relative to the local -// source directory -// * glob, relative to the local module directory, resolves as filepath(s), relative to the local -// source directory. Not valid in excludes. -// * other modules using the ":name{.tag}" syntax. These modules must implement SourceFileProducer -// or OutputFileProducer. These resolve as a filepath to an output filepath or generated source -// filepath. +// - filepath, relative to local module directory, resolves as a filepath relative to the local +// source directory +// - glob, relative to the local module directory, resolves as filepath(s), relative to the local +// source directory. Not valid in excludes. +// - other modules using the ":name{.tag}" syntax. These modules must implement SourceFileProducer +// or OutputFileProducer. These resolve as a filepath to an output filepath or generated source +// filepath. +// // and a list of the module names of missing module dependencies are returned as the second return. // Properties passed as the paths argument must have been annotated with struct tag // `android:"path"` so that dependencies on SourceFileProducer modules will have already been handled by the diff --git a/android/register.go b/android/register.go index 4ff8fff97..5832b1bba 100644 --- a/android/register.go +++ b/android/register.go @@ -258,20 +258,20 @@ type RegistrationContext interface { // Used to register build components from an init() method, e.g. // -// init() { -// RegisterBuildComponents(android.InitRegistrationContext) -// } +// init() { +// RegisterBuildComponents(android.InitRegistrationContext) +// } // -// func RegisterBuildComponents(ctx android.RegistrationContext) { -// ctx.RegisterModuleType(...) -// ... -// } +// func RegisterBuildComponents(ctx android.RegistrationContext) { +// ctx.RegisterModuleType(...) +// ... +// } // // Extracting the actual registration into a separate RegisterBuildComponents(ctx) function // allows it to be used to initialize test context, e.g. // -// ctx := android.NewTestContext(config) -// RegisterBuildComponents(ctx) +// ctx := android.NewTestContext(config) +// RegisterBuildComponents(ctx) var InitRegistrationContext RegistrationContext = &initRegistrationContext{ moduleTypes: make(map[string]ModuleFactory), singletonTypes: make(map[string]SingletonFactory), diff --git a/android/rule_builder.go b/android/rule_builder.go index 11da36cc0..155fbdf71 100644 --- a/android/rule_builder.go +++ b/android/rule_builder.go @@ -1031,7 +1031,8 @@ func (c *RuleBuilderCommand) ImplicitTools(paths Paths) *RuleBuilderCommand { // be also added to the dependencies returned by RuleBuilder.Tools. // // It is equivalent to: -// cmd.Tool(ctx.Config().HostToolPath(ctx, tool)) +// +// cmd.Tool(ctx.Config().HostToolPath(ctx, tool)) func (c *RuleBuilderCommand) BuiltTool(tool string) *RuleBuilderCommand { if c.rule.ctx.Config().UseHostMusl() { // If the host is using musl, assume that the tool was built against musl libc and include @@ -1053,7 +1054,8 @@ func (c *RuleBuilderCommand) builtToolWithoutDeps(tool string) *RuleBuilderComma // dependencies returned by RuleBuilder.Tools. // // It is equivalent to: -// cmd.Tool(ctx.Config().PrebuiltBuildTool(ctx, tool)) +// +// cmd.Tool(ctx.Config().PrebuiltBuildTool(ctx, tool)) func (c *RuleBuilderCommand) PrebuiltBuildTool(ctx PathContext, tool string) *RuleBuilderCommand { return c.Tool(ctx.Config().PrebuiltBuildTool(ctx, tool)) } diff --git a/android/sdk.go b/android/sdk.go index a71f7f211..a477cbaaf 100644 --- a/android/sdk.go +++ b/android/sdk.go @@ -430,13 +430,13 @@ func (r *sdkRegistry) uniqueOnceKey() OnceKey { // required for some members but not others. Traits can cause additional information to be output // to the sdk snapshot or replace the default information exported for a member with something else. // e.g. -// * By default cc libraries only export the default image variants to the SDK. However, for some -// members it may be necessary to export specific image variants, e.g. vendor, or recovery. -// * By default cc libraries export all the configured architecture variants except for the native -// bridge architecture variants. However, for some members it may be necessary to export the -// native bridge architecture variants as well. -// * By default cc libraries export the platform variant (i.e. sdk:). However, for some members it -// may be necessary to export the sdk variant (i.e. sdk:sdk). +// - By default cc libraries only export the default image variants to the SDK. However, for some +// members it may be necessary to export specific image variants, e.g. vendor, or recovery. +// - By default cc libraries export all the configured architecture variants except for the native +// bridge architecture variants. However, for some members it may be necessary to export the +// native bridge architecture variants as well. +// - By default cc libraries export the platform variant (i.e. sdk:). However, for some members it +// may be necessary to export the sdk variant (i.e. sdk:sdk). // // A sdk can request a module to provide no traits, one trait or a collection of traits. The exact // behavior of a trait is determined by how SdkMemberType implementations handle the traits. A trait @@ -447,17 +447,17 @@ func (r *sdkRegistry) uniqueOnceKey() OnceKey { // SdkPropertyName(). Each property contains a list of modules that are required to have that trait. // e.g. something like this: // -// sdk { -// name: "sdk", -// ... -// traits: { -// recovery_image: ["module1", "module4", "module5"], -// native_bridge: ["module1", "module2"], -// native_sdk: ["module1", "module3"], -// ... -// }, -// ... -// } +// sdk { +// name: "sdk", +// ... +// traits: { +// recovery_image: ["module1", "module4", "module5"], +// native_bridge: ["module1", "module2"], +// native_sdk: ["module1", "module3"], +// ... +// }, +// ... +// } type SdkMemberTrait interface { // SdkPropertyName returns the name of the traits property on an sdk module. SdkPropertyName() string @@ -639,20 +639,19 @@ func DependencyTagForSdkMemberType(memberType SdkMemberType, export bool) SdkMem // The basic implementation should look something like this, where ModuleType is // the name of the module type being supported. // -// type moduleTypeSdkMemberType struct { -// android.SdkMemberTypeBase -// } +// type moduleTypeSdkMemberType struct { +// android.SdkMemberTypeBase +// } // -// func init() { -// android.RegisterSdkMemberType(&moduleTypeSdkMemberType{ -// SdkMemberTypeBase: android.SdkMemberTypeBase{ -// PropertyName: "module_types", -// }, -// } -// } -// -// ...methods... +// func init() { +// android.RegisterSdkMemberType(&moduleTypeSdkMemberType{ +// SdkMemberTypeBase: android.SdkMemberTypeBase{ +// PropertyName: "module_types", +// }, +// } +// } // +// ...methods... type SdkMemberType interface { // SdkPropertyName returns the name of the member type property on an sdk module. SdkPropertyName() string diff --git a/android/soong_config_modules.go b/android/soong_config_modules.go index bd7364582..b25f24891 100644 --- a/android/soong_config_modules.go +++ b/android/soong_config_modules.go @@ -190,77 +190,78 @@ type soongConfigModuleTypeModule struct { // // Each soong_config_variable supports an additional value `conditions_default`. The properties // specified in `conditions_default` will only be used under the following conditions: -// bool variable: the variable is unspecified or not set to a true value -// value variable: the variable is unspecified -// string variable: the variable is unspecified or the variable is set to a string unused in the -// given module. For example, string variable `test` takes values: "a" and "b", -// if the module contains a property `a` and `conditions_default`, when test=b, -// the properties under `conditions_default` will be used. To specify that no -// properties should be amended for `b`, you can set `b: {},`. +// +// bool variable: the variable is unspecified or not set to a true value +// value variable: the variable is unspecified +// string variable: the variable is unspecified or the variable is set to a string unused in the +// given module. For example, string variable `test` takes values: "a" and "b", +// if the module contains a property `a` and `conditions_default`, when test=b, +// the properties under `conditions_default` will be used. To specify that no +// properties should be amended for `b`, you can set `b: {},`. // // For example, an Android.bp file could have: // -// soong_config_module_type { -// name: "acme_cc_defaults", -// module_type: "cc_defaults", -// config_namespace: "acme", -// variables: ["board"], -// bool_variables: ["feature"], -// value_variables: ["width"], -// properties: ["cflags", "srcs"], -// } +// soong_config_module_type { +// name: "acme_cc_defaults", +// module_type: "cc_defaults", +// config_namespace: "acme", +// variables: ["board"], +// bool_variables: ["feature"], +// value_variables: ["width"], +// properties: ["cflags", "srcs"], +// } // -// soong_config_string_variable { -// name: "board", -// values: ["soc_a", "soc_b"], -// } +// soong_config_string_variable { +// name: "board", +// values: ["soc_a", "soc_b"], +// } // -// acme_cc_defaults { -// name: "acme_defaults", -// cflags: ["-DGENERIC"], -// soong_config_variables: { -// board: { -// soc_a: { -// cflags: ["-DSOC_A"], -// }, -// soc_b: { -// cflags: ["-DSOC_B"], -// }, -// conditions_default: { -// cflags: ["-DSOC_DEFAULT"], -// }, -// }, -// feature: { -// cflags: ["-DFEATURE"], -// conditions_default: { -// cflags: ["-DFEATURE_DEFAULT"], -// }, -// }, -// width: { -// cflags: ["-DWIDTH=%s"], -// conditions_default: { -// cflags: ["-DWIDTH=DEFAULT"], -// }, -// }, -// }, -// } +// acme_cc_defaults { +// name: "acme_defaults", +// cflags: ["-DGENERIC"], +// soong_config_variables: { +// board: { +// soc_a: { +// cflags: ["-DSOC_A"], +// }, +// soc_b: { +// cflags: ["-DSOC_B"], +// }, +// conditions_default: { +// cflags: ["-DSOC_DEFAULT"], +// }, +// }, +// feature: { +// cflags: ["-DFEATURE"], +// conditions_default: { +// cflags: ["-DFEATURE_DEFAULT"], +// }, +// }, +// width: { +// cflags: ["-DWIDTH=%s"], +// conditions_default: { +// cflags: ["-DWIDTH=DEFAULT"], +// }, +// }, +// }, +// } // -// cc_library { -// name: "libacme_foo", -// defaults: ["acme_defaults"], -// srcs: ["*.cpp"], -// } +// cc_library { +// name: "libacme_foo", +// defaults: ["acme_defaults"], +// srcs: ["*.cpp"], +// } // // If an acme BoardConfig.mk file contained: // -// SOONG_CONFIG_NAMESPACES += acme -// SOONG_CONFIG_acme += \ -// board \ -// feature \ +// SOONG_CONFIG_NAMESPACES += acme +// SOONG_CONFIG_acme += \ +// board \ +// feature \ // -// SOONG_CONFIG_acme_board := soc_a -// SOONG_CONFIG_acme_feature := true -// SOONG_CONFIG_acme_width := 200 +// SOONG_CONFIG_acme_board := soc_a +// SOONG_CONFIG_acme_feature := true +// SOONG_CONFIG_acme_width := 200 // // Then libacme_foo would build with cflags "-DGENERIC -DSOC_A -DFEATURE". func SoongConfigModuleTypeFactory() Module { diff --git a/android/soongconfig/modules.go b/android/soongconfig/modules.go index 212b752d6..7d21b75bc 100644 --- a/android/soongconfig/modules.go +++ b/android/soongconfig/modules.go @@ -343,23 +343,26 @@ func (defs Bp2BuildSoongConfigDefinitions) String() string { // // For example, the acme_cc_defaults example above would // produce a reflect.Value whose type is: -// *struct { -// Soong_config_variables struct { -// Board struct { -// Soc_a interface{} -// Soc_b interface{} -// } -// } -// } +// +// *struct { +// Soong_config_variables struct { +// Board struct { +// Soc_a interface{} +// Soc_b interface{} +// } +// } +// } +// // And whose value is: -// &{ -// Soong_config_variables: { -// Board: { -// Soc_a: (*struct{ Cflags []string })(nil), -// Soc_b: (*struct{ Cflags []string })(nil), -// }, -// }, -// } +// +// &{ +// Soong_config_variables: { +// Board: { +// Soc_a: (*struct{ Cflags []string })(nil), +// Soc_b: (*struct{ Cflags []string })(nil), +// }, +// }, +// } func CreateProperties(factory blueprint.ModuleFactory, moduleType *ModuleType) reflect.Value { var fields []reflect.StructField diff --git a/android/testing.go b/android/testing.go index 85bdca475..b4429ca91 100644 --- a/android/testing.go +++ b/android/testing.go @@ -688,17 +688,17 @@ type TestingBuildParams struct { // // The parts of this structure which are changed are: // * BuildParams -// * Args -// * All Path, Paths, WritablePath and WritablePaths fields. +// - Args +// - All Path, Paths, WritablePath and WritablePaths fields. // // * RuleParams -// * Command -// * Depfile -// * Rspfile -// * RspfileContent -// * SymlinkOutputs -// * CommandDeps -// * CommandOrderOnly +// - Command +// - Depfile +// - Rspfile +// - RspfileContent +// - SymlinkOutputs +// - CommandDeps +// - CommandOrderOnly // // See PathRelativeToTop for more details. // diff --git a/android/variable.go b/android/variable.go index 86b8c8fb1..2d7b0bf8e 100644 --- a/android/variable.go +++ b/android/variable.go @@ -702,20 +702,20 @@ func ProductVariableProperties(ctx BazelConversionPathContext) ProductConfigProp // // If the ProductConfigProperties map contains these items, as parsed from the .bp file: // -// library_linking_strategy: { -// prefer_static: { -// static_libs: [ -// "lib_a", -// "lib_b", -// ], -// }, -// conditions_default: { -// shared_libs: [ -// "lib_a", -// "lib_b", -// ], -// }, -// }, +// library_linking_strategy: { +// prefer_static: { +// static_libs: [ +// "lib_a", +// "lib_b", +// ], +// }, +// conditions_default: { +// shared_libs: [ +// "lib_a", +// "lib_b", +// ], +// }, +// }, // // Static_libs {Library_linking_strategy ANDROID prefer_static} [lib_a lib_b] // Shared_libs {Library_linking_strategy ANDROID conditions_default} [lib_a lib_b] @@ -728,13 +728,13 @@ func ProductVariableProperties(ctx BazelConversionPathContext) ProductConfigProp // instead of putting lib_a and lib_b directly into dynamic_deps without a // select: // -// dynamic_deps = select({ -// "//build/bazel/product_variables:android__library_linking_strategy__prefer_static": [], -// "//conditions:default": [ -// "//foo/bar:lib_a", -// "//foo/bar:lib_b", -// ], -// }), +// dynamic_deps = select({ +// "//build/bazel/product_variables:android__library_linking_strategy__prefer_static": [], +// "//conditions:default": [ +// "//foo/bar:lib_a", +// "//foo/bar:lib_b", +// ], +// }), func (props *ProductConfigProperties) zeroValuesForNamespacedVariables() { // A map of product config properties to the zero values of their respective // property value. diff --git a/androidmk/androidmk/androidmk.go b/androidmk/androidmk/androidmk.go index aaafdc758..2e8810fe8 100644 --- a/androidmk/androidmk/androidmk.go +++ b/androidmk/androidmk/androidmk.go @@ -421,9 +421,9 @@ func makeVariableToBlueprint(file *bpFile, val *mkparser.MakeString, // For example, if prefix is "foo" and name is "bar" with a value of "baz", then // the following variable will be generated: // -// foo { -// bar: "baz" -// } +// foo { +// bar: "baz" +// } // // If prefix is the empty string and name is "foo" with a value of "bar", the // following variable will be generated (if it is a property): diff --git a/androidmk/parser/make_strings.go b/androidmk/parser/make_strings.go index 8afbe7edc..be3685916 100644 --- a/androidmk/parser/make_strings.go +++ b/androidmk/parser/make_strings.go @@ -38,10 +38,10 @@ import ( // For example, "$(FOO)/bar/baz" will be represented as the // following lists: // -// { -// Strings: ["", "/bar/baz"], -// Variables: ["FOO"] -// } +// { +// Strings: ["", "/bar/baz"], +// Variables: ["FOO"] +// } type MakeString struct { StringPos Pos Strings []string diff --git a/apex/bp2build.go b/apex/bp2build.go index 221ab132f..d28f5122e 100644 --- a/apex/bp2build.go +++ b/apex/bp2build.go @@ -4,7 +4,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/apex/key.go b/apex/key.go index 9c5bb05e7..d44958928 100644 --- a/apex/key.go +++ b/apex/key.go @@ -105,7 +105,7 @@ func (m *apexKey) GenerateAndroidBuildActions(ctx android.ModuleContext) { m.keyName = pubKeyName } -//////////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////////// // apex_keys_text type apexKeysText struct { output android.OutputPath diff --git a/apex/prebuilt.go b/apex/prebuilt.go index 187e0df09..172a2012d 100644 --- a/apex/prebuilt.go +++ b/apex/prebuilt.go @@ -364,16 +364,16 @@ func (p *prebuiltCommon) DepIsInSameApex(ctx android.BaseModuleContext, dep andr // While it may be possible to provide sufficient information to determine whether two prebuilt_apex // modules were compatible it would be a lot of work and would not provide much benefit for a couple // of reasons: -// * The number of prebuilt_apex modules that will be exporting files for the same module will be -// low as the prebuilt_apex only exports files for the direct dependencies that require it and -// very few modules are direct dependencies of multiple prebuilt_apex modules, e.g. there are a -// few com.android.art* apex files that contain the same contents and could export files for the -// same modules but only one of them needs to do so. Contrast that with source apex modules which -// need apex specific variants for every module that contributes code to the apex, whether direct -// or indirect. -// * The build cost of a prebuilt_apex variant is generally low as at worst it will involve some -// extra copying of files. Contrast that with source apex modules that has to build each variant -// from source. +// - The number of prebuilt_apex modules that will be exporting files for the same module will be +// low as the prebuilt_apex only exports files for the direct dependencies that require it and +// very few modules are direct dependencies of multiple prebuilt_apex modules, e.g. there are a +// few com.android.art* apex files that contain the same contents and could export files for the +// same modules but only one of them needs to do so. Contrast that with source apex modules which +// need apex specific variants for every module that contributes code to the apex, whether direct +// or indirect. +// - The build cost of a prebuilt_apex variant is generally low as at worst it will involve some +// extra copying of files. Contrast that with source apex modules that has to build each variant +// from source. func (p *prebuiltCommon) apexInfoMutator(mctx android.TopDownMutatorContext) { // Collect direct dependencies into contents. @@ -703,28 +703,29 @@ var _ prebuiltApexModuleCreator = (*Prebuilt)(nil) // e.g. make dex implementation jars available for java_import modules listed in exported_java_libs, // it does so as follows: // -// 1. It creates a `deapexer` module that actually extracts the files from the `.apex` file and -// makes them available for use by other modules, at both Soong and ninja levels. +// 1. It creates a `deapexer` module that actually extracts the files from the `.apex` file and +// makes them available for use by other modules, at both Soong and ninja levels. // -// 2. It adds a dependency onto those modules and creates an apex specific variant similar to what -// an `apex` module does. That ensures that code which looks for specific apex variant, e.g. -// dexpreopt, will work the same way from source and prebuilt. +// 2. It adds a dependency onto those modules and creates an apex specific variant similar to what +// an `apex` module does. That ensures that code which looks for specific apex variant, e.g. +// dexpreopt, will work the same way from source and prebuilt. // -// 3. The `deapexer` module adds a dependency from the modules that require the exported files onto -// itself so that they can retrieve the file paths to those files. +// 3. The `deapexer` module adds a dependency from the modules that require the exported files onto +// itself so that they can retrieve the file paths to those files. // // It also creates a child module `selector` that is responsible for selecting the appropriate // input apex for both the prebuilt_apex and the deapexer. That is needed for a couple of reasons: -// 1. To dedup the selection logic so it only runs in one module. -// 2. To allow the deapexer to be wired up to a different source for the input apex, e.g. an -// `apex_set`. // -// prebuilt_apex -// / | \ -// / | \ -// V V V -// selector <--- deapexer <--- exported java lib +// 1. To dedup the selection logic so it only runs in one module. // +// 2. To allow the deapexer to be wired up to a different source for the input apex, e.g. an +// `apex_set`. +// +// prebuilt_apex +// / | \ +// / | \ +// V V V +// selector <--- deapexer <--- exported java lib func (p *Prebuilt) createPrebuiltApexModules(ctx android.TopDownMutatorContext) { baseModuleName := p.BaseModuleName() diff --git a/bazel/aquery.go b/bazel/aquery.go index 418b14321..05f6ed48c 100644 --- a/bazel/aquery.go +++ b/bazel/aquery.go @@ -52,8 +52,9 @@ type KeyValuePair struct { // AqueryDepset is a depset definition from Bazel's aquery response. This is // akin to the `depSetOfFiles` in the response proto, except: -// * direct artifacts are enumerated by full path instead of by ID -// * it has a hash of the depset contents, instead of an int ID (for determinism) +// - direct artifacts are enumerated by full path instead of by ID +// - it has a hash of the depset contents, instead of an int ID (for determinism) +// // A depset is a data structure for efficient transitive handling of artifact // paths. A single depset consists of one or more artifact paths and one or // more "child" depsets. diff --git a/bazel/properties.go b/bazel/properties.go index bffd97bc5..963e27bdd 100644 --- a/bazel/properties.go +++ b/bazel/properties.go @@ -1225,15 +1225,18 @@ func (sla *StringListAttribute) SortedConfigurationAxes() []ConfigurationAxis { // DeduplicateAxesFromBase ensures no duplication of items between the no-configuration value and // configuration-specific values. For example, if we would convert this StringListAttribute as: -// ["a", "b", "c"] + select({ -// "//condition:one": ["a", "d"], -// "//conditions:default": [], -// }) +// +// ["a", "b", "c"] + select({ +// "//condition:one": ["a", "d"], +// "//conditions:default": [], +// }) +// // after this function, we would convert this StringListAttribute as: -// ["a", "b", "c"] + select({ -// "//condition:one": ["d"], -// "//conditions:default": [], -// }) +// +// ["a", "b", "c"] + select({ +// "//condition:one": ["d"], +// "//conditions:default": [], +// }) func (sla *StringListAttribute) DeduplicateAxesFromBase() { base := sla.Value for axis, configToList := range sla.ConfigurableValues { diff --git a/bp2build/cc_prebuilt_library_conversion_test.go b/bp2build/cc_prebuilt_library_conversion_test.go index 74ad0053a..32c3f4d9b 100644 --- a/bp2build/cc_prebuilt_library_conversion_test.go +++ b/bp2build/cc_prebuilt_library_conversion_test.go @@ -4,7 +4,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/bp2build/cc_prebuilt_library_static_test.go b/bp2build/cc_prebuilt_library_static_test.go index 7498e504c..489a53d75 100644 --- a/bp2build/cc_prebuilt_library_static_test.go +++ b/bp2build/cc_prebuilt_library_static_test.go @@ -4,7 +4,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/bpfix/bpfix/bpfix.go b/bpfix/bpfix/bpfix.go index 94b28dc50..ddaa98aa3 100644 --- a/bpfix/bpfix/bpfix.go +++ b/bpfix/bpfix/bpfix.go @@ -553,7 +553,9 @@ func indicateAttributeError(mod *parser.Module, attributeName string, format str // If a variable is LOCAL_MODULE, get its value from the 'name' attribute. // This handles the statement -// LOCAL_SRC_FILES := $(LOCAL_MODULE) +// +// LOCAL_SRC_FILES := $(LOCAL_MODULE) +// // which occurs often. func resolveLocalModule(mod *parser.Module, val parser.Expression) parser.Expression { if varLocalName, ok := val.(*parser.Variable); ok { @@ -567,9 +569,9 @@ func resolveLocalModule(mod *parser.Module, val parser.Expression) parser.Expres } // etcPrebuiltModuleUpdate contains information on updating certain parts of a defined module such as: -// * changing the module type from prebuilt_etc to a different one -// * stripping the prefix of the install path based on the module type -// * appending additional boolean properties to the prebuilt module +// - changing the module type from prebuilt_etc to a different one +// - stripping the prefix of the install path based on the module type +// - appending additional boolean properties to the prebuilt module type etcPrebuiltModuleUpdate struct { // The prefix of the install path defined in local_module_path. The prefix is removed from local_module_path // before setting the 'filename' attribute. diff --git a/cc/afdo.go b/cc/afdo.go index 66e973284..fb66bbe52 100644 --- a/cc/afdo.go +++ b/cc/afdo.go @@ -66,8 +66,9 @@ func (afdo *afdo) AfdoEnabled() bool { } // Get list of profile file names, ordered by level of specialisation. For example: -// 1. libfoo_arm64.afdo -// 2. libfoo.afdo +// 1. libfoo_arm64.afdo +// 2. libfoo.afdo +// // Add more specialisation as needed. func getProfileFiles(ctx android.BaseModuleContext, moduleName string) []string { var files []string diff --git a/cc/fuzz.go b/cc/fuzz.go index dfc718e85..8a8c10723 100644 --- a/cc/fuzz.go +++ b/cc/fuzz.go @@ -152,10 +152,10 @@ func UnstrippedOutputFile(module android.Module) android.Path { // IsValidSharedDependency takes a module and determines if it is a unique shared library // that should be installed in the fuzz target output directories. This function // returns true, unless: -// - The module is not an installable shared library, or -// - The module is a header or stub, or -// - The module is a prebuilt and its source is available, or -// - The module is a versioned member of an SDK snapshot. +// - The module is not an installable shared library, or +// - The module is a header or stub, or +// - The module is a prebuilt and its source is available, or +// - The module is a versioned member of an SDK snapshot. func IsValidSharedDependency(dependency android.Module) bool { // TODO(b/144090547): We should be parsing these modules using // ModuleDependencyTag instead of the current brute-force checking. diff --git a/cc/genrule.go b/cc/genrule.go index 239064f1c..4ef990c35 100644 --- a/cc/genrule.go +++ b/cc/genrule.go @@ -41,13 +41,13 @@ type GenruleExtraProperties struct { // variations. The following environment variables will be set when the command // execute: // -// CC_ARCH the name of the architecture the command is being executed for +// CC_ARCH the name of the architecture the command is being executed for // -// CC_MULTILIB "lib32" if the architecture the command is being executed for is 32-bit, -// "lib64" if it is 64-bit. +// CC_MULTILIB "lib32" if the architecture the command is being executed for is 32-bit, +// "lib64" if it is 64-bit. // -// CC_NATIVE_BRIDGE the name of the subdirectory that native bridge libraries are stored in if -// the architecture has native bridge enabled, empty if it is disabled. +// CC_NATIVE_BRIDGE the name of the subdirectory that native bridge libraries are stored in if +// the architecture has native bridge enabled, empty if it is disabled. func GenRuleFactory() android.Module { module := genrule.NewGenRule() diff --git a/cc/image.go b/cc/image.go index 921b2bb13..e65a9aadb 100644 --- a/cc/image.go +++ b/cc/image.go @@ -4,7 +4,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/cc/ndk_headers.go b/cc/ndk_headers.go index 56fd5fc81..ef38a064a 100644 --- a/cc/ndk_headers.go +++ b/cc/ndk_headers.go @@ -148,12 +148,12 @@ func (m *headerModule) GenerateAndroidBuildActions(ctx android.ModuleContext) { // to the sysroot base + "usr/include" + to directory + directory component. // ndk_headers requires the license file to be specified. Example: // -// Given: -// sysroot base = "ndk/sysroot" -// from = "include/foo" -// to = "bar" -// header = "include/foo/woodly/doodly.h" -// output path = "ndk/sysroot/usr/include/bar/woodly/doodly.h" +// Given: +// sysroot base = "ndk/sysroot" +// from = "include/foo" +// to = "bar" +// header = "include/foo/woodly/doodly.h" +// output path = "ndk/sysroot/usr/include/bar/woodly/doodly.h" func ndkHeadersFactory() android.Module { module := &headerModule{} module.AddProperties(&module.properties) @@ -275,15 +275,17 @@ func versionedNdkHeadersFactory() android.Module { return module } -// preprocessed_ndk_header { -// name: "foo", -// preprocessor: "foo.sh", -// srcs: [...], -// to: "android", -// } +// preprocessed_ndk_header { +// name: "foo", +// preprocessor: "foo.sh", +// srcs: [...], +// to: "android", +// } // // Will invoke the preprocessor as: -// $preprocessor -o $SYSROOT/usr/include/android/needs_preproc.h $src +// +// $preprocessor -o $SYSROOT/usr/include/android/needs_preproc.h $src +// // For each src in srcs. type preprocessedHeadersProperties struct { // The preprocessor to run. Must be a program inside the source directory diff --git a/cc/ndk_library.go b/cc/ndk_library.go index 0879257a5..2bbfc4aee 100644 --- a/cc/ndk_library.go +++ b/cc/ndk_library.go @@ -84,12 +84,11 @@ var ( // // Example: // -// ndk_library { -// name: "libfoo", -// symbol_file: "libfoo.map.txt", -// first_version: "9", -// } -// +// ndk_library { +// name: "libfoo", +// symbol_file: "libfoo.map.txt", +// first_version: "9", +// } type libraryProperties struct { // Relative path to the symbol map. // An example file can be seen here: TODO(danalbert): Make an example. diff --git a/cc/prebuilt.go b/cc/prebuilt.go index 8c404d30f..a2d450332 100644 --- a/cc/prebuilt.go +++ b/cc/prebuilt.go @@ -348,10 +348,10 @@ type bazelPrebuiltLibraryStaticAttributes struct { // TODO(b/228623543): The below is not entirely true until the bug is fixed. For now, both targets are always generated // Implements bp2build for cc_prebuilt_library modules. This will generate: -// * Only a prebuilt_library_static if the shared.enabled property is set to false across all variants. -// * Only a prebuilt_library_shared if the static.enabled property is set to false across all variants -// * Both a prebuilt_library_static and prebuilt_library_shared if the aforementioned properties are not false across -// all variants +// - Only a prebuilt_library_static if the shared.enabled property is set to false across all variants. +// - Only a prebuilt_library_shared if the static.enabled property is set to false across all variants +// - Both a prebuilt_library_static and prebuilt_library_shared if the aforementioned properties are not false across +// all variants // // In all cases, prebuilt_library_static target names will be appended with "_bp2build_cc_library_static". func prebuiltLibraryBp2Build(ctx android.TopDownMutatorContext, module *Module) { diff --git a/cc/snapshot_prebuilt.go b/cc/snapshot_prebuilt.go index 9d40ad058..792ffe364 100644 --- a/cc/snapshot_prebuilt.go +++ b/cc/snapshot_prebuilt.go @@ -4,7 +4,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, @@ -263,12 +263,12 @@ type BaseSnapshotDecoratorProperties struct { // version, snapshot arch, etc. It also adds a special suffix to Soong module name, so it doesn't // collide with source modules. e.g. the following example module, // -// vendor_snapshot_static { -// name: "libbase", -// arch: "arm64", -// version: 30, -// ... -// } +// vendor_snapshot_static { +// name: "libbase", +// arch: "arm64", +// version: 30, +// ... +// } // // will be seen as "libbase.vendor_static.30.arm64" by Soong. type BaseSnapshotDecorator struct { @@ -370,7 +370,6 @@ func vendorSnapshotLoadHook(ctx android.LoadHookContext, p *BaseSnapshotDecorato } } -// // Module definitions for snapshots of libraries (shared, static, header). // // Modules (vendor|recovery)_snapshot_(shared|static|header) are defined here. Shared libraries and @@ -630,7 +629,6 @@ func RecoverySnapshotHeaderFactory() android.Module { var _ snapshotSanitizer = (*snapshotLibraryDecorator)(nil) -// // Module definitions for snapshots of executable binaries. // // Modules (vendor|recovery)_snapshot_binary are defined here. They have their prebuilt executable @@ -728,7 +726,6 @@ func snapshotBinaryFactory(image SnapshotImage, moduleSuffix string) android.Mod return module.Init() } -// // Module definitions for snapshots of object files (*.o). // // Modules (vendor|recovery)_snapshot_object are defined here. They have their prebuilt object diff --git a/cc/snapshot_utils.go b/cc/snapshot_utils.go index de50ef50f..cf4617da3 100644 --- a/cc/snapshot_utils.go +++ b/cc/snapshot_utils.go @@ -4,7 +4,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/cc/vendor_public_library.go b/cc/vendor_public_library.go index 65a2b0c9e..f2c8545bc 100644 --- a/cc/vendor_public_library.go +++ b/cc/vendor_public_library.go @@ -28,17 +28,16 @@ var ( // // Example: // -// vendor_public_library { -// name: "libfoo", -// symbol_file: "libfoo.map.txt", -// export_public_headers: ["libfoo_headers"], -// } -// -// cc_headers { -// name: "libfoo_headers", -// export_include_dirs: ["include"], -// } +// vendor_public_library { +// name: "libfoo", +// symbol_file: "libfoo.map.txt", +// export_public_headers: ["libfoo_headers"], +// } // +// cc_headers { +// name: "libfoo_headers", +// export_include_dirs: ["include"], +// } type vendorPublicLibraryProperties struct { // Relative path to the symbol map. Symbol_file *string diff --git a/cc/vendor_snapshot.go b/cc/vendor_snapshot.go index e7c05aca8..77e6f6ffe 100644 --- a/cc/vendor_snapshot.go +++ b/cc/vendor_snapshot.go @@ -4,7 +4,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/cc/vndk_prebuilt.go b/cc/vndk_prebuilt.go index 31b6d10dd..37819a4be 100644 --- a/cc/vndk_prebuilt.go +++ b/cc/vndk_prebuilt.go @@ -29,26 +29,25 @@ var ( // // Example: // -// vndk_prebuilt_shared { -// name: "libfoo", -// version: "27", -// target_arch: "arm64", -// vendor_available: true, -// product_available: true, -// vndk: { -// enabled: true, -// }, -// export_include_dirs: ["include/external/libfoo/vndk_include"], -// arch: { -// arm64: { -// srcs: ["arm/lib64/libfoo.so"], -// }, -// arm: { -// srcs: ["arm/lib/libfoo.so"], -// }, -// }, -// } -// +// vndk_prebuilt_shared { +// name: "libfoo", +// version: "27", +// target_arch: "arm64", +// vendor_available: true, +// product_available: true, +// vndk: { +// enabled: true, +// }, +// export_include_dirs: ["include/external/libfoo/vndk_include"], +// arch: { +// arm64: { +// srcs: ["arm/lib64/libfoo.so"], +// }, +// arm: { +// srcs: ["arm/lib/libfoo.so"], +// }, +// }, +// } type vndkPrebuiltProperties struct { // VNDK snapshot version. Version *string @@ -250,25 +249,25 @@ func vndkPrebuiltSharedLibrary() *Module { // vndk_prebuilt_shared installs Vendor Native Development kit (VNDK) snapshot // shared libraries for system build. Example: // -// vndk_prebuilt_shared { -// name: "libfoo", -// version: "27", -// target_arch: "arm64", -// vendor_available: true, -// product_available: true, -// vndk: { -// enabled: true, -// }, -// export_include_dirs: ["include/external/libfoo/vndk_include"], -// arch: { -// arm64: { -// srcs: ["arm/lib64/libfoo.so"], -// }, -// arm: { -// srcs: ["arm/lib/libfoo.so"], -// }, -// }, -// } +// vndk_prebuilt_shared { +// name: "libfoo", +// version: "27", +// target_arch: "arm64", +// vendor_available: true, +// product_available: true, +// vndk: { +// enabled: true, +// }, +// export_include_dirs: ["include/external/libfoo/vndk_include"], +// arch: { +// arm64: { +// srcs: ["arm/lib64/libfoo.so"], +// }, +// arm: { +// srcs: ["arm/lib/libfoo.so"], +// }, +// }, +// } func VndkPrebuiltSharedFactory() android.Module { module := vndkPrebuiltSharedLibrary() return module.Init() diff --git a/cmd/sbox/sbox.go b/cmd/sbox/sbox.go index 4f7451d0c..91e3540dd 100644 --- a/cmd/sbox/sbox.go +++ b/cmd/sbox/sbox.go @@ -208,7 +208,6 @@ func run() error { // // returns an exec.Cmd that can be ran from within sbox context if no error, or nil if error. // caller must ensure script is cleaned up if function succeeds. -// func createCommandScript(rawCommand, scriptPath, scriptPathInSandbox string) (*exec.Cmd, error) { err := os.WriteFile(scriptPath, []byte(rawCommand), 0644) if err != nil { diff --git a/dexpreopt/class_loader_context.go b/dexpreopt/class_loader_context.go index 7bc9ab261..afb3de38a 100644 --- a/dexpreopt/class_loader_context.go +++ b/dexpreopt/class_loader_context.go @@ -25,11 +25,11 @@ import ( ) // This comment describes the following: -// 1. the concept of class loader context (CLC) and its relation to classpath -// 2. how PackageManager constructs CLC from shared libraries and their dependencies -// 3. build-time vs. run-time CLC and why this matters for dexpreopt -// 4. manifest fixer: a tool that adds missing tags to the manifests -// 5. build system support for CLC +// 1. the concept of class loader context (CLC) and its relation to classpath +// 2. how PackageManager constructs CLC from shared libraries and their dependencies +// 3. build-time vs. run-time CLC and why this matters for dexpreopt +// 4. manifest fixer: a tool that adds missing tags to the manifests +// 5. build system support for CLC // // 1. Class loader context // ----------------------- @@ -59,15 +59,16 @@ import ( // loaders are not duplicated (at runtime there is a single class loader instance for each library). // // Example: A has tags B, C and D; C has B and D; -// D has E; B and E have no dependencies. The CLC is: -// A -// ├── B -// ├── C -// │ ├── B -// │ └── D -// │ └── E -// └── D -// └── E +// +// D has E; B and E have no dependencies. The CLC is: +// A +// ├── B +// ├── C +// │ ├── B +// │ └── D +// │ └── E +// └── D +// └── E // // CLC defines the lookup order of libraries when resolving Java classes used by the library/app. // The lookup order is important because libraries may contain duplicate classes, and the class is @@ -188,7 +189,6 @@ import ( // rule generation phase. // // ClassLoaderContext is a structure that represents CLC. -// type ClassLoaderContext struct { // The name of the library. Name string @@ -249,7 +249,6 @@ func (c *ClassLoaderContext) excludeLibs(excludedLibs []string) (*ClassLoaderCon // generates a build rule that includes conditional CLC for all versions, extracts the target SDK // version from the manifest, and filters the CLCs based on that version. Exact final CLC that is // passed to dex2oat is unknown to the build system, and gets known only at Ninja stage. -// type ClassLoaderContextMap map[int][]*ClassLoaderContext // Compatibility libraries. Some are optional, and some are required: this is the default that @@ -485,7 +484,6 @@ func (clcMap ClassLoaderContextMap) ExcludeLibs(excludedLibs []string) ClassLoad // constructs class loader context on device. // // TODO(b/132357300): remove "android.hidl.manager" and "android.hidl.base" for non-system apps. -// func fixClassLoaderContext(clcMap ClassLoaderContextMap) { required, optional := clcMap.UsesLibs() usesLibs := append(required, optional...) diff --git a/etc/snapshot_etc.go b/etc/snapshot_etc.go index b54a8a6ec..0d65ab6b6 100644 --- a/etc/snapshot_etc.go +++ b/etc/snapshot_etc.go @@ -4,7 +4,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/finder/finder.go b/finder/finder.go index c5196c8de..054ccd639 100644 --- a/finder/finder.go +++ b/finder/finder.go @@ -736,15 +736,15 @@ func (f *Finder) parseCacheEntry(bytes []byte) ([]dirFullInfo, error) { // because we know this separator won't appear in the json that we're parsing. // // The newline byte can only appear in a UTF-8 stream if the newline character appears, because: -// - The newline character is encoded as "0000 1010" in binary ("0a" in hex) -// - UTF-8 dictates that bytes beginning with a "0" bit are never emitted as part of a multibyte -// character. +// - The newline character is encoded as "0000 1010" in binary ("0a" in hex) +// - UTF-8 dictates that bytes beginning with a "0" bit are never emitted as part of a multibyte +// character. // // We know that the newline character will never appear in our json string, because: -// - If a newline character appears as part of a data string, then json encoding will -// emit two characters instead: '\' and 'n'. -// - The json encoder that we use doesn't emit the optional newlines between any of its -// other outputs. +// - If a newline character appears as part of a data string, then json encoding will +// emit two characters instead: '\' and 'n'. +// - The json encoder that we use doesn't emit the optional newlines between any of its +// other outputs. const lineSeparator = byte('\n') func (f *Finder) readLine(reader *bufio.Reader) ([]byte, error) { diff --git a/genrule/genrule.go b/genrule/genrule.go index b796877ef..6686c8717 100644 --- a/genrule/genrule.go +++ b/genrule/genrule.go @@ -976,9 +976,7 @@ func (m *Module) ConvertWithBp2build(ctx android.TopDownMutatorContext) { var Bool = proptools.Bool var String = proptools.String -// // Defaults -// type Defaults struct { android.ModuleBase android.DefaultsModuleBase diff --git a/java/app_import.go b/java/app_import.go index 4bab14b32..d6dca3836 100644 --- a/java/app_import.go +++ b/java/app_import.go @@ -461,19 +461,19 @@ func createVariantGroupType(variants []string, variantGroupName string) reflect. // android_app_import imports a prebuilt apk with additional processing specified in the module. // DPI-specific apk source files can be specified using dpi_variants. Example: // -// android_app_import { -// name: "example_import", -// apk: "prebuilts/example.apk", -// dpi_variants: { -// mdpi: { -// apk: "prebuilts/example_mdpi.apk", -// }, -// xhdpi: { -// apk: "prebuilts/example_xhdpi.apk", -// }, -// }, -// presigned: true, -// } +// android_app_import { +// name: "example_import", +// apk: "prebuilts/example.apk", +// dpi_variants: { +// mdpi: { +// apk: "prebuilts/example_mdpi.apk", +// }, +// xhdpi: { +// apk: "prebuilts/example_xhdpi.apk", +// }, +// }, +// presigned: true, +// } func AndroidAppImportFactory() android.Module { module := &AndroidAppImport{} module.AddProperties(&module.properties) diff --git a/java/classpath_element.go b/java/classpath_element.go index 753e7f888..496291678 100644 --- a/java/classpath_element.go +++ b/java/classpath_element.go @@ -97,11 +97,11 @@ type ClasspathElementContext interface { // the list with its Contents field. // // Requirements/Assumptions: -// * A fragment can be associated with more than one apex but each apex must only be associated with -// a single fragment from the fragments list. -// * All of a fragment's contents must appear as a contiguous block in the same order in the -// libraries list. -// * Each library must only appear in a single fragment. +// - A fragment can be associated with more than one apex but each apex must only be associated with +// a single fragment from the fragments list. +// - All of a fragment's contents must appear as a contiguous block in the same order in the +// libraries list. +// - Each library must only appear in a single fragment. // // The apex is used to identify which libraries belong to which fragment. First a mapping is created // from apex to fragment. Then the libraries are iterated over and any library in an apex is @@ -109,13 +109,15 @@ type ClasspathElementContext interface { // standalone and have their own element. // // e.g. Given the following input: -// libraries: com.android.art:core-oj, com.android.art:core-libart, framework, ext -// fragments: com.android.art:art-bootclasspath-fragment +// +// libraries: com.android.art:core-oj, com.android.art:core-libart, framework, ext +// fragments: com.android.art:art-bootclasspath-fragment // // Then this will return: -// ClasspathFragmentElement(art-bootclasspath-fragment, [core-oj, core-libart]), -// ClasspathLibraryElement(framework), -// ClasspathLibraryElement(ext), +// +// ClasspathFragmentElement(art-bootclasspath-fragment, [core-oj, core-libart]), +// ClasspathLibraryElement(framework), +// ClasspathLibraryElement(ext), func CreateClasspathElements(ctx ClasspathElementContext, libraries []android.Module, fragments []android.Module) ClasspathElements { // Create a map from apex name to the fragment module. This makes it easy to find the fragment // associated with a particular apex. diff --git a/java/dexpreopt_bootjars.go b/java/dexpreopt_bootjars.go index b4cd07a78..4e416fc82 100644 --- a/java/dexpreopt_bootjars.go +++ b/java/dexpreopt_bootjars.go @@ -418,7 +418,6 @@ func (image *bootImageConfig) shouldInstallInApex() bool { // // The location is passed as an argument to the ART tools like dex2oat instead of the real path. // ART tools will then reconstruct the architecture-specific real path. -// func (image *bootImageVariant) imageLocations() (imageLocationsOnHost []string, imageLocationsOnDevice []string) { if image.extends != nil { imageLocationsOnHost, imageLocationsOnDevice = image.extends.getVariant(image.target).imageLocations() diff --git a/java/droiddoc.go b/java/droiddoc.go index 96639220a..901419cba 100644 --- a/java/droiddoc.go +++ b/java/droiddoc.go @@ -158,9 +158,7 @@ type DroiddocProperties struct { Compat_config *string `android:"path"` } -// // Common flags passed down to build rule -// type droiddocBuilderFlags struct { bootClasspathArgs string classpathArgs string @@ -193,9 +191,7 @@ func apiCheckEnabled(ctx android.ModuleContext, apiToCheck ApiToCheck, apiVersio return false } -// // Javadoc -// type Javadoc struct { android.ModuleBase android.DefaultableModuleBase @@ -548,9 +544,7 @@ func (j *Javadoc) GenerateAndroidBuildActions(ctx android.ModuleContext) { rule.Build("javadoc", "javadoc") } -// // Droiddoc -// type Droiddoc struct { Javadoc @@ -827,9 +821,7 @@ func (d *Droiddoc) GenerateAndroidBuildActions(ctx android.ModuleContext) { rule.Build("javadoc", desc) } -// // Exported Droiddoc Directory -// var droiddocTemplateTag = dependencyTag{name: "droiddoc-template"} type ExportedDroiddocDirProperties struct { @@ -862,9 +854,7 @@ func (d *ExportedDroiddocDir) GenerateAndroidBuildActions(ctx android.ModuleCont d.deps = android.PathsForModuleSrc(ctx, []string{filepath.Join(path, "**/*")}) } -// // Defaults -// type DocDefaults struct { android.ModuleBase android.DefaultsModuleBase diff --git a/java/droidstubs.go b/java/droidstubs.go index 115388be5..8baf4d357 100644 --- a/java/droidstubs.go +++ b/java/droidstubs.go @@ -42,9 +42,7 @@ func RegisterStubsBuildComponents(ctx android.RegistrationContext) { ctx.RegisterModuleType("prebuilt_stubs_sources", PrebuiltStubsSourcesFactory) } -// // Droidstubs -// type Droidstubs struct { Javadoc android.SdkBase diff --git a/java/genrule.go b/java/genrule.go index 5047c412f..208e1f43b 100644 --- a/java/genrule.go +++ b/java/genrule.go @@ -43,23 +43,23 @@ func RegisterGenRuleBuildComponents(ctx android.RegistrationContext) { // // Use a java_genrule to package generated java resources: // -// java_genrule { -// name: "generated_resources", -// tools: [ -// "generator", -// "soong_zip", -// ], -// srcs: ["generator_inputs/**/*"], -// out: ["generated_android_icu4j_resources.jar"], -// cmd: "$(location generator) $(in) -o $(genDir) " + -// "&& $(location soong_zip) -o $(out) -C $(genDir)/res -D $(genDir)/res", -// } +// java_genrule { +// name: "generated_resources", +// tools: [ +// "generator", +// "soong_zip", +// ], +// srcs: ["generator_inputs/**/*"], +// out: ["generated_android_icu4j_resources.jar"], +// cmd: "$(location generator) $(in) -o $(genDir) " + +// "&& $(location soong_zip) -o $(out) -C $(genDir)/res -D $(genDir)/res", +// } // -// java_library { -// name: "lib_with_generated_resources", -// srcs: ["src/**/*.java"], -// static_libs: ["generated_resources"], -// } +// java_library { +// name: "lib_with_generated_resources", +// srcs: ["src/**/*.java"], +// static_libs: ["generated_resources"], +// } func GenRuleFactory() android.Module { module := genrule.NewGenRule() diff --git a/java/platform_compat_config.go b/java/platform_compat_config.go index 1c4249507..655021fc4 100644 --- a/java/platform_compat_config.go +++ b/java/platform_compat_config.go @@ -280,7 +280,7 @@ func platformCompatConfigSingletonFactory() android.Singleton { return &platformCompatConfigSingleton{} } -//============== merged_compat_config ================= +// ============== merged_compat_config ================= type globalCompatConfigProperties struct { // name of the file into which the metadata will be copied. Filename *string diff --git a/java/sdk_library.go b/java/sdk_library.go index 490c03132..8f499b101 100644 --- a/java/sdk_library.go +++ b/java/sdk_library.go @@ -2129,11 +2129,12 @@ var _ SdkLibraryDependency = (*SdkLibraryImport)(nil) // The type of a structure that contains a field of type sdkLibraryScopeProperties // for each apiscope in allApiScopes, e.g. something like: -// struct { -// Public sdkLibraryScopeProperties -// System sdkLibraryScopeProperties -// ... -// } +// +// struct { +// Public sdkLibraryScopeProperties +// System sdkLibraryScopeProperties +// ... +// } var allScopeStructType = createAllScopePropertiesStructType() // Dynamically create a structure type for each apiscope in allApiScopes. @@ -2556,9 +2557,7 @@ func (module *SdkLibraryImport) RequiredFilesFromPrebuiltApex(ctx android.BaseMo return requiredFilesFromPrebuiltApexForImport(name) } -// // java_sdk_library_xml -// type sdkLibraryXml struct { android.ModuleBase android.DefaultableModuleBase diff --git a/java/sdk_library_external.go b/java/sdk_library_external.go index 0acaa13b2..4f8398194 100644 --- a/java/sdk_library_external.go +++ b/java/sdk_library_external.go @@ -49,9 +49,10 @@ func (g partitionGroup) String() string { // Get partition group of java module that can be used at inter-partition dependency check. // We currently have three groups -// (system, system_ext) => system partition group -// (vendor, odm) => vendor partition group -// (product) => product partition group +// +// (system, system_ext) => system partition group +// (vendor, odm) => vendor partition group +// (product) => product partition group func (j *Module) partitionGroup(ctx android.EarlyModuleContext) partitionGroup { // system and system_ext partition can be treated as the same in terms of inter-partition dependency. if j.Platform() || j.SystemExtSpecific() { diff --git a/mk2rbc/mk2rbc.go b/mk2rbc/mk2rbc.go index 2707f0c5e..aa48e6377 100644 --- a/mk2rbc/mk2rbc.go +++ b/mk2rbc/mk2rbc.go @@ -14,13 +14,13 @@ // Convert makefile containing device configuration to Starlark file // The conversion can handle the following constructs in a makefile: -// * comments -// * simple variable assignments -// * $(call init-product,) -// * $(call inherit-product-if-exists -// * if directives -// All other constructs are carried over to the output starlark file as comments. +// - comments +// - simple variable assignments +// - $(call init-product,) +// - $(call inherit-product-if-exists +// - if directives // +// All other constructs are carried over to the output starlark file as comments. package mk2rbc import ( diff --git a/mk2rbc/soong_variables.go b/mk2rbc/soong_variables.go index de4692528..a52ec4f2a 100644 --- a/mk2rbc/soong_variables.go +++ b/mk2rbc/soong_variables.go @@ -32,8 +32,8 @@ type context struct { // Scans the makefile Soong uses to generate soong.variables file, // collecting variable names and types from the lines that look like this: -// $(call add_json_XXX, <...>, $(VAR)) // +// $(call add_json_XXX, <...>, $(VAR)) func FindSoongVariables(mkFile string, includeFileScope mkparser.Scope, registrar variableRegistrar) error { ctx := context{includeFileScope, registrar} return ctx.doFind(mkFile) diff --git a/python/python.go b/python/python.go index eb0d3cad0..836416947 100644 --- a/python/python.go +++ b/python/python.go @@ -438,9 +438,9 @@ func (p *Module) anySrcHasExt(ctx android.BottomUpMutatorContext, ext string) bo } // DepsMutator mutates dependencies for this module: -// * handles proto dependencies, -// * if required, specifies launcher and adds launcher dependencies, -// * applies python version mutations to Python dependencies +// - handles proto dependencies, +// - if required, specifies launcher and adds launcher dependencies, +// - applies python version mutations to Python dependencies func (p *Module) DepsMutator(ctx android.BottomUpMutatorContext) { android.ProtoDeps(ctx, &p.protoProperties) diff --git a/scripts/build_broken_logs.go b/scripts/build_broken_logs.go index 82ba7491e..bb4b9fdd9 100644 --- a/scripts/build_broken_logs.go +++ b/scripts/build_broken_logs.go @@ -19,12 +19,12 @@ // To use, download the logs.zip from one or more branches, and extract them // into subdirectories of the current directory. So for example, I have: // -// ./aosp-master/aosp_arm/std_full.log -// ./aosp-master/aosp_arm64/std_full.log -// ./aosp-master/... -// ./internal-master/aosp_arm/std_full.log -// ./internal-master/aosp_arm64/std_full.log -// ./internal-master/... +// ./aosp-master/aosp_arm/std_full.log +// ./aosp-master/aosp_arm64/std_full.log +// ./aosp-master/... +// ./internal-master/aosp_arm/std_full.log +// ./internal-master/aosp_arm64/std_full.log +// ./internal-master/... // // Then I use `go run path/to/build_broken_logs.go *` package main diff --git a/sdk/build_release.go b/sdk/build_release.go index 0494a28ee..20b33d6aa 100644 --- a/sdk/build_release.go +++ b/sdk/build_release.go @@ -369,7 +369,9 @@ func newPropertyPrunerForStructType(structType reflect.Type, selector fieldSelec // structure which are not supported by the specified target build release. // // A property is pruned if its field has a tag of the form: -// `supported_build_releases:""` +// +// `supported_build_releases:""` +// // and the resulting build release set does not contain the target build release. Properties that // have no such tag are assumed to be supported by all releases. func newPropertyPrunerByBuildRelease(propertiesStruct interface{}, targetBuildRelease *buildRelease) *propertyPruner { diff --git a/sdk/member_trait.go b/sdk/member_trait.go index 4229ca82b..0843306a8 100644 --- a/sdk/member_trait.go +++ b/sdk/member_trait.go @@ -68,7 +68,6 @@ func getDynamicSdkMemberTraits(key android.OnceKey, registeredTraits []android.S // A list of sdkMemberTraitListProperty instances is created, one per member trait that provides: // * a reference to the member trait. // * a getter for the corresponding field in the properties struct. -// func createDynamicSdkMemberTraits(sdkMemberTraits []android.SdkMemberTrait) *dynamicSdkMemberTraits { var listProperties []*sdkMemberTraitListProperty diff --git a/sdk/member_type.go b/sdk/member_type.go index 10669fe23..98f59820b 100644 --- a/sdk/member_type.go +++ b/sdk/member_type.go @@ -80,7 +80,6 @@ func getDynamicSdkMemberTypes(key android.OnceKey, registeredTypes []android.Sdk // * a reference to the member type. // * a getter for the corresponding field in the properties struct. // * a dependency tag that identifies the member type of a resolved dependency. -// func createDynamicSdkMemberTypes(sdkMemberTypes []android.SdkMemberType) *dynamicSdkMemberTypes { var listProperties []*sdkMemberTypeListProperty diff --git a/shared/env.go b/shared/env.go index 152729ba0..b7d3bafb4 100644 --- a/shared/env.go +++ b/shared/env.go @@ -32,10 +32,11 @@ type envFileData []envFileEntry // // e.g. OUT_DIR = "out" // is converted to: -// { -// "Key": "OUT_DIR", -// "Value": "out", -// }, +// +// { +// "Key": "OUT_DIR", +// "Value": "out", +// }, func EnvFileContents(envDeps map[string]string) ([]byte, error) { contents := make(envFileData, 0, len(envDeps)) for key, value := range envDeps { diff --git a/snapshot/recovery_snapshot.go b/snapshot/recovery_snapshot.go index f1e31ca03..ac002be9c 100644 --- a/snapshot/recovery_snapshot.go +++ b/snapshot/recovery_snapshot.go @@ -4,7 +4,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/snapshot/snapshot.go b/snapshot/snapshot.go index 294f8b611..206ecc947 100644 --- a/snapshot/snapshot.go +++ b/snapshot/snapshot.go @@ -4,7 +4,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/snapshot/snapshot_base.go b/snapshot/snapshot_base.go index 4a14f2e03..8e5dfe4a2 100644 --- a/snapshot/snapshot_base.go +++ b/snapshot/snapshot_base.go @@ -4,7 +4,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/snapshot/util.go b/snapshot/util.go index f44705227..806ac90fa 100644 --- a/snapshot/util.go +++ b/snapshot/util.go @@ -4,7 +4,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/snapshot/vendor_snapshot.go b/snapshot/vendor_snapshot.go index 9bd26c201..8f7b8c215 100644 --- a/snapshot/vendor_snapshot.go +++ b/snapshot/vendor_snapshot.go @@ -4,7 +4,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/third_party/zip/reader_test.go b/third_party/zip/reader_test.go index 11c6d6e66..5f97f5c5f 100644 --- a/third_party/zip/reader_test.go +++ b/third_party/zip/reader_test.go @@ -615,7 +615,6 @@ func returnRecursiveZip() (r io.ReaderAt, size int64) { // // It's here in hex for the same reason as rZipBytes above: to avoid // problems with on-disk virus scanners or other zip processors. -// func biggestZipBytes() []byte { s := ` 0000000 50 4b 03 04 14 00 08 00 08 00 00 00 00 00 00 00 diff --git a/ui/signal/signal.go b/ui/signal/signal.go index 4929a7bfe..552545d8b 100644 --- a/ui/signal/signal.go +++ b/ui/signal/signal.go @@ -31,13 +31,12 @@ import ( // same time we do. Most of the time this means we just need to ignore the signal and we'll // just see errors from all of our subprocesses. But in case that fails, when we get a signal: // -// 1. Wait two seconds to exit normally. -// 2. Call cancel() which is normally the cancellation of a Context. This will send a SIGKILL -// to any subprocesses attached to that context. -// 3. Wait two seconds to exit normally. -// 4. Call cleanup() to close the log/trace buffers, then panic. -// 5. If another two seconds passes (if cleanup got stuck, etc), then panic. -// +// 1. Wait two seconds to exit normally. +// 2. Call cancel() which is normally the cancellation of a Context. This will send a SIGKILL +// to any subprocesses attached to that context. +// 3. Wait two seconds to exit normally. +// 4. Call cleanup() to close the log/trace buffers, then panic. +// 5. If another two seconds passes (if cleanup got stuck, etc), then panic. func SetupSignals(log logger.Logger, cancel, cleanup func()) { signals := make(chan os.Signal, 5) signal.Notify(signals, os.Interrupt, syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM)