harbor run -t openthoughts/tasktrove-exp-rpt-stack-go-v4-stack-go-6994harbor download openthoughts/tasktrove-exp-rpt-stack-go-v4-stack-go-6994Implement the function GenerateDexpreoptRule(ctx android.PathContext, globalSoong, global *GlobalConfig, module *ModuleConfig) (*Rule, error) in the /app/ directory. This function should generate and return a rule for dex pre-optimization based on the provided module configuration.
Input Parameters:
ctx: An android.PathContext object which provides context for path operations.globalSoong: A configured global Soong object which holds global configuration options.global: A GlobalConfig object that includes relevant settings such as HasSystemOther and PatternsOnSystemOther.module: The ModuleConfig instance that contains properties of the module for which the dex preopt rule is being generated.Rule Generation:
module and global configuration.PatternsOnSystemOther from the global configuration to determine how to install the APKs and additional files.Rule object that includes the install paths formatted as specified in the tests, handling cases for different module types (system, product, apex) according to the provided test cases.Error Handling:
Testing Coverage:
TestDexPreopt, TestDexPreoptSystemOther, TestDexPreoptApexSystemServerJars, and others. The installs generated must match the expected install paths in each test case.Output:
Rule that includes the correct install paths.Please place the implementation in a file named dexpreopt.go under the /app/ directory.
Important: declare your solution in package dexpreopt (the test file uses package dexpreopt, so the implementation must use the matching package name).