diff options
author | ThiƩbaud Weksteen <tweek@google.com> | 2024-03-18 20:25:33 +1100 |
---|---|---|
committer | ThiƩbaud Weksteen <tweek@google.com> | 2024-03-20 09:16:01 +1100 |
commit | 5df7f21f670c5d2eb9bb23aa8b3c0270f42cc3d1 (patch) | |
tree | 83dbe03cae4150d93d212a7ea3bf33afacdf8a77 | |
parent | 590cf2d8e2b5512c8e59dec552172862d75313ab (diff) | |
download | ca-certificates-5df7f21f670c5d2eb9bb23aa8b3c0270f42cc3d1.tar.gz |
Remove unnecessary Soong module (ca_certificates).
Bug: 328313691
Test: build
Change-Id: I534f7c663378a573ce0093f82ecd1640fb7b98e1
-rw-r--r-- | Android.bp | 14 | ||||
-rw-r--r-- | soong/Android.bp | 25 | ||||
-rw-r--r-- | soong/ca_certificates.go | 82 | ||||
-rw-r--r-- | wfa_certs/Android.bp | 14 |
4 files changed, 6 insertions, 129 deletions
@@ -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", } |