diff options
author | 2020-11-26 14:33:21 +0000 | |
---|---|---|
committer | 2020-11-27 15:17:38 +0000 | |
commit | 8b0349c652aa4a86602b11af00f987300536b8a2 (patch) | |
tree | 54df899920212c3bf15b4515c0c5b6c5b3d933d8 /android/module_test.go | |
parent | 3e9614198ab7f9b0c4da05b0bf07605e06f6cc40 (diff) |
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
Diffstat (limited to 'android/module_test.go')
0 files changed, 0 insertions, 0 deletions