LB CONFIG API  LB 4.x
lbconfig.api Namespace Reference

Functions

def add_task (task)
 
def archive_export_target (ws_name)
 
def bin_program (name)
 Name of a script or executable to be installed in /bin. More...
 
def check_command (check_target, command, suite_name, workspaces=[], libraries=[], services=[], env=None, extra_inputs=[], container_target='check')
 
def check_jar (name, main, srcdir=None, srcdirs=[], classpath=[], scala=False, scala_files=None, java_files=None, srcgen=[], deps=[], javadoc=None, scaladoc=None, manual_targets=None, workspaces=[], jvm_args=[], java_version="11", javac='javac', javac_flags="", scalac='scalac', scalac_flags="", resources=[], services=[], container_target='check', findbugs=False)
 Creates JAR package with test cases and adds tests to check target. More...
 
def check_lb_library (**kwargs)
 Compiles an lb library, but does not install it. More...
 
def check_lb_workspace (name, libraries=[], native_libs=[], archived=False, init_cmds=[], input=[], compress=True, create_cmd=None, keep=False)
 Creates a workspace and installs libraries into the workspace. More...
 
def check_lb_workspace_with_branch (workspace, branch, libraries=[], branch_libraries=[], native_libs=[], archived=False, init_cmds=[], input=[], compress=True, create_cmd=None, keep=False)
 Creates a workspace with a branch and installs libraries into them. More...
 
def check_lbunit_suite (name, suite, workspaces=[], libraries=[], env=None, container_target='check')
 
def check_lbunit_test (name, test, workspaces=[], libraries=[], env=None, container_target='check')
 
def check_program (filepath, workspaces=[], libraries=[], name=None, services=[], env=None, container_target='check', input=None, params='')
 
def check_protobuf_protocol (**kwargs)
 Creates files for protobuf protocol, but does not install them. More...
 
def check_ws_success_file (ws_name)
 
def config_file (name)
 A configuration file that should be installed into /config. More...
 
def copy_file (src, target)
 A rule to copy a file. More...
 
def depends_on (*deps, **more_deps)
 
def dist_dir (directory)
 Make a directory recursively part of a distribution. More...
 
def dist_files (files)
 Make a list of files part of the source distribution. More...
 
def emit (line, makefile=None)
 Add a line to the makefile. More...
 
def emit_clean_file (filename, output='clean')
 Remove file on clean. More...
 
def emit_clean_workspace (workspace, success_file=".")
 Remove a workspace on clean. More...
 
def import_ws_archive (name, ws_prefix='')
 
def install_dir (dirname, destdir, allow_empty=False)
 Install contents of a directory into /destdir. More...
 
def install_file (filename, destdir)
 Install a file into /destdir. More...
 
def install_files (filenames, destdir)
 Install a list of files into /destdir. More...
 
def jar (name, srcdir=None, srcdirs=[], classpath=[], srcgen=[], javadoc=None, scaladoc=None, resources=[], deps=[], install=True, scala=False, scala_files=None, java_files=None, java_version="11", manifest=None, javac='javac', scalac='scalac', scalac_flags="", javac_flags="", sbt=False, findbugs=False)
 
def java_protobuf (name, srcdir, java_package, package='', proto_paths=None, install=True, outer_class=None)
 
def java_protobuf_file (name, java_package=None, outer_class=None)
 Given a protobuf protocol name and a package, will return the full path to the generated Java file. More...
 
def lb_deployment_dir ()
 
def lb_library (name, srcdir, srcgen=[], deps=None, install=True, generated=False, scalable=None, install_subdir='share/$(package_basename)', post_cmds=[])
 
def lbconfig_package (name, default_prefix='out', version='', default_targets=['lb-libraries'])
 Sets the name of the package and the list of targets that should be run when calling 'make'. More...
 
def lbconfig_plugin (package_name, srcdir, plugin_module, plugin_deps=[])
 Declare a python module as an lbconfig_plugin. More...
 
def link_libs (libraries)
 
