summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Android.bp14
-rw-r--r--soong/Android.bp25
-rw-r--r--soong/ca_certificates.go82
-rw-r--r--wfa_certs/Android.bp14
4 files changed, 6 insertions, 129 deletions
diff --git a/Android.bp b/Android.bp
index 9ba26a3..be2f881 100644
--- a/Android.bp
+++ b/Android.bp
@@ -29,16 +29,8 @@ license {
license_text: [],
}
-ca_certificates {
+prebuilt_etc {
name: "cacerts",
- src_dir: "files",
- dest_dir: "security/cacerts",
- module_name_prefix: "target-cacert-",
-}
-
-ca_certificates_host {
- name: "cacerts-host",
- src_dir: "files",
- dest_dir: "security/cacerts",
- module_name_prefix: "host-cacert-",
+ srcs: ["files/*"],
+ sub_dir: "security/cacerts",
}
diff --git a/soong/Android.bp b/soong/Android.bp
deleted file mode 100644
index d79481c..0000000
--- a/soong/Android.bp
+++ /dev/null
@@ -1,25 +0,0 @@
-// *** THIS PACKAGE HAS SPECIAL LICENSING CONDITIONS. PLEASE
-// CONSULT THE OWNERS AND opensource-licensing@google.com BEFORE
-// DEPENDING ON IT IN YOUR PROJECT. ***
-package {
- // See: http://go/android-license-faq
- // A large-scale-change added 'default_applicable_licenses' to import
- // all of the 'license_kinds' from "system_ca-certificates_license"
- // to get the below license kinds:
- // legacy_by_exception_only (by exception only)
- default_applicable_licenses: ["system_ca-certificates_license"],
-}
-
-bootstrap_go_package {
- name: "soong-ca-certificates",
- pkgPath: "android/soong/system/ca-certificates",
- deps: [
- "soong-android",
- "soong-etc",
- "soong-phony",
- ],
- srcs: [
- "ca_certificates.go",
- ],
- pluginFor: ["soong_build"],
-}
diff --git a/soong/ca_certificates.go b/soong/ca_certificates.go
deleted file mode 100644
index 0cddd22..0000000
--- a/soong/ca_certificates.go
+++ /dev/null
@@ -1,82 +0,0 @@
-package ca_certificates
-
-import (
- "path"
- "path/filepath"
-
- "github.com/google/blueprint/proptools"
-
- "android/soong/android"
- "android/soong/etc"
- "android/soong/phony"
-)
-
-func init() {
- android.RegisterModuleType("ca_certificates", caCertificatesFactory)
- android.RegisterModuleType("ca_certificates_host", caCertificatesHostFactory)
-}
-
-type caCertificatesProperties struct {
- Src_dir *string
- Dest_dir *string
- Module_name_prefix *string
-}
-
-func caCertificatesLoadHook(
- ctx android.LoadHookContext, factory android.ModuleFactory, c *caCertificatesProperties) {
- // Find all files in src_dir.
- srcs, err := ctx.GlobWithDeps(path.Join(ctx.ModuleDir(), *c.Src_dir, "*"), nil)
- if err != nil || len(srcs) == 0 {
- ctx.PropertyErrorf("src_dir", "cannot find files to install")
- return
- }
-
- // Scan through the found files to create a prebuilt_etc module for each of them.
- requiredModuleNames := make([]string, len(srcs))
- for i, src := range srcs {
- etcProps := struct {
- Name *string
- Src *string
- Sub_dir *string
- Filename *string
- }{}
- filename := filepath.Base(src)
- moduleName := *c.Module_name_prefix + filename
- etcProps.Name = proptools.StringPtr(moduleName)
- etcProps.Src = proptools.StringPtr(path.Join(*c.Src_dir, filename))
- etcProps.Sub_dir = c.Dest_dir
- etcProps.Filename = proptools.StringPtr(filename)
- ctx.CreateModule(factory, &etcProps)
-
- // Add it to the required module list of the parent phony rule.
- requiredModuleNames[i] = moduleName
- }
-
- phonyProps := struct {
- Required []string
- }{}
- phonyProps.Required = requiredModuleNames
- ctx.AppendProperties(&phonyProps)
-}
-
-func caCertificatesFactory() android.Module {
- p := phony.PhonyFactory()
- c := &caCertificatesProperties{}
- android.AddLoadHook(p, func(ctx android.LoadHookContext) {
- caCertificatesLoadHook(ctx, etc.PrebuiltEtcFactory, c)
- })
- p.AddProperties(c)
-
- return p
-}
-
-func caCertificatesHostFactory() android.Module {
- p := phony.PhonyFactory()
- c := &caCertificatesProperties{}
- android.AddLoadHook(p, func(ctx android.LoadHookContext) {
- caCertificatesLoadHook(ctx, etc.PrebuiltEtcHostFactory, c)
- })
- p.AddProperties(c)
-
- return p
-}
diff --git a/wfa_certs/Android.bp b/wfa_certs/Android.bp
index 4d2134c..91dde7f 100644
--- a/wfa_certs/Android.bp
+++ b/wfa_certs/Android.bp
@@ -25,16 +25,8 @@ package {
default_applicable_licenses: ["system_ca-certificates_license"],
}
-ca_certificates {
+prebuilt_etc {
name: "cacerts_wfa",
- src_dir: "files",
- dest_dir: "security/cacerts_wfa",
- module_name_prefix: "target-cacert-wifi-",
-}
-
-ca_certificates_host {
- name: "cacerts_wfa-host",
- src_dir: "files",
- dest_dir: "security/cacerts_wfa",
- module_name_prefix: "host-cacert-wifi-",
+ srcs: ["files/*"],
+ sub_dir: "security/cacerts_wfa",
}