Don't hold on to WritablePath
Since only a single rule can write to a given WritablePath, it is unecessary to hold on to the WritablePath once the rule has been created. Keeping a WritablePath causes complications, as it prevents using the input Path as the output when no modifications to the input file are necessary. The normal pattern should be to create a WritablePath using PathForModuleOut, build the rule that writes to the WritablePath, and then store the WritablePath as a Path for use as an input to any future rules. WithoutRel previously only existed on OutputPath, which required keeping the output path of the module as an OutputPath for as long as possible in order to call WithoutRel on it at the end of the module. Add WithoutRel to Path, make it always return a Path type, and implement it on all the types that implement Path by using a helper in basePath. Replace long-lived WritablePaths with Paths. Test: all soong tests pass Flag: EXEMPT refactor Change-Id: I40f28075ce151e4be80d6cfc7ec173dfa46f9bbf
Loading
Please register or sign in to comment