Compile standalone system server jars.
This CL updates odrefresh to take an additional environment variable
`STANDALONE_SYSTEMSERVER_JARS` and compile standalone system server jars
accordingly.
Bug: 203198541
Test: atest odsign_e2e_tests
Test: atest art_standalone_odrefresh_tests
Test: atest art_standalone_artd_tests
Test: manual -
1. Patch aosp/1874113, aosp/1876173, aosp/1875774 and aosp/1875775.
2. Build a new system image and flash it to a device.
3. adb logcat odrefresh:D odsign:D "*:S"
4. See standalone system server jars being compiled and signed.
Change-Id: Ic824c7380cf9530437bc2a95b9ff816a63b22013
diff --git a/odrefresh/odrefresh.h b/odrefresh/odrefresh.h
index 17003ee..7969aa4 100644
--- a/odrefresh/odrefresh.h
+++ b/odrefresh/odrefresh.h
@@ -23,6 +23,7 @@
#include <optional>
#include <set>
#include <string>
+#include <unordered_set>
#include <vector>
#include "android-base/result.h"
@@ -69,7 +70,7 @@
// Returns a set of all system server jars.
std::set<std::string> AllSystemServerJars() const {
- return {systemserver_compilable_jars_.begin(), systemserver_compilable_jars_.end()};
+ return {all_systemserver_jars_.begin(), all_systemserver_jars_.end()};
}
private:
@@ -92,7 +93,7 @@
std::vector<com::android::art::Component> GenerateBootExtensionCompilableComponents() const;
- std::vector<com::android::art::Component> GenerateSystemServerComponents() const;
+ std::vector<com::android::art::SystemServerComponent> GenerateSystemServerComponents() const;
std::string GetBootImageExtensionImage(bool on_system) const;
@@ -168,13 +169,18 @@
// List of boot extension components that should be compiled.
std::vector<std::string> boot_extension_compilable_jars_;
- // List of system_server components that should be compiled.
- std::vector<std::string> systemserver_compilable_jars_;
+ // Set of system_server components in SYSTEMSERVERCLASSPATH that should be compiled.
+ std::unordered_set<std::string> systemserver_classpath_jars_;
// List of all boot classpath components. Used as the dependencies for compiling the
// system_server.
std::vector<std::string> boot_classpath_jars_;
+ // List of all system_server components, including those in SYSTEMSERVERCLASSPATH and those in
+ // STANDALONE_SYSTEMSERVER_JARS (jars that system_server loads dynamically using separate
+ // classloaders).
+ std::vector<std::string> all_systemserver_jars_;
+
const time_t start_time_;
std::unique_ptr<ExecUtils> exec_utils_;