def protobuf_protocol (name, srcdir, package='', java_package=None, lifetime='transaction', proto_path='', gen_datalog=True, gen_java=True, outer_class=None, gen_python=True, install=True, proto_paths=None)
 Creates file for the protobuf protocol from proto files. More...
 
def python_library (package_name, srcdir=None, srcgen=[], python_files=None)
 
def python_protobuf (name, srcdir, package='', proto_paths=None, install=True)
 
def python_protobuf_file (name, package)
 Given a protobuf protocol name and a package, will return the full path to the generated Python file. More...
 
def rule (output, input, commands=None, phony=False, description=None)
 A rule specifying commands to be invoked to make output files. More...
 
def service_jar (name, srcdir=None, srcdirs=None, classpath=None, srcgen=None, javadoc=None, scaladoc=None, resources=None, deps=None, install=True, java_files=None, java_version="11", protocols=None, findbugs=False)
 
def target (name, deps)
 
def variable (name, value)
 Declare a variable in Makefile. More...
 
def with_arg (*args, **kwargs)
 
def write_lbconfig_deps (build_dir, module_name, deps, install_dir)
 THESE ARE PRIVATE FUNCTIONS THAT END USERS SHOULD NOT USE They are here because they depend on the public api. More...
 
def write_makefile (extension_files=[], makefile_name='Makefile')
 private More...
 
def write_projects ()
 private More...
 
def ws_archive (name, libraries=[], init_cmds=[], input=[], compress=True, keep=False)
 Archives a workspace. More...
 

Variables

tuple lb_web_dep
 
tuple logicblox_dep
 

Function Documentation

◆ add_task()

def lbconfig.api.add_task (   task)
 Add a build task.

 @param task
     An object with a run() method which will be called after all lb_libraries and workspaces have been processed. The run method returns a list of errors.

Definition at line 164 of file api.py.

◆ archive_export_target()

def lbconfig.api.archive_export_target (   ws_name)

Definition at line 1899 of file api.py.

◆ bin_program()

def lbconfig.api.bin_program (   name)

Name of a script or executable to be installed in /bin.

@param name
    Name of script or executable.

Definition at line 1185 of file api.py.

◆ check_command()

def lbconfig.api.check_command (   check_target,
  command,
  suite_name,
  workspaces = [],
  libraries = [],
  services = [],
  env = None,
  extra_inputs = [],
  container_target = 'check' 
)
 Low level entry point to check a command, used by check_program and check_lbunit


 @param check-target
     The name of the target
 @param command
     The command which will be run
 @param suite_name
     The name of the test.
 @param workspaces
     An optional list of workspace names that this program
     depends on. The workspace must also be specified by the
     check_lb_workspace function.
 @param libraries
     The names of any lb libraries this program depends on. The
     libraries must be built by the lb_library or check_lb_library
     function.
 @param services
     A list of services this test depends on.
 @param env
     A map of environment variables to set before executing the test program.
 @param extra_inputs
     A list of targets this depends on
 @param container-target
     The target this check will be included in. By default 'check'

Definition at line 1324 of file api.py.

◆ check_jar()

def lbconfig.api.check_jar (   name,
  main,
  srcdir = None,
  srcdirs = [],
  classpath = [],
  scala = False,
  scala_files = None,
  java_files = None,
  srcgen = [],
  deps = [],
  javadoc = None,
  scaladoc = None,
  manual_targets = None,
  workspaces = [],
  jvm_args = [],
  java_version = "11",
  javac = 'javac',
  javac_flags = "",
  scalac = 'scalac',
  scalac_flags = "",
  resources = [],
  services = [],
  container_target = 'check',
  findbugs = False 
)

Creates JAR package with test cases and adds tests to check target.

@param name
    Name of jarfile, minus extension.
@param main
    Name of executable class (has main method) to call to check jar.
@param srcdir
    The directory where the sources are located.
    Directory can also contain scala files.
@param srcdirs
    As list of directories where the sources are located.
    Directories can also contain scala files.
@param classpath
    A list of jar files used for the java and scala classpath.
@param srcgen
    A list of generated src files to also copy into this library
@param scala
    True if we want to compile scala code. If we find any
    scala files in scala_files or srcdir, this is set to True.
