Separate dist processing from make specific output
Previously, the GetDistForGoals(Module) func combined the processing of the dist properties with generating the make specific rules for generating that dist. That has a couple of problems: 1. It combines two pieces of functionality into one method which is bad practice. 2. It makes it hard to test because the make specific output ends up containing absolute paths to temporary directories created by the test. 3. It makes switching to a non-make output difficult and fragile as changing the output will also require changing the tests. This change adds an intermediate data structure to contain the result of the dist processing. That processing is done by the new method getDistContributions(Module) which returns the new intermediate structure. It also adds generateDistContributionsForMake(..) to generate the make output. The GetDistForGoals(Module) func uses them to implement the previous behavior. It adds identical tests to those in TestGetDistForGoals() but leaves those tests alone to show that this refactoring does not change the behavior. Follow up changes will clean up TestGetDistForGoals(). It also adds a test for generateDistContributionsForMake(..). Bug: 174226317 Test: m nothing m dist sdk - before and after this change, compare result to make sure that there are no significant differences. Change-Id: I458b7c8e4485bf66d3498f50df85a8d65fc2ee00
Loading
Please register or sign in to comment