Beispiel #1
0
 def _create_artifact_cache(self, spec, action):
   if len(spec) > 0:
     pants_workdir = self.context.config.getdefault('pants_workdir')
     my_name = self.__class__.__name__
     return create_artifact_cache(self.context.log, pants_workdir, spec, my_name, action)
   else:
     return None
Beispiel #2
0
 def _create_artifact_cache(self, spec, action):
   if len(spec) > 0:
     pants_workdir = self.context.config.getdefault('pants_workdir')
     my_name = self.__class__.__name__
     return create_artifact_cache(self.context.log, pants_workdir, spec, my_name, action)
   else:
     return None
Beispiel #3
0
  def setup_artifact_cache(self, spec):
    """Subclasses can call this in their __init__() to set up artifact caching for that task type.

    spec should be a list of urls/file path prefixes, which are used in that order.
    By default, no artifact caching is used.
    """
    if len(spec) > 0:
      pants_workdir = self.context.config.getdefault('pants_workdir')
      self._artifact_cache = create_artifact_cache(self.context, pants_workdir, spec)
Beispiel #4
0
 def create_artifact_cache(self, spec):
   if len(spec) > 0:
     pants_workdir = self.context.config.getdefault('pants_workdir')
     my_name = self.__class__.__name__
     return create_artifact_cache(self.context.log, pants_workdir, spec, my_name,
                                  self.context.options.local_artifact_cache_readonly,
                                  self.context.options.remote_artifact_cache_readonly)
   else:
     return None
Beispiel #5
0
  def setup_artifact_cache(self, spec):
    """Subclasses can call this in their __init__() to set up artifact caching for that task type.

    spec should be a list of urls/file path prefixes, which are used in that order.
    By default, no artifact caching is used.
    """
    if len(spec) > 0:
      pants_workdir = self.context.config.getdefault('pants_workdir')
      my_name = self.__class__.__name__
      self._artifact_cache = create_artifact_cache(self.context.log, pants_workdir, spec, my_name)
 def check(expected_type, spec):
     cache = create_artifact_cache(MockLogger(), artifact_root, spec, "TestTask", "testing")
     self.assertTrue(isinstance(cache, expected_type))
     self.assertEquals(cache.artifact_root, artifact_root)
Beispiel #7
0
 def check(expected_type, spec):
     cache = create_artifact_cache(MockLogger(), artifact_root, spec)
     self.assertTrue(isinstance(cache, expected_type))
     self.assertEquals(cache.artifact_root, artifact_root)