use init functions to register module types, etc.

Instead of putting all the blueprint registrations in soong_build,
put them all in init() functions.  This puts the registration next
to the implementation.

Change-Id: Ide1a749518f5e9d1367a18ab3bb1d91da3310c76
This commit is contained in:
Colin Cross
2015-06-17 14:20:06 -07:00
parent 3fde0c220a
commit 463a90e587
10 changed files with 205 additions and 74 deletions

View File

@@ -26,10 +26,24 @@ import (
"github.com/google/blueprint"
"github.com/google/blueprint/pathtools"
"android/soong"
"android/soong/common"
"android/soong/genrule"
)
func init() {
soong.RegisterModuleType("java_library", JavaLibraryFactory)
soong.RegisterModuleType("java_library_static", JavaLibraryFactory)
soong.RegisterModuleType("java_library_host", JavaLibraryHostFactory)
soong.RegisterModuleType("java_binary", JavaBinaryFactory)
soong.RegisterModuleType("java_binary_host", JavaBinaryHostFactory)
soong.RegisterModuleType("prebuilt_java_library", JavaPrebuiltFactory)
soong.RegisterModuleType("prebuilt_sdk", SdkPrebuiltFactory)
soong.RegisterModuleType("android_app", AndroidAppFactory)
soong.RegisterSingletonType("logtags", LogtagsSingleton)
}
// TODO:
// Autogenerated files:
// Proto