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

Functions

def add_task (task)
 Add a build task. More...
 
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')
 Low level entry point to check a command, used by check_program and check_lbunit. More...
 
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="1.8", 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')
 Emits a phony target that runs a suite lb-unit tests. More...
 
def check_lbunit_test (name, test, workspaces=[], libraries=[], env=None, container_target='check')
 Emits a phony target that runs a lb-unit test. More...
 
def 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. More...
 
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='')
 Generate a makefile target prefixed by 'install-test-' followed by the specified workspace name. More...
 
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="1.8", 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. More...
 
def 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. More...
 
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=[])
 Creates a make task to compile an LogicBlox library. More...
 
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)
 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. More...
 
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)
 Copies the given python library into the /lib/python directory when running 'make' and into the /lib/python directory when running 'make install'. More...
 
def python_protobuf (name, srcdir, package='', proto_paths=None, install=True)
 Create a build task that will generate python wrappers from a protobuf protocol file. More...
 
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="1.8", protocols=None, findbugs=False)
 Compiles a jar containing a bloxweb service implementation. More...
 
def target (name, deps)
 Adds a project-specific target with a set of dependencies to the Makefile. More...
 
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

def lbconfig.api.add_task (   task)

Add a build task.

Parameters
taskAn 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.

def lbconfig.api.archive_export_target (   ws_name)

Definition at line 1898 of file api.py.

def lbconfig.api.bin_program (   name)

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

Parameters
nameName of script or executable.

Definition at line 1184 of file api.py.

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.

Parameters
check-targetThe name of the target
commandThe command which will be run
suite_nameThe name of the test.
workspacesAn optional list of workspace names that this program depends on. The workspace must also be specified by the check_lb_workspace function.
librariesThe names of any lb libraries this program depends on. The libraries must be built by the lb_library or check_lb_library function.
servicesA list of services this test depends on.
envA map of environment variables to set before executing the test program.
extra_inputsA list of targets this depends on
container-targetThe target this check will be included in. By default 'check'

Definition at line 1323 of file api.py.

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 = "1.8",
  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.

Parameters
nameName of jarfile, minus extension.
mainName of executable class (has main method) to call to check jar.
srcdirThe directory where the sources are located. Directory can also contain scala files.
srcdirsAs list of directories where the sources are located. Directories can also contain scala files.
classpathA list of jar files used for the java and scala classpath.
srcgenA list of generated src files to also copy into this library
scalaTrue if we want to compile scala code. If we find any scala files in scala_files or srcdir, this is set to True.
scala_filesA list of scala files to compile.
java_filesA list of java files to compile.
depsA list of dependency names to be added to the classpath. These should
javadocA dictionary with the 'title' of the Javadoc. If not set, will not generate Javadoc.
scaladocA dictionary with the 'title' of the Scaladoc. If not set, will not generate Scaladoc.
manual_targetsA list of other executable classes for checking, like main.
resourcesA 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.
servicesA list of services that should be be started before running this jar
workspacesA list of workspace names that need to checked before checking this jar.
java_versionThe Java version to use for compilation.
container_targetThe target that will contain all check targets
javacPath to the java compiler. Defaults to "javac".
scalacPath to the scala compiler. Defaults to "scalac".
findbugsWhether to generate a target to execute findbugs on the build.

Definition at line 743 of file api.py.

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.

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.

Parameters
nameThe 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.
librariesA list of library names to install into the newly created workspace.
native_libsA list of native libraries to install in the workspace.
archivedBoolean - archive and compress the workspace -creates /workspaces/<name>.tgz
init_cmdsAn optional list of commands to be executed after the workspace is created and libraries are installed but before the workspace is exported.
inputAn optional list of make targets that this workspace creation depends on (jars with service implementations, for example)
compressAn optional Boolean value, when set to True will compress the exported workspace
create_cmdOptionally define the exact command used to create the workspace. If this is set, the native_libs option will be ignored.
keepIf archived is true, keep controls whether the original workspace should be kept (true) or deleted (false).

Definition at line 274 of file api.py.

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.

Parameters
workspaceThe 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.
branchThe name of the branch to create.
librariesA list of library names to install into the newly created workspace's master branch.
branch_librariesA list of library names to install into the branch.
native_libsA 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.
archivedBoolean - archive and compress the workspace -creates /workspaces/<name>.tgz
init_cmdsAn optional list of commands to be executed after the workspace is created and libraries are installed but before the workspace is exported.
inputAn optional list of make targets that this workspace creation depends on (jars with service implementations, for example)
compressAn optional Boolean value, when set to True will compress the exported workspace
create_cmdOptionally define the exact command used to create the workspace. If this is set, the native_libs option will be ignored.
keepIf archived is true, keep controls whether the original workspace should be kept (true) or deleted (false).

