Switch BootJars/UpdatableBootJars to ConfiguredJarList

This change:
* Switches BootJars/UpdatableBootJars fields of config.productVariables
  from []string to ConfiguredJarList.
* Updates BootJars() method to simply concatenate the jars list from
  the BootJars/UpdatableBootJars fields.
* Adds an UnmarshalJSON(..) method to ConfiguredJarList to support
  unmarshalling from a single string array to avoid having to change the
  format of the JSON file from which the configuration is loaded.
* Adds some additional calls to ConfiguredJarList(..) in tests to
  convert from []string to ConfiguredJarList. They pass nil as the
  ctx argument as there is no suitable PathContext which will cause any
  errors to be thrown using panic. That is reasonable for hard coded
  values in tests. A follow up change will clean up the calls to
  ConfiguredJarList(..).

Bug: 171479578
Test: m nothing
Change-Id: I59b94dafb479ccd8f0471ed802be175af57be271
This commit is contained in:
Paul Duffin
2020-10-23 21:14:20 +01:00
parent 0141660c63
commit 69d1fb1e39
4 changed files with 27 additions and 8 deletions

View File

@@ -25,7 +25,7 @@ import (
func testConfigWithBootJars(bp string, bootJars []string) android.Config {
config := testConfig(nil, bp, nil)
config.TestProductVariables.BootJars = bootJars
config.TestProductVariables.BootJars = android.CreateConfiguredJarList(nil, bootJars)
return config
}