@param scala_files
    A list of scala files to compile.
@param java_files
    A list of java files to compile.
@param deps
    A list of dependency names to be added to the classpath. These should
@param javadoc
    A dictionary with the 'title' of the Javadoc. If not set, will not
    generate Javadoc.
@param scaladoc
    A dictionary with the 'title' of the Scaladoc. If not set, will not
    generate Scaladoc.
@param manual_targets
    A list of other executable classes for checking, like main.
@param resources
    A dictionary mapping file resources to relative locations within the
    jar. For backwards compatability, this can just be a list, in which
    case the files are all copied to the root of the jar.
@param services:
    A list of services that should be be started before running this jar
@param workspaces
    A list of workspace names that need to checked before checking this jar.
@param java_version
    The Java version to use for compilation.
@param container_target
    The target that will contain all check targets
@param javac
    Path to the java compiler. Defaults to "javac".
@param scalac
    Path to the scala compiler. Defaults to "scalac".
@param findbugs
    Whether to generate a target to execute findbugs on the build.

Definition at line 719 of file api.py.

◆ check_lb_library()

def lbconfig.api.check_lb_library ( **  kwargs)

Compiles an lb library, but does not install it.

This accepts the same parameters as lb_library.

Definition at line 175 of file api.py.

◆ check_lb_workspace()

def lbconfig.api.check_lb_workspace (   name,
  libraries = [],
  native_libs = [],
  archived = False,
  init_cmds = [],
  input = [],
  compress = True,
  create_cmd = None,
  keep = False 
)

Creates a workspace and installs libraries into the workspace.

Creates a target that creates a workspace with the given name & installs
the libraries with the given names into the workspace. The libraries
must have targets created via the lb_library or check_lb_library function.

The target created will be named check-ws-<name> where name is the name
parameter.

@param name
    The name of the workspace to create. NOTE: if you put any '/'
    characters in the name you will not be able to use the
    auto-complete on the command line for the target name. This is
    a restriction of Make.

@param libraries
    A list of library names to install into the newly
    created workspace.

@param native_libs
    A list of native libraries to install in the workspace.

@param archived
    Boolean - archive and compress the workspace -creates $(build)/workspaces/<name>.tgz

@param init_cmds
    An optional list of commands to be executed after the workspace is
    created and libraries are installed but before the workspace is
    exported.

@param input
    An optional list of make targets that this workspace creation depends
    on (jars with service implementations, for example)

@param compress
    An optional Boolean value, when set to True will compress the exported workspace

@param create_cmd
    Optionally define the exact command used to create the workspace. If this is set, the native_libs
    option will be ignored.

@param keep
    If archived is true, keep controls whether the original workspace should
    be kept (true) or deleted (false).

Definition at line 274 of file api.py.

◆ check_lb_workspace_with_branch()

def lbconfig.api.check_lb_workspace_with_branch (   workspace,
  branch,
  libraries = [],
  branch_libraries = [],
  native_libs = [],
  archived = False,
  init_cmds = [],
  input = [],
  compress = True,
  create_cmd = None,
  keep = False 
)

Creates a workspace with a branch and installs libraries into them.

Creates a target that frist creates a workspace with the given name, then creates
a branch from it, and at last installs the 'libraries' in the master branch,
and 'branch_libraries' in 'the 'branch'. The libraries must have targets created
via the lb_library or check_lb_library function.

The target created will be named check-ws-<name> where name is the workspace
parameter.

Note that 'libraries' will not be installed on the branch, as the branch is created
before isntalling the libraries into the master branch.

@param workspace
    The name of the workspace to create. NOTE: if you put any '/'
    characters in the name you will not be able to use the
    auto-complete on the command line for the target name. This is
    a restriction of Make.

@param branch
    The name of the branch to create.

@param libraries
    A list of library names to install into the newly created workspace's
    master branch.

@param branch_libraries
    A list of library names to install into the branch.

@param native_libs
    A list of native libraries to install in the workspace. NOTE: these will be in both
    master and branch, as native_libs is passed to the 'create workspace' command.

@param archived
    Boolean - archive and compress the workspace -creates $(build)/workspaces/<name>.tgz

