public class SearchPathDependencyResolver
extends java.lang.Object
SearchPathDependenceyResolver
class is used to resolve build dependencies identified by the DBB dependency scanners
to physical source files on the local file system. The returned list of physical dependencies from the resolveDependencies
method can then be used to copy the source files from the z/OS Unix file system to SYSLIB data sets to be used when compiling the program.
Dependency search path
The SearchPathDependenceyResolver
constructor requires a searchPath argument that is a simple formatted String used to resolve logical dependencies
in a source file (ex. COPY ABC) to physical files in z/OS Unix file system (ex. /u/usr1/build/repo/abc.cpy). Examples of dependency search paths are listed below.
// Search workspace or archive file using a specific file extension
String copybookSearch = "search:/u/build/repo?path=** /*.cpy";
String copybookArchiveSearch = "search:/u/build/lib/copybooks.tar.gz?path=** /*.cpy";
// Targeted search with specific path
String copybookSearch = "search:/u/build/repo?path=MortgageApplication/copybook/*.cpy";
String copybookArchiveSearch = "search:/u/build/lib/copybooks.tar.gz?path=copybook/*.cpy";
// Search paths using dependency filters
String syslibFilterSearch = "search:[SYSLIB]/u/build/repo?path=${application}/copybook/*.cpy";
String syslibCopylibFilterSearch = search:[SYSLIB,COPYLIB]/u/build/repo?path=${application}/copybook/*.cpy";
String linkCategoryFilterSearch = search:[:LINK]/u/build/repo?path=${application}/cobol;${application}/link";
String lnameWildcardFilterSearch = search:[::EPSN*,EPSC*]/u/build/repo?path=${application}/copybook/*.cpy";
// Dependency exclude list filter search
String lnameExcludes = "^DFH*,^CEE*,^XCH*,^XWS*,^SQLCA,^DSN*";
String excludeDependencyFilterSearch = "search:[SYSLIB::" + lnameExcludes + "]/u/build/repo?path=${application}/copybook/";
For more information about the Dependency search path see DBB documentation on How to manage build dependencies
Constructor and Description |
---|
SearchPathDependencyResolver(java.lang.String searchPath)
Used to create an instance of the
SearchPathDependencyResolver |
SearchPathDependencyResolver(java.lang.String searchPath,
boolean disableCache)
Used to create an instance of the
SearchPathDependencyResolver |
Modifier and Type | Method and Description |
---|---|
static LogicalFile |
getArchivedLogicalFile(java.lang.String file,
java.lang.String archive)
Returns the logical file for the source file in an archive from the logical file cache.
|
static LogicalFile |
getArchivedLogicalFile(java.lang.String file,
java.lang.String archive,
boolean disableCache)
Returns the logical file for the source file in an archive from the logical file cache.
|
static LogicalFile |
getLogicalFile(java.lang.String file,
java.lang.String sourceDir)
Returns the logical file for the source file from the logical file cache.
|
static LogicalFile |
getLogicalFile(java.lang.String file,
java.lang.String sourceDir,
boolean disableCache)
Returns the logical file for the source file from the logical file cache.
|
java.lang.String |
getSearchPath()
Returns the dependency search path for the dependency resolver
|
java.util.List<com.ibm.dbb.dependency.internal.SearchPath> |
getSearchPathList() |
boolean |
isDisableCache()
Returns
true if the LogicalFile cache is disabled. |
java.util.List<PhysicalDependency> |
resolveDependencies(java.lang.String file,
java.lang.String sourceDir)
Resolves logical dependencies in a source file (ex.
|
LogicalFile |
resolveSubsystems(java.lang.String file,
java.lang.String sourceDir)
Updates the source file's logical file subsystem flags i.e.
|
public SearchPathDependencyResolver(java.lang.String searchPath)
SearchPathDependencyResolver
searchPath
- Dependency search pathpublic SearchPathDependencyResolver(java.lang.String searchPath, boolean disableCache)
SearchPathDependencyResolver
searchPath
- Dependency search pathdisableCache
- Used to disable the logical file cache.public java.util.List<PhysicalDependency> resolveDependencies(java.lang.String file, java.lang.String sourceDir) throws BuildException, DependencyException, java.io.IOException
file
- The source file to look up or scansourceDir
- The source directory which contains the source filePhysicalDependency
for each source file logical dependencyBuildException
- If no scanner for the source file is not registeredDependencyException
- If an error occurs during dependency resolutionjava.io.IOException
- If an IO error occurs during dependency resolutionpublic LogicalFile resolveSubsystems(java.lang.String file, java.lang.String sourceDir) throws BuildException, DependencyException, java.io.IOException
isCICS()
, isSQL()
, isDLI()
, isMQ()
with information from resolved
dependency logical file subsystem flags that are set to true. This is needed when a program's EXEC SQL
or EXEC CICS
statements reside in COBOL copy books or PL/I
include files rather in the program's source file.
This method uses the #resolveDependencies()
method to retrieve the file's resolved physical dependencies.file
- The source file to identify subsystems usedsourceDir
- The source directory which contains the source fileLogicalFile
with updated subsystem flagsBuildException
- If no scanner for the source file is not registeredDependencyException
- If an error occurs during dependency resolutionjava.io.IOException
- If an IO error occurs during dependency resolutionpublic static LogicalFile getLogicalFile(java.lang.String file, java.lang.String sourceDir) throws BuildException
DependencyScannerRegistry
to identify which scanner to scan the file with.
If no scanner is registered for the source file's extension then a BuildException
is thrownfile
- The source file to look up or scansourceDir
- The source directory which contains the source fileBuildException
- If no scanner for the source file is not registeredpublic static LogicalFile getLogicalFile(java.lang.String file, java.lang.String sourceDir, boolean disableCache) throws BuildException
DependencyScannerRegistry
to identify which scanner to scan the file with.
If no scanner is registered for the source file's extension then a BuildException
is thrownfile
- The source file to look up or scansourceDir
- The source directory which contains the source filedisableCache
- Used to disable the logical file cache.BuildException
- If no scanner for the source file is not registeredpublic static LogicalFile getArchivedLogicalFile(java.lang.String file, java.lang.String archive) throws BuildException
DependencyScannerRegistry
to identify which scanner to scan the file with.
If no scanner is registered for the source file's extension then a BuildException
is thrownfile
- The source file to look up or scanarchive
- The archive file (*.tar, *.tar.gz) the source file is located inBuildException
- If no scanner for the source file is not registeredpublic static LogicalFile getArchivedLogicalFile(java.lang.String file, java.lang.String archive, boolean disableCache) throws BuildException
DependencyScannerRegistry
to identify which scanner to scan the file with.
If no scanner is registered for the source file's extension then a BuildException
is thrownfile
- The source file to look up or scanarchive
- The archive file (*.tar, *.tar.gz) the source file is located indisableCache
- Used to disable the logical file cache.BuildException
- If no scanner for the source file is not registeredpublic boolean isDisableCache()
true
if the LogicalFile cache is disabled.public java.lang.String getSearchPath()
public java.util.List<com.ibm.dbb.dependency.internal.SearchPath> getSearchPathList() throws BuildException
BuildException
<IBM Copyright © 2018 IBM Corp. All Rights Reserved.