aQute.bnd.build
Class Workspace

java.lang.Object
  extended by aQute.bnd.osgi.Domain
      extended by aQute.bnd.osgi.Processor
          extended by aQute.bnd.build.Workspace
All Implemented Interfaces:
Constants, Registry, Report, Reporter, Closeable, Iterable<String>

public class Workspace
extends Processor


Nested Class Summary
 
Nested classes/interfaces inherited from class aQute.bnd.osgi.Processor
Processor.CL, Processor.FileLine
 
Nested classes/interfaces inherited from interface aQute.service.reporter.Reporter
Reporter.SetLocation
 
Nested classes/interfaces inherited from interface aQute.service.reporter.Report
Report.Location
 
Field Summary
static String BNDDIR
           
static String BUILDFILE
           
static String CACHEDIR
           
static String CNFDIR
           
static String EXT
           
 
Fields inherited from class aQute.bnd.osgi.Processor
LIST_SPLITTER
 
Fields inherited from interface aQute.bnd.osgi.Constants
BASELINE, BASELINEREPO, BLUEPRINT_TIMEOUT_ATTRIBUTE, BLUEPRINT_WAIT_FOR_DEPENDENCIES_ATTRIBUTE, BND_ADDXMLTOTEST, BND_LASTMODIFIED, BNDDRIVER, BNDDRIVER_ANT, BNDDRIVER_BND, BNDDRIVER_ECLIPSE, BNDDRIVER_GRADLE, BNDDRIVER_GRADLE_NATIVE, BNDDRIVER_INTELLIJ, BNDDRIVER_MAVEN, BNDDRIVER_OSMORC, BNDDRIVER_SBT, BUILDFILES, BUILDPACKAGES, BUILDPATH, BUMPPOLICY, BUNDLE_ACTIVATIONPOLICY, BUNDLE_ACTIVATOR, BUNDLE_BLUEPRINT, BUNDLE_CATEGORY, BUNDLE_CLASSPATH, BUNDLE_CONTACTADDRESS, BUNDLE_CONTRIBUTORS, BUNDLE_COPYRIGHT, BUNDLE_DESCRIPTION, BUNDLE_DEVELOPERS, BUNDLE_DOCURL, BUNDLE_ICON, BUNDLE_LICENSE, BUNDLE_LOCALIZATION, BUNDLE_MANIFESTVERSION, BUNDLE_NAME, BUNDLE_NATIVECODE, BUNDLE_REQUIREDEXECUTIONENVIRONMENT, BUNDLE_SPECIFIC_HEADERS, BUNDLE_SYMBOLIC_NAME_ATTRIBUTE, BUNDLE_SYMBOLICNAME, BUNDLE_UPDATELOCATION, BUNDLE_VENDOR, BUNDLE_VERSION, BUNDLE_VERSION_ATTRIBUTE, CLASSPATH, COMMAND_DIRECTIVE, COMPILER_SOURCE, COMPILER_TARGET, COMPONENT_ACTIVATE, COMPONENT_CONFIGURATION_POLICY, COMPONENT_DEACTIVATE, COMPONENT_DESCRIPTORS, COMPONENT_DESIGNATE, COMPONENT_DESIGNATEFACTORY, COMPONENT_DYNAMIC, COMPONENT_ENABLED, COMPONENT_FACTORY, COMPONENT_GREEDY, COMPONENT_IMMEDIATE, COMPONENT_IMPLEMENTATION, COMPONENT_MODIFIED, COMPONENT_MULTIPLE, COMPONENT_NAME, COMPONENT_NAMESPACE, COMPONENT_OPTIONAL, COMPONENT_PROPERTIES, COMPONENT_PROVIDE, COMPONENT_SERVICEFACTORY, COMPONENT_VERSION, componentDirectives, CONDITIONAL_PACKAGE, CONDITIONALPACKAGE, CONDUIT, CONSUMER_POLICY, CONTRACT, CREATED_BY, CURRENT_PACKAGE, CURRENT_USES, CURRENT_VERSION, DEBUG, DEFAULT_BAR_EXTENSION, DEFAULT_BND_EXTENSION, DEFAULT_BNDRUN_EXTENSION, DEFAULT_CHARSET, DEFAULT_DO_NOT_COPY, DEFAULT_JAR_EXTENSION, DEFAULT_LAUNCHER_BSN, DEFAULT_PREPROCESSS_MATCHERS, DEFAULT_PROP_BIN_DIR, DEFAULT_PROP_SRC_DIR, DEFAULT_PROP_TARGET_DIR, DEFAULT_PROP_TESTBIN_DIR, DEFAULT_PROP_TESTSRC_DIR, DEFAULT_TESTER_BSN, DEPENDSON, DEPLOY, DEPLOYREPO, DESCRIPTION_ATTRIBUTE, DIFFIGNORE, DIGESTS, directives, DONOTCOPY, DSANNOTATIONS, DUPLICATE_MARKER, DYNAMICIMPORT_PACKAGE, EEPROFILE, EEPROFILE_AUTO_ATTRIBUTE, EFFECTIVE_DIRECTIVE, EMBEDDED_REPO, EMPTY, EMPTY_HEADER, EXCLUDE_DIRECTIVE, EXPERIMENTS, EXPORT, EXPORT_CONTENTS, EXPORT_PACKAGE, EXPORT_SERVICE, EXTENSION, EXTENSION_DIRECTIVE, FAIL_OK, FILTER_DIRECTIVE, FIXUPMESSAGES, FIXUPMESSAGES_IS_DIRECTIVE, FIXUPMESSAGES_IS_ERROR, FIXUPMESSAGES_IS_IGNORE, FIXUPMESSAGES_IS_WARNING, FIXUPMESSAGES_REPLACE_DIRECTIVE, FIXUPMESSAGES_RESTRICT_DIRECTIVE, FRAGMENT_ATTACHMENT_DIRECTIVE, FRAGMENT_HOST, FROM_DIRECTIVE, GESTALT, GESTALT_BATCH, GESTALT_CI, GESTALT_INTERACTIVE, GESTALT_OFFLINE, GESTALT_SHELL, headers, IGNORE_PACKAGE, IMPORT_DIRECTIVE, IMPORT_PACKAGE, IMPORT_PRIVATE, IMPORT_REFERENCE, IMPORT_SERVICE, importDirectives, INCLUDE, INCLUDE_DIRECTIVE, INCLUDE_RESOURCE, INCLUDERESOURCE, INVALIDFILENAMES, JAVAAGENT, JIDENTIFIER, KEYSTORE_LOCATION_DIRECTIVE, KEYSTORE_PASSWORD_DIRECTIVE, KEYSTORE_PROVIDER_DIRECTIVE, LANGUAGE_ATTRIBUTE, LAUNCHER_PLUGIN, LIB_DIRECTIVE, LINK_ATTRIBUTE, LITERAL_ATTRIBUTE, MAKE, MANDATORY_DIRECTIVE, MANIFEST, MANIFEST_NAME, META_PERSISTENCE, METAPACKAGES, METATYPE, METATYPE_ANNOTATIONS, NAME_ATTRIBUTE, NAMESECTION, NAMESPACE_STEM, NO_IMPORT_DIRECTIVE, NOANNOTATIONS, NOBUILDINCACHE, NOBUNDLES, NODEFAULTVERSION, NOEE, NOEXTRAHEADERS, NOJUNIT, NOJUNITOSGI, NOMANIFEST, NONE, NOUSES, options, OSNAME_ATTRIBUTE, OSVERSION_ATTRIBUTE, OUTPUT, OUTPUTMASK, PACKAGE, PACKAGE_JPM, PATH_DIRECTIVE, PEDANTIC, PLUGIN, PLUGINPATH, PLUGINPATH_SHA1_ATTR, PLUGINPATH_URL_ATTR, POM, PREPROCESSMATCHERS, PRESENCE_DIRECTIVE, PRIVATE_DIRECTIVE, PRIVATE_PACKAGE, PRIVATEPACKAGE, PROCESSOR_ATTRIBUTE, PROFILE, PROVIDE_CAPABILITY, PROVIDE_DIRECTIVE, PROVIDER_POLICY, PROVIDER_TYPE_DIRECTIVE, RELEASEREPO, REMOVE_ATTRIBUTE_DIRECTIVE, REMOVEHEADERS, REPORTNEWER, REPOSITORIES, REQUIRE_BND, REQUIRE_BUNDLE, REQUIRE_CAPABILITY, RESOLUTION_DIRECTIVE, RESOLVE, RESOURCEONLY, RUNBLACKLIST, RUNBUILDS, RUNBUNDLES, RUNEE, RUNENV, RUNFRAMEWORK, RUNFRAMEWORK_NONE, RUNFRAMEWORK_SERVICES, RUNFW, RUNJDB, RUNNOREFERENCES, RUNPATH, RUNPATH_LAUNCHER_DIRECTIVE, RUNPATH_MAIN_DIRECTIVE, RUNPROGRAMARGS, RUNPROPERTIES, RUNREPOS, RUNREQUIRE, RUNREQUIRES, RUNSTORAGE, RUNSYSTEMCAPABILITIES, RUNSYSTEMPACKAGES, RUNTIMEOUT, RUNTRACE, RUNVM, SAVEMANIFEST, SELECTION_FILTER_ATTRIBUTE, SERVICE_COMPONENT, SET_COMPONENT_DIRECTIVES, SET_COMPONENT_DIRECTIVES_1_1, SET_COMPONENT_DIRECTIVES_1_2, SIGN, SIGN_PASSWORD_DIRECTIVE, SIGNATURE_TEST, SINGLETON_DIRECTIVE, SIZE_ATTRIBUTE, SNAPSHOT, SOURCEPATH, SOURCES, SPECIFICATION_VERSION, SPLIT_PACKAGE_DIRECTIVE, STRICT, SUB, SYSTEMPROPERTIES, TESTCASES, TESTCONTINUOUS, TESTER_PLUGIN, TESTPACKAGES, TESTPATH, TESTREPORT, TESTSOURCES, TESTSUITES, TESTUNRESOLVED, TOOL, UNDERTEST, UPTO, USES_DIRECTIVE, USES_USES, VALID_PROPERTY_TYPES, VERBOSE, VERSION_ATTR_LATEST, VERSION_ATTR_PROJECT, VERSION_ATTR_SNAPSHOT, VERSION_ATTRIBUTE, VERSION_FILTER, VISIBILITY_DIRECTIVE, WAB, WABLIB
 