@param init_cmds
    An optional list of commands to be executed after the workspace is
    created and libraries are installed but before the workspace is
    exported.

@param input
    An optional list of make targets that this workspace creation depends
    on (jars with service implementations, for example)

@param compress
    An optional Boolean value, when set to True will compress the exported workspace

@param create_cmd
    Optionally define the exact command used to create the workspace. If this is set, the native_libs
    option will be ignored.

@param keep
    If archived is true, keep controls whether the original workspace should
    be kept (true) or deleted (false).

Definition at line 337 of file api.py.

◆ check_lbunit_suite()

def lbconfig.api.check_lbunit_suite (   name,
  suite,
  workspaces = [],
  libraries = [],
  env = None,
  container_target = 'check' 
)
 Emits a phony target that runs a suite lb-unit tests. The target will be name check-lb-unit-<name>

 @param suite
     The folder containing the test suite
 @param name
     The name the suite will be identified by
 @param workspaces
     An optional list of workspace names that this program
     depends on. The workspace must also be specified by the
     check_lb_workspace function.
 @param libraries
     The names of any lb libraries this program depends on. The
     libraries must be built by the lb_library or check_lb_library
     function.
 @param env
     A map of environment variables to set before executing the test program.
 @param container-target
     The target this check will be included in. By default 'check'

Definition at line 1212 of file api.py.

◆ check_lbunit_test()

def lbconfig.api.check_lbunit_test (   name,
  test,
  workspaces = [],
  libraries = [],
  env = None,
  container_target = 'check' 
)
 Emits a phony target that runs a lb-unit test. The target will be name check-lb-unit-<name>

 @param test
     The file containing the test
 @param name
     The name the suite will be identified by
 @param workspaces
     An optional list of workspace names that this program
     depends on. The workspace must also be specified by the
     check_lb_workspace function.
 @param libraries
     The names of any lb libraries this program depends on. The
     libraries must be built by the lb_library or check_lb_library
     function.
 @param env
     A map of environment variables to set before executing the test program.
 @param container-target
     The target this check will be included in. By default 'check'

Definition at line 1237 of file api.py.

◆ check_program()

def lbconfig.api.check_program (   filepath,
  workspaces = [],
  libraries = [],
  name = None,
  services = [],
  env = None,
  container_target = 'check',
  input = None,
  params = '' 
)
 Emits a phony target that runs the file at the given file path. By default,
 the name of the target will be 'check-<folder>' where <folder> is the name
 of the immediate parent folder of the program to run. You can optionally
 use the name parameter to change the target to 'check-<name>'.

 @param filepath
     The file to run, relative to the root project directory.
 @param workspaces
     An optional list of workspace names that this program
     depends on. The workspace must also be specified by the
     check_lb_workspace function.
 @param libraries
     The names of any lb libraries this program depends on. The
     libraries must be built by the lb_library or check_lb_library
     function.
 @param name
     An optional parameter to change the name of the check target.
 @param services
     A list of services this test depends on.
 @param env
     A map of environment variables to set before executing the test program.
 @param container-target
     The target this check will be included in. By default 'check'
 @param input
     An optional list of make target names that are required before running the check program.
 @param params
     An optional string to be appended to the file to run. Usually includes hardcoded parameters to the executable.

Definition at line 1271 of file api.py.

◆ check_protobuf_protocol()

def lbconfig.api.check_protobuf_protocol ( **  kwargs)

Creates files for protobuf protocol, but does not install them.

This accepts the same parameters as protobuf_protocol.

Definition at line 437 of file api.py.

◆ check_ws_success_file()

def lbconfig.api.check_ws_success_file (   ws_name)

Definition at line 1894 of file api.py.

◆ config_file()

def lbconfig.api.config_file (   name)

A configuration file that should be installed into /config.

Definition at line 1415 of file api.py.

◆ copy_file()

def lbconfig.api.copy_file (   src,
  target 
)

A rule to copy a file.

@param src
    File to copy.
@param target
    Destination.

Definition at line 1512 of file api.py.

◆ depends_on()

