def setUp(self) -> None:
    super().setUp()

    class Lib():

        def __init__(self, name: str, provides: bool=False) -> None:
            self.name = name
            self.provides = (dedent(f'''
                        artifact(
                          org='com.example',
                          name='{name}',
                          repo=public
                        )
                        ''').strip() if provides else 'None')

    def create_library(path: str, *libs: Lib) -> None:
        libs = (libs or (Lib(os.path.basename(os.path.dirname(self.build_path(path)))),))
        for lib in libs:
            target = f'''java_library(name='{lib.name}', provides={lib.provides}, sources=[])
'''
            self.add_to_build_file(path, target)
    create_library('a')
    create_library('a/b', Lib('b', provides=True))
    create_library('a/b/c', Lib('c'), Lib('c2', provides=True), Lib('c3'))
    create_library('a/b/d')
    create_library('a/b/e', Lib('e1'))
    self.add_to_build_file('f', dedent('\n                target(\n                  name=\'alias\',\n                  dependencies=[\n                    \'a/b/c:c3\',\n                    \'a/b/d:d\',\n                  ],\n                  description = """\n                Exercises alias resolution.\n                Further description.\n                  """,\n                )\n                '))
def setUp(self) -> None:
    super().setUp()

    class Lib():

        def __init__(self, name: str, provides: bool=False) -> None:
            self.name = name
            self.provides = (dedent(f'
                        artifact(
                          org='com.example',
                          name='{name}',
                          repo=public
                        )
                        ').strip() if provides else 'None')

    def create_library(path: str, *libs: Lib) -> None:
        libs = (libs or (Lib(os.path.basename(os.path.dirname(self.build_path(path)))),))
        for lib in libs:
            target = f'java_library(name='{lib.name}', provides={lib.provides}, sources=[])
'
            self.add_to_build_file(path, target)
    create_library('a')
    create_library('a/b', Lib('b', provides=True))
    create_library('a/b/c', Lib('c'), Lib('c2', provides=True), Lib('c3'))
    create_library('a/b/d')
    create_library('a/b/e', Lib('e1'))
    self.add_to_build_file('f', dedent('\n                target(\n                  name=\'alias\',\n                  dependencies=[\n                    \'a/b/c:c3\',\n                    \'a/b/d:d\',\n                  ],\n                  description = "\n                Exercises alias resolution.\n                Further description.\n                  ",\n                )\n                '))