b2202480258b6f2f5f4e020e86cde975088c7792,src/python/pants/backend/jvm/tasks/jar_create.py,JarCreate,execute,#JarCreate#,70
Before Change
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
return True
def execute(self):
with self.invalidated(self.context.targets(is_jvm_library)) as invalidation_check:
with self.context.new_workunit(name="jar-create", labels=[WorkUnit.MULTITOOL]):
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:
In pattern: SUPERPATTERN
Frequency: 6
Non-data size: 3
Instances Project Name: pantsbuild/pants
Commit Name: b2202480258b6f2f5f4e020e86cde975088c7792
Time: 2015-07-11
Author: codyhgibb@gmail.com
File Name: src/python/pants/backend/jvm/tasks/jar_create.py
Class Name: JarCreate
Method Name: execute
Project Name: home-assistant/home-assistant
Commit Name: 490ef6afad92cc8ade7872b26fb9d33fd2bc25ee
Time: 2017-02-07
Author: kellerza@gmail.com
File Name: tests/components/recorder/test_init.py
Class Name: TestRecorder
Method Name: test_schema_update_calls
Project Name: RasaHQ/rasa
Commit Name: 87826c4ccb971911752adbc4bdac8d3e7c28989e
Time: 2019-01-21
Author: tom@rasa.com
File Name: tests/test_agent.py
Class Name:
Method Name: test_agent_with_model_server
Project Name: dmlc/gluon-cv
Commit Name: 2318052dc79966bf36675606b7d992a347418292
Time: 2019-01-07
Author: cheungchih@gmail.com
File Name: gluoncv/model_zoo/se_resnet.py
Class Name: SE_BasicBlockV2
Method Name: __init__
Project Name: pfnet/optuna
Commit Name: 99d865a01e53aee0dcf9406022fd1de2d0823f45
Time: 2021-01-14
Author: gohome.x105.gn@gmail.com
File Name: optuna/storages/_rdb/storage.py
Class Name: RDBStorage
Method Name: kill_stale_trials
Project Name: osmr/imgclsmob
Commit Name: 553f777ad245ef3caa799151e34e6cc37bbcb11a
Time: 2020-02-18
Author: osemery@gmail.com
File Name: gluon/gluoncv2/models/mobilenetv2.py
Class Name: MobileNetV2
Method Name: __init__