def lbconfig.api.depends_on ( deps,
**  more_deps 
)

Definition at line 51 of file api.py.

◆ dist_dir()

def lbconfig.api.dist_dir (   directory)

Make a directory recursively part of a distribution.

Definition at line 1496 of file api.py.

◆ dist_files()

def lbconfig.api.dist_files (   files)

Make a list of files part of the source distribution.

Definition at line 1477 of file api.py.

◆ emit()

def lbconfig.api.emit (   line,
  makefile = None 
)

Add a line to the makefile.

Definition at line 96 of file api.py.

◆ emit_clean_file()

def lbconfig.api.emit_clean_file (   filename,
  output = 'clean' 
)

Remove file on clean.

Definition at line 1544 of file api.py.

◆ emit_clean_workspace()

def lbconfig.api.emit_clean_workspace (   workspace,
  success_file = "." 
)

Remove a workspace on clean.

@param workspace
    Workspace name.
@param success_file
    Success_file that was created when the workspace
    was created. We only delete the workspace if this file
    exists. Defaults to . so that we always delete by default.

Definition at line 1529 of file api.py.

◆ import_ws_archive()

def lbconfig.api.import_ws_archive (   name,
  ws_prefix = '' 
)
 Generate a makefile target prefixed by 'install-test-' followed by the
 specified workspace name.  This target can be used to import a workspace
 as a managed LB workspace from a workspace archive.  The ws_archive()
 function should be used to create the workspace archive.

 @param name
     The name of the workspace to create and the root name of a
     workspace archive that is in the $(build)/workspaces/ directory.

 @param ws_prefix
     Optional parameter that if specified will be prepended to
     the specified workspace name to form the managed
     workspace name.

Definition at line 406 of file api.py.

◆ install_dir()

def lbconfig.api.install_dir (   dirname,
  destdir,
  allow_empty = False 
)

Install contents of a directory into /destdir.

@param dirname
    Source directory to copy from (relative to the directory running make)
@param destdir
    Target directory to copy to.
    This should be a directory name relative to the install directory.
@param allow_empty
    If true, allow that the source directory be empty, so the destdir will
    still be created but without contents. If false, it is an error when the
    source directory is empty.

Definition at line 1463 of file api.py.

◆ install_file()

def lbconfig.api.install_file (   filename,
  destdir 
)

Install a file into /destdir.

@param filename
    Source file to copy.
@param destdir
    Target directory to copy to.
    This should be a relative directory name.

Definition at line 1441 of file api.py.

◆ install_files()

def lbconfig.api.install_files (   filenames,
  destdir 
)

Install a list of files into /destdir.

@param filenames
    A list of files to copy.
@param destdir
    Target directory to copy to.
    This should be a relative directory name.

Definition at line 1428 of file api.py.

◆ jar()

def lbconfig.api.jar (   name,
  srcdir = None,
  srcdirs = [],
  classpath = [],
  srcgen = [],
  javadoc = None,
  scaladoc = None,
  resources = [],
  deps = [],
  install = True,
  scala = False,
  scala_files = None,
  java_files = None,
  java_version = "11",
  manifest = None,
  javac = 'javac',
  scalac = 'scalac',
  scalac_flags = "",
  javac_flags = "",
  sbt = False,
  findbugs = False 
)
 Build a jar by compiling Java files with javac, and optionally Scala files with scalac.

 @param name
     Name of jarfile, minus extension.
 @param srcdir
     The directory where the sources are located.
     Directory can also contain scala files.
 @param srcdirs
     As list of directories where the sources are located.
     Directories can also contain scala files.
 @param classpath
     A list of jar files used for the java and scala classpath.
 @param srcgen
     A list of generated src files to also copy into this library.
 @param javadoc
     A dictionary with the 'title' of the Javadoc. If not set, will not
     generate Javadoc.
 @param scaladoc
     A dictionary with the 'title' of the Scaladoc. If not set, will not
     generate Scaladoc.
 @param resources
     A dictionary mapping file resources to relative locations within the
     jar. For backwards compatability, this can just be a list, in which
     case the files are all copied to the root of the jar.
 @param deps
     A list of dependency names to be added to the classpath. These should
     be contained within the dependencies in buildlib_local.py.
 @param install
     True if the jar should be installed into $(prefix).
 @param scala
     True if we want to compile scala code. If we find any
     scala files in scala_files or srcdir, this is set to True.
 @param scala_files
     A list of scala files to compile.
 @param java_files
     A list of java files to compile.
 @param java_version
     The Java version to use for compilation.
 @param manifest
     A dictionary of options for creating the manifest:

        add_classpath=False   # Adds the classpath entries to the manifest
        classpath_prefix=None # Adds a dir prefix (e.g. lib/) to each entry in the class path
        main_class=None       # Specifies a Main-Class for the Manifest
        manifest_file=None    # Specifies a file to use as the Manifest, ignores other options
 @param javac
     Path to the java compiler. Defaults to "javac".
 @param scalac
     Path to the scala compiler. Defaults to "scalac".
 @param scalac_flags
     Extra flags to pass to scalac
 @param javac_flags
     Extra flags to pass to javac
 @param sbt
     Build using sbt
 @param findbugs
     Whether to generate a target to execute findbugs on the build.

