with self.create_jar(target, jar_path) as jarfile:
with self.create_jar_builder(jarfile) as jar_builder:
if target in jar_builder.add_target(target):
self.context.products.get("jars").add(target, self.workdir).append(jar_name)
@contextmanager
def create_jar(self, target, path):
After Change
jar_mapping = self.context.products.get("jars")
for vt in invalidation_check.all_vts:
jar_name = vt.target.name + ".jar"
jar_path = os.path.join(vt.results_dir, jar_name)
def add_jar_to_products():
jar_mapping.add(vt.target, vt.results_dir).append(jar_name)
if vt.valid:
if os.path.exists(jar_path):
add_jar_to_products()
else:
with self.create_jar(vt.target, jar_path) as jarfile:
with self.create_jar_builder(jarfile) as jar_builder:
if vt.target in jar_builder.add_target(vt.target):
add_jar_to_products()
@contextmanager
def create_jar(self, target, path):
existing = self._jars.setdefault(path, target)
if target != existing: