Prepare for a type-safe OnceKey
Add an opaque OnceKey type and use it for all calls to Once in
build/soong. A future patch will convert the arguments to
Once* to OnceKey once users outside build/soong have been updated.
Test: onceper_test.go
Change-Id: Ifcb338e6e603e804e507203c9508d30ffb2df966
diff --git a/java/sdk_library.go b/java/sdk_library.go
index ca3131c..1b0fe75 100644
--- a/java/sdk_library.go
+++ b/java/sdk_library.go
@@ -627,8 +627,10 @@
}
}
+var javaSdkLibrariesKey = android.NewOnceKey("javaSdkLibraries")
+
func javaSdkLibraries(config android.Config) *[]string {
- return config.Once("javaSdkLibraries", func() interface{} {
+ return config.Once(javaSdkLibrariesKey, func() interface{} {
return &[]string{}
}).(*[]string)
}