Definition at line 900 of file api.py.

◆ java_protobuf()

def lbconfig.api.java_protobuf (   name,
  srcdir,
  java_package,
  package = '',
  proto_paths = None,
  install = True,
  outer_class = None 
)
 Create a build task that will generate Java classes from a protobuf
 protocol file.

 @param name
     Root name of the protocol (name of the .proto file without the extension).
 @param java_package
     The name of the Java package to use when generating Java files. This should
     match the "option java_package" specified in the .proto file.
 @param package
     The optional package that will contain the generated code.
 @param srcdir
     The directory containing the source .proto file.
 @param proto_paths
     Optional list of directories containing required protobuf protocol files used by the named protocol.
 @param install
     If True, will install files into $(prefix).

Definition at line 489 of file api.py.

◆ java_protobuf_file()

def lbconfig.api.java_protobuf_file (   name,
  java_package = None,
  outer_class = None 
)

Given a protobuf protocol name and a package, will return the full path to the generated Java file.

Parameters
nameRoot name of the protocol (name of the .proto file without the extension).
java_packageThe (optional) name of the Java package to use when generating Java files. If not specified, Java code is not generated.

Definition at line 657 of file api.py.

◆ lb_deployment_dir()

def lbconfig.api.lb_deployment_dir ( )

Definition at line 43 of file api.py.

◆ lb_library()

def lbconfig.api.lb_library (   name,
  srcdir,
  srcgen = [],
  deps = None,
  install = True,
  generated = False,
  scalable = None,
  install_subdir = 'share/$(package_basename)',
  post_cmds = [] 
)
 Creates a make task to compile an LogicBlox library.

 @param name
     Project name (e.g. foo:bar).

 @param srcdir
     Directory that contains the .project file.

 @param srcgen
     An optional list of source files that are generated by some
     other build task. These files serve only to inform the Makefile
     that if they change then we should rebuild. srcgen file paths
     should be relative to the srcdir.

 @param deps
     An optional map of library name to directory name for
     dependencies on external libraries. System libraries and other
     libraries that are built by this build file are not required
     to be listed here.

 @param install
     Whether or not this library should be included in the
     'make install' task.

 @param generated
     Whether or not this library is generated and therefore we
     should not attempt to determine it's dependencies during
     the configure step.

 @param install_subdir

 @param post_cmds
     Optional list of commands to execute after the library is built.

Definition at line 217 of file api.py.

◆ lbconfig_package()

def lbconfig.api.lbconfig_package (   name,
  default_prefix = 'out',
  version = '',
  default_targets = ['lb-libraries'] 
)

Sets the name of the package and the list of targets that should be run when calling 'make'.

The name of the package is used when creating tar.gz files in the 'make dist' command.

Parameters
nameThe name of the package is used when creating tar.gz files in the 'make dist' command.
default_targetsA list of strings that are the targets that should be run when calling 'make'.

Definition at line 82 of file api.py.

◆ lbconfig_plugin()