Definition at line 337 of file api.py.

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 1211 of file api.py.

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 1236 of file api.py.

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>'.

Parameters
filepathThe file to run, relative to the root project directory.
workspacesAn optional list of workspace names that this program depends on. The workspace must also be specified by the check_lb_workspace function.
librariesThe names of any lb libraries this program depends on. The libraries must be built by the lb_library or check_lb_library function.
nameAn optional parameter to change the name of the check target.
servicesA list of services this test depends on.
envA map of environment variables to set before executing the test program.
container-targetThe target this check will be included in. By default 'check'
inputAn optional list of make target names that are required before running the check program.
paramsAn optional string to be appended to the file to run. Usually includes hardcoded parameters to the executable.

Definition at line 1270 of file api.py.

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.

def lbconfig.api.check_ws_success_file (   ws_name)

Definition at line 1893 of file api.py.

def lbconfig.api.config_file (   name)

A configuration file that should be installed into /config.

Definition at line 1414 of file api.py.

def lbconfig.api.copy_file (   src,
  target 
)

A rule to copy a file.

Parameters
srcFile to copy.
targetDestination.

Definition at line 1511 of file api.py.

def lbconfig.api.depends_on (   deps,
  more_deps 
)

Definition at line 51 of file api.py.

def lbconfig.api.dist_dir (   directory)

Make a directory recursively part of a distribution.

Definition at line 1495 of file api.py.

def lbconfig.api.dist_files (   files)

Make a list of files part of the source distribution.

Definition at line 1476 of file api.py.

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

Add a line to the makefile.

Definition at line 96 of file api.py.

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

Remove file on clean.

Definition at line 1543 of file api.py.

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

Remove a workspace on clean.

Parameters
workspaceWorkspace name.
success_fileSuccess_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 1528 of file api.py.

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.

Parameters
nameThe name of the workspace to create and the root name of a workspace archive that is in the /workspaces/ directory.
ws_prefixOptional 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.

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

Install contents of a directory into /destdir.

Parameters
dirnameSource directory to copy from (relative to the directory running make)
destdirTarget directory to copy to. This should be a directory name relative to the install directory.
allow_emptyIf 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 1462 of file api.py.

def lbconfig.api.install_file (   filename,
  destdir 
)

Install a file into /destdir.

Parameters
filenameSource file to copy.
destdirTarget directory to copy to. This should be a relative directory name.

Definition at line 1440 of file api.py.

def lbconfig.api.install_files (   filenames,
  destdir 
)

Install a list of files into /destdir.

Parameters
filenamesA list of files to copy.
destdirTarget directory to copy to. This should be a relative directory name.

Definition at line 1427 of file api.py.

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 = "1.8",
  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.

Parameters
nameName of jarfile, minus extension.
srcdirThe directory where the sources are located. Directory can also contain scala files.
srcdirsAs list of directories where the sources are located. Directories can also contain scala files.
classpathA list of jar files used for the java and scala classpath.
srcgenA list of generated src files to also copy into this library.
javadocA dictionary with the 'title' of the Javadoc. If not set, will not generate Javadoc.
scaladocA dictionary with the 'title' of the Scaladoc. If not set, will not generate Scaladoc.
resourcesA 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.
depsA list of dependency names to be added to the classpath. These should be contained within the dependencies in buildlib_local.py.
installTrue if the jar should be installed into .
scalaTrue if we want to compile scala code. If we find any scala files in scala_files or srcdir, this is set to True.
scala_filesA list of scala files to compile.
java_filesA list of java files to compile.
java_versionThe Java version to use for compilation.
manifestA 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

Parameters
javacPath to the java compiler. Defaults to "javac".
scalacPath to the scala compiler. Defaults to "scalac".
scalac_flagsExtra flags to pass to scalac
javac_flagsExtra flags to pass to javac
sbtBuild using sbt
findbugsWhether to generate a target to execute findbugs on the build.

Definition at line 920 of file api.py.

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.