Constructor Summary
Workspace(File dir)
           
Workspace(File dir, String bndDir)
           
 
Method Summary
 String _driver(String[] args)
          Macro to return the driver.
 String _gestalt(String[] args)
          The macro to access the gestalt
 String _global(String[] args)
          Provide access to the global settings of this machine.
 Object _repodigests(String[] args)
          Return the repository signature digests.
 String _user(String[] args)
           
 String _workspace(String[] args)
           
 void addCommand(String menu, Action action)
           
protected  void addExtensions(Set<Object> list)
          Add any extensions listed
static void addGestalt(String part, Attrs attrs)
          Add a gestalt to all workspaces.
 boolean addPlugin(Class<?> plugin, String alias, Map<String,String> parameters, boolean force)
          Add a plugin
 void bracket(boolean begin)
           
 void changedFile(File f)
          Inform any listeners that we changed a file (created/deleted/changed).
 void checkStructure()
           
 void close()
           
 Project createProject(String name)
          Create a project in this workspace
static Workspace createWorkspace(File wsdir)
          Create a new Workspace
 void fillActions(Map<String,Action> all)
           
static Workspace findWorkspace(File base)
          /* Return the nearest workspace
 Collection<Project> getAllProjects()
           
 File getBuildDir()
           
 Collection<Project> getBuildOrder()
           
 File getCache(String name)
           
 Collection<Project> getCurrentProjects()
           
static Processor getDefaults()
           
 String getDriver()
          Get the bnddriver, can be null if not set.
 Parameters getGestalt()
          Get the attrs for a gestalt part
 Attrs getGestalt(String part)
          Get the attrs for a gestalt part
 Maven getMaven()
           
static Project getProject(File projectDir)
          This static method finds the workspace and creates a project (or returns an existing project)
 Project getProject(String bsn)
           
 List<RepositoryPlugin> getRepositories()
           
 RepositoryPlugin getRepository(String repo)
           
static Run getRun(File file)
           
static Workspace getWorkspace(File parent)
           
static Workspace getWorkspace(File parent, String bndDir)
           
static Workspace getWorkspace(String path)
           
 WorkspaceRepository getWorkspaceRepository()
          Return the workspace repo
static Workspace getWorkspaceWithoutException(File parent)
           
 boolean isOffline()
          Return if we're in offline mode.
 boolean isPresent(String name)
           
 boolean isValid()
           
 void propertiesChanged()
           
 boolean refresh()
           
 void removeCommand(String menu)
           
 boolean removePlugin(String alias)
           
 void report(Map<String,Object> table)
          Report details of this workspace
static void setDriver(String driver)
          Set the driver of this environment
 Workspace setOffline(boolean on)
           
protected  void setTypeSpecificPlugins(Set<Object> list)
           
 void signal()
           
 void signal(Reporter reporter)
           
 void syncCache()
           
 String toString()
          Printout of the status of this processor for toString()
 
Methods inherited from class aQute.bnd.osgi.Processor
_basedir, _native_capability, _propertiesdir, _propertiesname, _random, addBasicPlugin, addClose, addIncluded, addProperties, addProperties, append, appendPath, begin, beginHandleErrors, check, clear, concat, customize, doAttrbutes, doIncludeFile, doIncludeFile, endHandleErrors, error, error, exception, exists, findHeader, findHeader, forceRefresh, formatArrays, get, get, getBase, getClass, getDuration, getErrors, getExecutor, getFile, getFile, getFlattenedProperties, getFlattenedProperties, getHeader, getHeader, getIncluded, getInfo, getInfo, getJarFromName, getLine, getLoader, getLocation, getMacroDomains, getManifestAsProperties, getParent, getPlugin, getPlugins, getPlugins, getProperties, getPropertiesFile, getProperty, getProperty, getProperty, getPropertyKeys, getReplacer, getTop, getUnprocessedProperty, getWarnings, is, isDuplicate, isExceptions, isFailOk, isMissingPlugin, isOk, isPedantic, isPerfect, isTrace, isTrue, iterator, join, join, join, join, join, keySet, lastModified, loadPlugins, loadProperties, makePrintable, merge, mergeProperties, mergeProperties, mergeProperties, mergeProperties, newHashMap, newList, newList, newMap, newMap, newSet, newSet, normalize, normalize, parseHeader, parseHeader, printClause, printClauses, printClauses, printExceptionSummary, printStackTrace, progress, progress, quote, read, removeBasicPlugin, removeClose, removeDuplicateMarker, replaceAll, replaceExtension, report, set, setBase, setExceptions, setFileMustExist, setForceLocal, setParent, setPedantic, setProperties, setProperties, setProperties, setProperty, setTrace, since, split, split, split, trace, unsetProperty, updateModified, use, warning
 
Methods inherited from class aQute.bnd.osgi.Domain
domain, domain, domain, domain, getBundleActivator, getBundleClasspath, getBundleClassPath, getBundleRequiredExecutionEnvironment, getBundleSymbolicName, getBundleVersion, getDynamicImportPackage, getExportContents, getExportPackage, getFragmentHost, getIcon, getImportPackage, getIncludeResource, getParameters, getParameters, getParameters, getParameters, getPrivatePackage, getProvideCapability, getRequireBundle, getRequireCapability, isSources, setBundleActivator, setBundleClasspath, setBundleRequiredExecutionEnvironment, setBundleSymbolicName, setBundleVersion, setBundleVersion, setConditionalPackage, setExportPackage, setFailOk, setImportPackage, setIncludeResource, setPrivatePackage, setSources, setTranslation, translate, translate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EXT

public static final String EXT
See Also:
Constant Field Values

BUILDFILE

public static final String BUILDFILE
See Also:
Constant Field Values

CNFDIR

public static final String CNFDIR
See Also:
Constant Field Values

BNDDIR

public static final String BNDDIR
See Also:
Constant Field Values

CACHEDIR

public static final String CACHEDIR
See Also:
Constant Field Values
Constructor Detail

Workspace

public Workspace(File dir)
          throws Exception
Throws:
Exception

Workspace

public Workspace(File dir,
                 String bndDir)
          throws Exception
Throws:
Exception
Method Detail

getProject

public static Project getProject(File projectDir)
                          throws Exception
This static method finds the workspace and creates a project (or returns an existing project)

Parameters:
projectDir -
Returns:
Throws:
Exception

getDefaults

public static Processor getDefaults()

getWorkspace

public static Workspace getWorkspace(File parent)
                              throws Exception
Throws:
Exception

getWorkspaceWithoutException

public static Workspace getWorkspaceWithoutException(File parent)
                                              throws Exception
Throws:
Exception

findWorkspace

public static Workspace findWorkspace(File base)
                               throws Exception
/* Return the nearest workspace

Throws:
Exception

getWorkspace

public static Workspace getWorkspace(File parent,
                                     String bndDir)
                              throws Exception
Throws:
Exception

getProject

public Project getProject(String bsn)
                   throws Exception
Throws:
Exception

isPresent

public boolean isPresent(String name)

getCurrentProjects

public Collection<Project> getCurrentProjects()

refresh

public boolean refresh()
Overrides:
refresh in class Processor

propertiesChanged

public void propertiesChanged()
Overrides:
propertiesChanged in class Processor

_workspace

public String _workspace(String[] args)

addCommand

public void addCommand(String menu,
                       Action action)

removeCommand

public void removeCommand(String menu)

fillActions

public void fillActions(Map<String,Action> all)

getAllProjects

public Collection<Project> getAllProjects()
                                   throws Exception
Throws:
Exception

changedFile

public void changedFile(File f)
Inform any listeners that we changed a file (created/deleted/changed).

Parameters:
f - The changed file

bracket

public void bracket(boolean begin)

signal

public void signal(Reporter reporter)

signal

public void signal()
Overrides:
signal in class Processor

syncCache

public void syncCache()
               throws Exception
Throws:
Exception

getRepositories

public List<RepositoryPlugin> getRepositories()

getBuildOrder

public Collection<Project> getBuildOrder()
                                  throws Exception
Throws:
Exception

getWorkspace

public static Workspace getWorkspace(String path)
                              throws Exception
Throws:
Exception

getMaven

public Maven getMaven()

setTypeSpecificPlugins

protected void setTypeSpecificPlugins(Set<Object> list)
Overrides:
setTypeSpecificPlugins in class Processor

addExtensions

protected void addExtensions(Set<Object> list)
Add any extensions listed

Overrides:
addExtensions in class Processor
Parameters:
list -
rri -

isOffline

public boolean isOffline()
Return if we're in offline mode. Offline mode is defined as an environment where nobody tells us the resources are out of date (refresh or changed). This is currently defined as having bndlisteners.

Returns:

setOffline

public Workspace setOffline(boolean on)

_global

public String _global(String[] args)
               throws Exception
Provide access to the global settings of this machine.

Throws:
Exception
UnknownHostException

_user

public String _user(String[] args)
             throws Exception
Throws:
Exception

_repodigests

public Object _repodigests(String[] args)
                    throws Exception
Return the repository signature digests. These digests are a unique id for the contents of the repository

Throws:
Exception

getRun

public static Run getRun(File file)
                  throws Exception
Throws:
Exception

report

public void report(Map<String,Object> table)
            throws Exception
Report details of this workspace

Overrides:
report in class Processor
Throws:
Exception

getCache

public File getCache(String name)

getWorkspaceRepository

public WorkspaceRepository getWorkspaceRepository()
Return the workspace repo


checkStructure

public void checkStructure()

getBuildDir

public File getBuildDir()

isValid

public boolean isValid()

getRepository

public RepositoryPlugin getRepository(String repo)

close

public void close()
Specified by:
close in interface Closeable
Overrides:
close in class Processor

getDriver

public String getDriver()
Get the bnddriver, can be null if not set. The overallDriver is the environment that runs this bnd.


setDriver

public static void setDriver(String driver)
Set the driver of this environment


_driver

public String _driver(String[] args)
Macro to return the driver. Without any arguments, we return the name of the driver. If there are arguments, we check each of the arguments against the name of the driver. If it matches, we return the driver name. If none of the args match the driver name we return an empty string (which is false).


addGestalt

public static void addGestalt(String part,
                              Attrs attrs)
Add a gestalt to all workspaces. The gestalt is a set of parts describing the environment. Each part has a name and optionally attributes. This method adds a gestalt to the VM. Per workspace it is possible to augment this.


getGestalt

public Attrs getGestalt(String part)
Get the attrs for a gestalt part


getGestalt

public Parameters getGestalt()
Get the attrs for a gestalt part


_gestalt

public String _gestalt(String[] args)
The macro to access the gestalt

$ gestalt;part[;key[;value]]


toString

public String toString()
Description copied from class: Processor
Printout of the status of this processor for toString()

Overrides:
toString in class Processor

createProject

public Project createProject(String name)
                      throws Exception
Create a project in this workspace

Throws:
Exception

createWorkspace

public static Workspace createWorkspace(File wsdir)
                                 throws Exception
Create a new Workspace

Parameters:
opts -
wsdir -
Throws:
Exception

addPlugin

public boolean addPlugin(Class<?> plugin,
                         String alias,
                         Map<String,String> parameters,
                         boolean force)
                  throws Exception
Add a plugin

Parameters:
plugin -
Throws:
Exception

removePlugin

public boolean removePlugin(String alias)


Copyright © 2014 aQute SARL. All rights reserved.