def lbconfig.api.lbconfig_plugin (   package_name,
  srcdir,
  plugin_module,
  plugin_deps = [] 
)

Declare a python module as an lbconfig_plugin.

@param srcdir
    The src directory in which to find the root package.
@param plugin_module
    The module name for the plugin, for example 'lbconfig.jacoco'.
@param plugin_deps
    A list of dependency names that are required to run this plugin.
    This will save a .[plugin-name]-deps file with the dependencies
    so that a config.py script can load the dependencies for
    the plugins that it uses.

Definition at line 1169 of file api.py.

◆ link_libs()

def lbconfig.api.link_libs (   libraries)
     Create a 'link_libs' phony target that, when called, will create a lib/ directory in the source
     folder, and then will create symlinks from this lib/ directory to the libraries passed as parameter.
     This is useful to set up IDEs that need references to all dependencies.

Definition at line 1558 of file api.py.

◆ protobuf_protocol()

def lbconfig.api.protobuf_protocol (   name,
  srcdir,
  package = '',
  java_package = None,
  lifetime = 'transaction',
  proto_path = '',
  gen_datalog = True,
  gen_java = True,
  outer_class = None,
  gen_python = True,
  install = True,
  proto_paths = None 
)

Creates file for the protobuf protocol from proto files.

@param name
    Root name of the protocol (name of the .proto file without the extension).
@param package
    The optional package that will contain the generated code.
@param srcdir
    The directory containing the source .proto file.
@param java_package
    The (optional) name of the Java package to use when generating Java files.
    If not specified, Java code is not generated.
@param lifetime
    The lifetime of the transaction for the datalog predicates.
@param proto_path
    Optional path for protobuf protocol files used by the named protocol.
    This is deprecated. Use the proto_paths parameter instead.
@param gen_datalog
    If True, will generate datalog files.
@param gen_java
    If True and java_package is specified, will generate Java files.
@param outer_class
    The name of the java class that contains protobuf code. If None, will use the default.
@param gen_python
    If True, will generate python files.
@param install
    If True, will install files into $(prefix).
@param proto_paths
    Optional list of directories containing required protobuf protocol files used by the named protocol.
    The current dir and $(logicblox)/lib/protobuf are already included.

Definition at line 534 of file api.py.

◆ python_library()

def lbconfig.api.python_library (   package_name,
  srcdir = None,
  srcgen = [],
  python_files = None 
)
 Copies the given python library into the $(build)/lib/python directory
 when running 'make' and into the $(prefix)/lib/python directory when
 running 'make install'. If no srdir is specified, it assumes the srcdir
 is a folder with the same name as the package name in the root directory.

 Creates the make target 'python-libraries'.

 @param package_name
     The root package name.
 @param srcdir
     The src directory in which to find the root package.
     Defaults to the root directory.
 @param srcgen
     A list of generated src files to also copy into this library.
 @param python_files
     A list of python files to consider for the library. By default,
     this function will search for all .py files in the package.

Definition at line 1110 of file api.py.

◆ python_protobuf()

def lbconfig.api.python_protobuf (   name,
  srcdir,
  package = '',
  proto_paths = None,
  install = True 
)
 Create a build task that will generate python wrappers from a protobuf
 protocol file.

 @param name
     Root name of the protocol (name of the .proto file without the extension).
 @param package
     The optional package that will contain the generated code.
 @param srcdir
     The directory containing the source .proto file.
 @param proto_paths
     Optional list of directories containing required protobuf protocol files used by the named protocol.
 @param install
     If True, will install files into $(prefix).

Definition at line 458 of file api.py.

◆ python_protobuf_file()

def lbconfig.api.python_protobuf_file (   name,
  package 
)

Given a protobuf protocol name and a package, will return the full path to the generated Python file.

Parameters
nameRoot name of the protocol (name of the .proto file without the extension).
packageThe optional package that will contain the generated code.

Definition at line 643 of file api.py.

◆ rule()

def lbconfig.api.rule (   output,
  input,
  commands = None,
  phony = False,
  description = None 
)

A rule specifying commands to be invoked to make output files.

@param output
    A list of output files, or a string with one output
    file.

