예제 #1
0
 def setUpClass(self):
   super(TestPythonThriftBuilder, self).setUpClass()
   SourceRoot.register(os.path.realpath(os.path.join(self.build_root, 'test_thrift_replacement')),
                       PythonThriftLibrary)
   self.create_target('test_thrift_replacement', dedent('''
     python_thrift_library(name='one',
       sources=['thrift/keyword.thrift'],
       dependencies=None
     )
   '''))
예제 #2
0
 def setUpClass(self):
     super(TestPythonThriftBuilder, self).setUpClass()
     SourceRoot.register(
         os.path.realpath(
             os.path.join(self.build_root, 'test_thrift_replacement')),
         PythonThriftLibrary)
     self.create_target(
         'test_thrift_replacement',
         dedent('''
   python_thrift_library(name='one',
     sources=['thrift/keyword.thrift'],
     dependencies=None
   )
 '''))
예제 #3
0
  def setUpClass(cls):
    super(JarCreateExecuteTest, cls).setUpClass()

    def get_source_root_fs_path(path):
        return os.path.realpath(os.path.join(cls.build_root, path))

    SourceRoot.register(get_source_root_fs_path('src/resources'), Resources)
    SourceRoot.register(get_source_root_fs_path('src/java'), JavaLibrary)
    SourceRoot.register(get_source_root_fs_path('src/scala'), ScalaLibrary)
    SourceRoot.register(get_source_root_fs_path('src/thrift'), JavaThriftLibrary)

    cls.res = cls.resources('src/resources/com/twitter', 'spam', 'r.txt')
    cls.jl = cls.java_library('src/java/com/twitter', 'foo', ['a.java'],
                              resources='src/resources/com/twitter:spam')
    cls.sl = cls.scala_library('src/scala/com/twitter', 'bar', ['c.scala'])
    cls.jtl = cls.java_thrift_library('src/thrift/com/twitter', 'baz', 'd.thrift')
예제 #4
0
 def __init__(self, basedir, *allowed_target_types):
     SourceRoot.register(
         os.path.join(buildfile_dir, basedir),
         *allowed_target_types)
예제 #5
0
 def here(*allowed_target_types):
     """Registers the cwd as a source root for the given target types."""
     SourceRoot.register(buildfile_dir,
                         *allowed_target_types)
예제 #6
0
 def _create_new_target(self, target_base, target_type, *args, **kwargs):
   if not os.path.exists(target_base):
     os.makedirs(target_base)
   SourceRoot.register(target_base, target_type)
   with ParseContext.temp(target_base):
     return target_type(*args, **kwargs)
예제 #7
0
 def setUpClass(cls):
   super(TargetsHelpTest, cls).setUpClass()
   SourceRoot.register(os.path.join(get_buildroot(), 'fakeroot'), TargetsHelpTest.MyTarget)
예제 #8
0
 def _create_new_target(self, target_base, target_type, *args, **kwargs):
     if not os.path.exists(target_base):
         os.makedirs(target_base)
     SourceRoot.register(target_base, target_type)
     with ParseContext.temp(target_base):
         return target_type(*args, **kwargs)
예제 #9
0
 def root(path, *types):
   SourceRoot.register(os.path.join(basedir, path) if basedir else path, *types)
예제 #10
0
 def root(path, *types):
     SourceRoot.register(
         os.path.join(basedir, path) if basedir else path, *types)
예제 #11
0
 def __init__(self, basedir, *allowed_target_types):
   SourceRoot.register(os.path.join(buildfile_dir, basedir), *allowed_target_types)
예제 #12
0
 def here(*allowed_target_types):
   """Registers the cwd as a source root for the given target types."""
   SourceRoot.register(buildfile_dir, *allowed_target_types)