Parameters
nameRoot name of the protocol (name of the .proto file without the extension).
java_packageThe name of the Java package to use when generating Java files. This should match the "option java_package" specified in the .proto file.
packageThe optional package that will contain the generated code.
srcdirThe directory containing the source .proto file.
proto_pathsOptional list of directories containing required protobuf protocol files used by the named protocol.
installIf True, will install files into .

Definition at line 496 of file api.py.

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.

def lbconfig.api.lb_deployment_dir ( )

Definition at line 43 of file api.py.

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.

Parameters
nameProject name (e.g. foo:bar).
srcdirDirectory that contains the .project file.
srcgenAn 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.
depsAn 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.
installWhether or not this library should be included in the 'make install' task.
generatedWhether or not this library is generated and therefore we should not attempt to determine it's dependencies during the configure step.
install_subdir
post_cmdsOptional list of commands to execute after the library is built.

Definition at line 218 of file api.py.

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.

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

Declare a python module as an lbconfig_plugin.

Parameters
srcdirThe src directory in which to find the root package.
plugin_moduleThe module name for the plugin, for example 'lbconfig.jacoco'.
plugin_depsA 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 1168 of file api.py.

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 1557 of file api.py.

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.

Parameters
nameRoot name of the protocol (name of the .proto file without the extension).
packageThe optional package that will contain the generated code.
srcdirThe directory containing the source .proto file.
java_packageThe (optional) name of the Java package to use when generating Java files. If not specified, Java code is not generated.
lifetimeThe lifetime of the transaction for the datalog predicates.
proto_pathOptional path for protobuf protocol files used by the named protocol. This is deprecated. Use the proto_paths parameter instead.
gen_datalogIf True, will generate datalog files.
gen_javaIf True and java_package is specified, will generate Java files.
outer_classThe name of the java class that contains protobuf code. If None, will use the default.
gen_pythonIf True, will generate python files.
installIf True, will install files into .
proto_pathsOptional list of directories containing required protobuf protocol files used by the named protocol. The current dir and /nix/store/9mbdhby6mhqgkvwfc76v6sjvnwz34dgc-lb-database-4.8.2-3fe6566d5dc876fa5250d35a771990ef0a68d640/lib/protobuf are already included.

Definition at line 546 of file api.py.

def lbconfig.api.python_library (   package_name,
  srcdir = None,
  srcgen = [],
  python_files = None 
)

Copies the given python library into the /lib/python directory when running 'make' and into the /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'.

Parameters
package_nameThe root package name.
srcdirThe src directory in which to find the root package. Defaults to the root directory.
srcgenA list of generated src files to also copy into this library.
python_filesA 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 1109 of file api.py.

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.

Parameters
nameRoot name of the protocol (name of the .proto file without the extension).
packageThe optional package that will contain the generated code.
srcdirThe directory containing the source .proto file.
proto_pathsOptional list of directories containing required protobuf protocol files used by the named protocol.
installIf True, will install files into .

Definition at line 463 of file api.py.

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.

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

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

Parameters
outputA list of output files, or a string with one output file.
inputA list of input files, or a string with one input file.
commmandsA list of commands to invoke that should make the output files.
phonyshould be set to True if the output is a phony one and not really a file.
descriptionA descriptive string to output when building the target in place of the commands being echoed.

Definition at line 137 of file api.py.

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 = "1.8",
  protocols = None,
  findbugs = False 
)

Compiles a jar containing a bloxweb service implementation.

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

Parameters
protocolsList of protobuf protocol files that will be used to generate Java classes compiled into the jar.

Definition at line 800 of file api.py.

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.

Parameters
nameName of the Makefile target.
depsList of Makefile targets that the new target depends on.

Definition at line 153 of file api.py.

def lbconfig.api.variable (   name,
  value 
)

Declare a variable in Makefile.

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

Parameters
nameName of variable.
valueValue of variable.

Definition at line 112 of file api.py.

def lbconfig.api.with_arg (   args,
  kwargs 
)

Definition at line 65 of file api.py.

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 1582 of file api.py.

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

private

Close the makefile

Definition at line 1635 of file api.py.

def lbconfig.api.write_projects ( )

private

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

Definition at line 1599 of file api.py.

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.

Parameters
nameThe 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.
librariesAn array of library names to install into the newly created workspace.
init_cmdsAn optional list of commands to be executed after the workspace is created and libraries are installed but before the workspace is exported.
inputAn optional list of make targets that this workspace creation depends on (jars with service implementations, for example)
compressAn optional Boolean value, when set to true, will compress the exported workspace
keepIf 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

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.

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.