def templates(self, component): templates = [ CppTemplate('resource.cpp', component['userclass']['file'], userfile=True), CppTemplate('resource.h', component['userclass']['header'], userfile=True), CppTemplate('pull/resource_base.cpp', component['baseclass']['file']), CppTemplate('pull/resource_base.h', component['baseclass']['header']), CppTemplate('programmable_base.h', component['reprogclass']['header']), CppTemplate('entry_point.h', userfile=True), CppTemplate('base/main.cpp'), AutomakeTemplate('base/Makefile.am'), AutomakeTemplate('base/Makefile.am.ide', userfile=True), AutoconfTemplate('base/configure.ac'), ShellTemplate('base/build.sh'), ShellTemplate('common/reconf') ] for gen in component['portgenerators']: # Need to include port_impl if a non-bulkio port exists if str(type(gen)).find("BulkioPortGenerator") == -1: templates.append(CppTemplate('pull/port_impl.cpp')) templates.append(CppTemplate('pull/port_impl.h')) break if component['structdefs']: templates.append(CppTemplate('pull/struct_props.h')) return templates
def templates(self, component): templates = [ CppTemplate('base/main.cpp'), AutomakeTemplate('base/Makefile.am'), AutomakeTemplate('base/Makefile.am.ide', userfile=True), AutoconfTemplate('base/configure.ac'), ShellTemplate('base/build.sh'), ShellTemplate('common/reconf'), CppTemplate('resource.cpp', component['userclass']['file'], userfile=True), CppTemplate('resource.h', component['userclass']['header'], userfile=True), CppTemplate('resource_base.cpp', component['baseclass']['file']), CppTemplate('resource_base.h', component['baseclass']['header']) ] # Add port implementations if required templates.extend( CppTemplate(fn) for fn in self.getPortTemplates(component)) if component['structdefs']: templates.append(CppTemplate('struct_props.h')) return templates
def templates(self, project): return [ AutomakeTemplate('Makefile.am'), AutoconfTemplate('configure.ac'), ShellTemplate('base/build.sh'), ShellTemplate('common/reconf') ]
def templates(self, component): # Put generated Java files in "src" subdirectory, followed by their # package path. pkgpath = os.path.join('src', *component['package'].split('.')) userfile = component['userclass']['file'] basefile = component['baseclass']['file'] templates = [ JavaTemplate('resource.java', os.path.join(pkgpath, userfile), userfile=True), JavaTemplate('resource_base.java', os.path.join(pkgpath, basefile)), AutomakeTemplate('base/Makefile.am'), AutoconfTemplate('base/configure.ac'), ShellTemplate('base/startJava.sh'), ShellTemplate('common/reconf') ] portpkg = component['package'] + '.' + 'ports' portpkgpath = os.path.join(pkgpath, 'ports') for generator in component['portgenerators']: if not generator.hasImplementation(): continue generator.package = portpkg template = generator.implementation() filename = os.path.join(portpkgpath, generator.className() + '.java') context = {'portgenerator': generator} templates.append( JavaTemplate(template, filename, package=portpkg, context=context)) return templates
def templates(self, component): templates = [ CppTemplate('main.cpp'), AutomakeTemplate('Makefile.am'), AutomakeTemplate('Makefile.am.ide', userfile=True), AutoconfTemplate('configure.ac'), ShellTemplate('build.sh'), ShellTemplate('common/reconf') ] return templates
def templates(self, component): templates = [ CppTemplate('resource.cpp', component['userclass']['file'], userfile=True), CppTemplate('resource.h', component['userclass']['header'], userfile=True), CppTemplate('pull/resource_base.cpp', component['baseclass']['file']), CppTemplate('pull/resource_base.h', component['baseclass']['header']), CppTemplate('main.cpp', userfile=True), AutomakeTemplate('Makefile.am'), AutomakeTemplate('base/Makefile.am.ide', userfile=True), AutoconfTemplate('configure.ac'), ShellTemplate('base/build.sh'), ShellTemplate('common/reconf') ] is_device = True is_executable = False for superclass in component['superclasses']: if superclass['name'] == 'Resource_impl': is_device = False if superclass['name'] == 'ExecutableDevice_impl': is_executable = True # Append programmable files if it's a persona device if is_device: templates.append( CppTemplate('persona_base.cpp', component['reprogclass']['file'], userfile=True)) templates.append( CppTemplate('persona_base.h', component['reprogclass']['header'], userfile=True)) # Append entry_point file if it's an executable device if is_executable: templates.append(CppTemplate('entry_point.h', userfile=True)) # Add port implementations if required templates.extend( CppTemplate('pull/' + fn) for fn in self.getPortTemplates(component)) if component['structdefs']: templates.append(CppTemplate('pull/struct_props.h')) return templates
def templates(self, service): # Put generated Java files in "src" subdirectory, followed by their # package path. pkgpath = os.path.join('src', *service['package'].split('.')) mainfile = service['userclass']['file'] templates = [ JavaTemplate('service.java', os.path.join(pkgpath, mainfile), userfile=True), AutomakeTemplate('base/Makefile.am'), AutoconfTemplate('base/configure.ac'), ShellTemplate('base/startJava.sh'), ShellTemplate('common/reconf') ] return templates
def templates(self, component): templates = [ CppTemplate('main.cpp'), CppTemplate('resource.cpp', component['userclass']['file']), CppTemplate('resource.h', component['userclass']['header']), CppTemplate('resource_base.cpp', component['baseclass']['file']), CppTemplate('resource_base.h', component['baseclass']['header']), CppTemplate('GnuHawkBlock.h', component['prefix'] + '_GnuHawkBlock.h'), AutomakeTemplate('Makefile.am'), AutomakeTemplate('Makefile.am.ide'), AutoconfTemplate('configure.ac'), ShellTemplate('reconf') ] for gen in component['portgenerators']: # Need to include port_impl if a non-bulkio port exists if str(type(gen)).find("BulkioPortGenerator") == -1: templates.append(CppTemplate('pull/port_impl.cpp')) templates.append(CppTemplate('pull/port_impl.h')) break if component['structdefs']: templates.append(CppTemplate('struct_props.h')) return templates
def templates(self, library): userHeader = os.path.join(self.includedir, library['incfile']) userSource = os.path.join(self.sourcedir, library['srcfile']) templates = [ CppTemplate('library.h', userHeader, userfile=True), CppTemplate('library.cpp', userSource, userfile=True), AutomakeTemplate('Makefile.am'), AutomakeTemplate('base/Makefile.am.ide', userfile=True), AutoconfTemplate('configure.ac'), ShellTemplate('base/build.sh'), ShellTemplate('common/reconf'), PkgconfigTemplate('library.pc.in', library['pcfile']+'.in') ] return templates
def templates(self, component): templates = [ CppTemplate('main.cpp'), CppTemplate('service.cpp', component['userclass']['file'], userfile=True), CppTemplate('service.h', component['userclass']['header'], userfile=True), CppTemplate('service_base.cpp', component['baseclass']['file']), CppTemplate('service_base.h', component['baseclass']['header']), AutomakeTemplate('Makefile.am'), AutomakeTemplate('Makefile.am.ide', userfile=True), AutoconfTemplate('configure.ac'), ShellTemplate('build.sh'), ShellTemplate('common/reconf') ] return templates
def templates(self, component): templates = [ PythonTemplate('pull/resource_base.py', component['baseclass']['file']), PythonTemplate('resource.py', component['userclass']['file'], executable=True), AutoconfTemplate('pull/configure.ac'), AutomakeTemplate('base/Makefile.am'), AutomakeTemplate('Makefile.am.ide'), ShellTemplate('common/reconf') ] # If this is a docker-borne Component, add the template generators for it. if component['flowgraph']['docker_image']: templates += [ DockerFileTemplate('Dockerfile', filename='../Dockerfile', executable=False), ShellTemplate('build-image.sh', filename='../build-image.sh', executable=True) ] return templates
def templates(self, service): templates = [ PythonTemplate('service.py', service['userclass']['file'], executable=True, userfile=True), AutoconfTemplate('pull/configure.ac'), AutomakeTemplate('base/Makefile.am'), AutomakeTemplate('base/Makefile.am.ide', userfile=True), ShellTemplate('common/reconf') ] return templates
def templates(self, library): templates = [ #CppTemplate('resource.h', userHeader, userfile=True), #CppTemplate('resource.cpp', userSource, userfile=True), CppTemplate('resource.h', self.plugin_name + '.h', userfile=True), CppTemplate('resource.cpp', self.plugin_name + '.cpp', userfile=True), CppTemplate('resource_base.h', self.plugin_name + '_base.h'), CppTemplate('resource_base.cpp', self.plugin_name + '_base.cpp'), CppTemplate('struct_props.h'), CppTemplate('main.cpp'), SpecfileTemplate('plugin.spec', self.plugin_name + '.spec'), AutomakeTemplate('Makefile.am'), AutomakeTemplate('base/Makefile.am.ide', userfile=True), AutoconfTemplate('configure.ac'), ShellTemplate('base/build.sh'), ShellTemplate('common/reconf') ] return templates
def templates(self, component): templates = [ PythonTemplate('resource_base.py', component['baseclass']['file']), PythonTemplate('resource.py', component['userclass']['file'], executable=True, userfile=True), AutoconfTemplate('configure.ac'), AutomakeTemplate('base/Makefile.am'), AutomakeTemplate('base/Makefile.am.ide', userfile=True), ShellTemplate('common/reconf') ] return templates
def templates(self, project): return [ ShellTemplate('base/build.sh'), SpecfileTemplate('component.spec', project['name'] + '.spec') ]
def templates(self, project): return [ ShellTemplate('build.sh'), SpecfileTemplate('component.spec', project['specfile']) ]
def templates(self, project): return [ ShellTemplate('build.sh'), SpecfileTemplate('dependency.spec', project['specfile']) ]