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)
Executes
DependencyUtilities.getArchivedLogicalFile(java.lang.String, java.lang.String, boolean) with the logical file cache enabled. |
static LogicalFile |
getArchivedLogicalFile(java.lang.String file,
java.lang.String archive,
boolean disableCache)
Executes
DependencyUtilities.getArchivedLogicalFile(java.lang.String, java.lang.String, boolean) . |
static LogicalFile |
getLogicalFile(java.lang.String file,
java.lang.String sourceDir)
Executes
DependencyUtilities.getLogicalFile(java.lang.String, java.lang.String, boolean) with the logical file cache enabled. |
static LogicalFile |
getLogicalFile(java.lang.String file,
java.lang.String sourceDir,
boolean disableCache)
Executes
DependencyUtilities.getLogicalFile(java.lang.String, java.lang.String, boolean) . |
java.lang.String |
getSearchPath()
Returns the dependency search path for the dependency resolver
|
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 relative path to the source file to look up or scan, or the absolute path if sourceDir is null.sourceDir
- The source directory which contains the source file, or null to use an absolute file path.PhysicalDependency
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
DependencyUtilities.getLogicalFile(java.lang.String, java.lang.String, boolean)
with the logical file cache enabled.file
- The source file to look up or scansourceDir
- The source directory which contains the source fileLogicalFile
BuildException
- If no scanner for the source file is registeredDependencyUtilities.getLogicalFile(java.lang.String, java.lang.String, boolean)
public static LogicalFile getLogicalFile(java.lang.String file, java.lang.String sourceDir, boolean disableCache) throws BuildException
DependencyUtilities.getLogicalFile(java.lang.String, java.lang.String, boolean)
.file
- The source file to look up or scansourceDir
- The source directory which contains the source filedisableCache
- Used to disable the logical file cacheLogicalFile
BuildException
- If no scanner for the source file is registeredDependencyUtilities.getLogicalFile(java.lang.String, java.lang.String, boolean)
public static LogicalFile getArchivedLogicalFile(java.lang.String file, java.lang.String archive) throws BuildException
DependencyUtilities.getArchivedLogicalFile(java.lang.String, java.lang.String, boolean)
with the logical file cache enabled.file
- The source file to look up or scanarchive
- The archive file (*.tar, *.tar.gz) the source file is located inLogicalFile
BuildException
- If no scanner for the source file's extension is registeredDependencyUtilities.getArchivedLogicalFile(java.lang.String, java.lang.String, boolean)
public static LogicalFile getArchivedLogicalFile(java.lang.String file, java.lang.String archive, boolean disableCache) throws BuildException
DependencyUtilities.getArchivedLogicalFile(java.lang.String, java.lang.String, boolean)
.file
- 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.LogicalFile
BuildException
- If no scanner for the source file's extension is registeredDependencyUtilities.getArchivedLogicalFile(java.lang.String, java.lang.String, boolean)
public boolean isDisableCache()
true
if the LogicalFile cache is disabled.public java.lang.String getSearchPath()
<IBM Copyright © 2018 IBM Corp. All Rights Reserved.