def create_target(self, binary, gentarget):
    spec_path = os.path.join(os.path.relpath(self.aapt_out(binary), get_buildroot()))
    address = Address(spec_path=spec_path, target_name=gentarget.id)
    new_target = self.context.add_new_target(address,
                                             JavaLibrary,
                                             derived_from=gentarget,
                                             sources=[self._relative_genfile(gentarget)],
                                             dependencies=[])
    return new_target
Create a JavaLibrary target for the R.java files created by the aapt tool.
dataset/ETHPy150Open pantsbuild/pants/contrib/android/src/python/pants/contrib/android/tasks/aapt_gen.py/AaptGen.create_target