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 ) '''))
def setUpClass(cls): super(JarCreateExecuteTest, cls).setUpClass() cls.create_target('build-support/ivy', dedent(''' repo(name = 'ivy', url = 'https://art.twitter.biz/', push_db = 'dummy.pushdb') ''')) 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.create_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') cls.java_lib_foo= cls.java_library('src/java/com/twitter/foo', 'java_foo', ['java_foo.java']) cls.scala_lib = cls.scala_library('src/scala/com/twitter/foo', 'scala_foo', ['scala_foo.scala'], provides=True, java_sources=['src/java/com/twitter/foo:java_foo'])
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')
def root(path, *types): SourceRoot.register(os.path.join(basedir, path) if basedir else path, *types)
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)
def setUpClass(cls): super(TargetsHelpTest, cls).setUpClass() SourceRoot.register(os.path.join(get_buildroot(), 'fakeroot'), TargetsHelpTest.MyTarget)
def __init__(self, basedir, *allowed_target_types): SourceRoot.register(os.path.join(buildfile_dir, basedir), *allowed_target_types)
def here(*allowed_target_types): """Registers the cwd as a source root for the given target types.""" SourceRoot.register(buildfile_dir, *allowed_target_types)