Experimental code to support build action caching.
Bug: 335718784 Test: build locally Change-Id: Icc1f1fb15f9fe305e95dd51e2e7aff1e9cbf340c
This commit is contained in:
@@ -25,6 +25,7 @@ import (
|
||||
type DeclarationsModule struct {
|
||||
android.ModuleBase
|
||||
android.DefaultableModuleBase
|
||||
blueprint.IncrementalModule
|
||||
|
||||
// Properties for "aconfig_declarations"
|
||||
properties struct {
|
||||
@@ -157,3 +158,17 @@ func (module *DeclarationsModule) GenerateAndroidBuildActions(ctx android.Module
|
||||
IntermediateDumpOutputPath: intermediateDumpFilePath,
|
||||
})
|
||||
}
|
||||
|
||||
func (module *DeclarationsModule) BuildActionProviderKeys() []blueprint.AnyProviderKey {
|
||||
return []blueprint.AnyProviderKey{android.AconfigDeclarationsProviderKey}
|
||||
}
|
||||
|
||||
func (module *DeclarationsModule) PackageContextPath() string {
|
||||
return pkgPath
|
||||
}
|
||||
|
||||
func (module *DeclarationsModule) CachedRules() []blueprint.Rule {
|
||||
return []blueprint.Rule{aconfigRule, aconfigTextRule}
|
||||
}
|
||||
|
||||
var _ blueprint.Incremental = &DeclarationsModule{}
|
||||
|
@@ -15,13 +15,16 @@
|
||||
package aconfig
|
||||
|
||||
import (
|
||||
"encoding/gob"
|
||||
|
||||
"android/soong/android"
|
||||
|
||||
"github.com/google/blueprint"
|
||||
)
|
||||
|
||||
var (
|
||||
pctx = android.NewPackageContext("android/soong/aconfig")
|
||||
pkgPath = "android/soong/aconfig"
|
||||
pctx = android.NewPackageContext(pkgPath)
|
||||
|
||||
// For aconfig_declarations: Generate cache file
|
||||
aconfigRule = pctx.AndroidStaticRule("aconfig",
|
||||
@@ -106,6 +109,9 @@ func init() {
|
||||
RegisterBuildComponents(android.InitRegistrationContext)
|
||||
pctx.HostBinToolVariable("aconfig", "aconfig")
|
||||
pctx.HostBinToolVariable("soong_zip", "soong_zip")
|
||||
|
||||
gob.Register(android.AconfigDeclarationsProviderData{})
|
||||
gob.Register(android.ModuleOutPath{})
|
||||
}
|
||||
|
||||
func RegisterBuildComponents(ctx android.RegistrationContext) {
|
||||
|
Reference in New Issue
Block a user