@param input
    A list of input files, or a string with one input file.

@param commmands
    A list of commands to invoke that should make the
    output files.

@param phony should be set to True if the output is a phony one
              and not really a file.

@param description
    A descriptive string to output when building the
    target in place of the commands being echoed.

Definition at line 137 of file api.py.

◆ service_jar()

def lbconfig.api.service_jar (   name,
  srcdir = None,
  srcdirs = None,
  classpath = None,
  srcgen = None,
  javadoc = None,
  scaladoc = None,
  resources = None,
  deps = None,
  install = True,
  java_files = None,
  java_version = "11",
  protocols = None,
  findbugs = False 
)
 Compiles a jar containing a bloxweb service implementation.

 See the jar() function for details on all parameters except for protocols.

 @param protocols
     List of protobuf protocol files that will be used to generate Java classes compiled into the jar.

Definition at line 797 of file api.py.

◆ target()

def lbconfig.api.target (   name,
  deps 
)
 Adds a project-specific target with a set of dependencies to the Makefile.
 This is useful for grouping sets of build tasks together and for defining
 the default Makefile target.

 @param name
     Name of the Makefile target.

 @param deps
     List of Makefile targets that the new target depends on.

Definition at line 153 of file api.py.

◆ variable()

def lbconfig.api.variable (   name,
  value 
)

Declare a variable in Makefile.

Declares a variable in file as 'name = value'.

@param name
    Name of variable.
@param value
    Value of variable.

Definition at line 112 of file api.py.

◆ with_arg()

def lbconfig.api.with_arg ( args,
**  kwargs 
)

Definition at line 65 of file api.py.

◆ write_lbconfig_deps()

def lbconfig.api.write_lbconfig_deps (   build_dir,
  module_name,
  deps,
  install_dir 
)

THESE ARE PRIVATE FUNCTIONS THAT END USERS SHOULD NOT USE They are here because they depend on the public api.

As we improve lbconfig, we should move these private methods to core.py private

Definition at line 1583 of file api.py.

◆ write_makefile()

def lbconfig.api.write_makefile (   extension_files = [],
  makefile_name = 'Makefile' 
)

private

Close the makefile

Definition at line 1636 of file api.py.

◆ write_projects()

def lbconfig.api.write_projects ( )

private

A function that writes the Make rules for all LB projects.

Definition at line 1600 of file api.py.

◆ ws_archive()

def lbconfig.api.ws_archive (   name,
  libraries = [],
  init_cmds = [],
  input = [],
  compress = True,
  keep = False 
)

Archives a workspace.

Creates a target that creates a workspace with the given name & installs
the libraries with the given names into the workspace. The libraries
must have targets created via the lb_library or check_lb_library function.
The workspace will be exported and archived into a tgz file in the build
directory.

The target created will be named archive-ws-<name> where name is the name
parameter.

@param name
    The name of the workspace to create. NOTE: if you put any '/'
    characters in the name you will not be able to use the
    auto-complete on the command line for the target name. This is
    a restriction of Make.

@param libraries
    An array of library names to install into the newly
    created workspace.

@param init_cmds
    An optional list of commands to be executed after the workspace is
    created and libraries are installed but before the workspace is
    exported.

@param input
    An optional list of make targets that this workspace creation depends
    on (jars with service implementations, for example)

@param compress
    An optional Boolean value, when set to true, will compress the exported
    workspace

@param keep
    If archived is true, keep controls whether the original workspace should
    be kept (true) or deleted (false).

Definition at line 386 of file api.py.

Variable Documentation

◆ lb_web_dep

tuple lbconfig.api.lb_web_dep
Initial value:
1 = (
2  "lb_web", {'default_path': "$LB_WEBSERVER_HOME",
3  'help': "The lb-web-server installation to use for this build."})

Definition at line 39 of file api.py.

◆ logicblox_dep

tuple lbconfig.api.logicblox_dep
Initial value:
1 = (
2  "logicblox", {'default_path': "$LOGICBLOX_HOME",
3  'help': "The LogicBlox installation to use for this build."})

Definition at line 36 of file api.py.