Class SearchPathDependencyResolver
- java.lang.Object
-
- com.ibm.dbb.dependency.SearchPathDependencyResolver
-
public class SearchPathDependencyResolver extends java.lang.Object
TheSearchPathDependenceyResolver
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
TheSearchPathDependenceyResolver
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 Summary
Constructors Constructor Description SearchPathDependencyResolver(java.lang.String searchPath)
Used to create an instance of theSearchPathDependencyResolver
SearchPathDependencyResolver(java.lang.String searchPath, boolean disableCache)
Used to create an instance of theSearchPathDependencyResolver
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LogicalFile
getArchivedLogicalFile(java.lang.String file, java.lang.String archive)
ExecutesDependencyUtilities.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)
ExecutesDependencyUtilities.getArchivedLogicalFile(java.lang.String, java.lang.String, boolean)
.static LogicalFile
getLogicalFile(java.lang.String file, java.lang.String sourceDir)
ExecutesDependencyUtilities.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)
ExecutesDependencyUtilities.getLogicalFile(java.lang.String, java.lang.String, boolean)
.java.lang.String
getSearchPath()
Returns the dependency search path for the dependency resolverboolean
isDisableCache()
Returnstrue
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.
-
-
-
Constructor Detail
-
SearchPathDependencyResolver
public SearchPathDependencyResolver(java.lang.String searchPath)
Used to create an instance of theSearchPathDependencyResolver
- Parameters:
searchPath
- Dependency search path
-
SearchPathDependencyResolver
public SearchPathDependencyResolver(java.lang.String searchPath, boolean disableCache)
Used to create an instance of theSearchPathDependencyResolver
- Parameters:
searchPath
- Dependency search pathdisableCache
- Used to disable the logical file cache.
-
-
Method Detail
-
resolveDependencies
public java.util.List<PhysicalDependency> resolveDependencies(java.lang.String file, java.lang.String sourceDir) throws BuildException, DependencyException, java.io.IOException
Resolves 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) using the searchPath that this class was instantiated with. This method uses themethod to retrieve the file's list of {@link LogicalDependency} to resolve.
- Parameters:
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.- Returns:
- a list of
PhysicalDependency
for each source file logical dependency - Throws:
BuildException
- 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 resolution
-
resolveSubsystems
public LogicalFile resolveSubsystems(java.lang.String file, java.lang.String sourceDir) throws BuildException, DependencyException, java.io.IOException
Updates the source file's logical file subsystem flags i.e.isCICS()
,isSQL()
,isDLI()
,isMQ()
with information from resolved dependency logical file subsystem flags that are set to true. This is needed when a program'sEXEC SQL
orEXEC 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.- Parameters:
file
- The source file to identify subsystems usedsourceDir
- The source directory which contains the source file- Returns:
- the program's
LogicalFile
with updated subsystem flags - Throws:
BuildException
- 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 resolution
-
getLogicalFile
public static LogicalFile getLogicalFile(java.lang.String file, java.lang.String sourceDir) throws BuildException
ExecutesDependencyUtilities.getLogicalFile(java.lang.String, java.lang.String, boolean)
with the logical file cache enabled.- Parameters:
file
- The source file to look up or scansourceDir
- The source directory which contains the source file- Returns:
- the scanned
LogicalFile
- Throws:
BuildException
- If no scanner for the source file is registered- See Also:
DependencyUtilities.getLogicalFile(java.lang.String, java.lang.String, boolean)
-
getLogicalFile
public static LogicalFile getLogicalFile(java.lang.String file, java.lang.String sourceDir, boolean disableCache) throws BuildException
ExecutesDependencyUtilities.getLogicalFile(java.lang.String, java.lang.String, boolean)
.- Parameters:
file
- The source file to look up or scansourceDir
- The source directory which contains the source filedisableCache
- Used to disable the logical file cache- Returns:
- the scanned
LogicalFile
- Throws:
BuildException
- If no scanner for the source file is registered- See Also:
DependencyUtilities.getLogicalFile(java.lang.String, java.lang.String, boolean)
-
getArchivedLogicalFile
public static LogicalFile getArchivedLogicalFile(java.lang.String file, java.lang.String archive) throws BuildException
ExecutesDependencyUtilities.getArchivedLogicalFile(java.lang.String, java.lang.String, boolean)
with the logical file cache enabled.- Parameters:
file
- The source file to look up or scanarchive
- The archive file (*.tar, *.tar.gz) the source file is located in- Returns:
- the scanned
LogicalFile
- Throws:
BuildException
- If no scanner for the source file's extension is registered- See Also:
DependencyUtilities.getArchivedLogicalFile(java.lang.String, java.lang.String, boolean)
-
getArchivedLogicalFile
public static LogicalFile getArchivedLogicalFile(java.lang.String file, java.lang.String archive, boolean disableCache) throws BuildException
ExecutesDependencyUtilities.getArchivedLogicalFile(java.lang.String, java.lang.String, boolean)
.- Parameters:
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.- Returns:
- the scanned
LogicalFile
- Throws:
BuildException
- If no scanner for the source file's extension is registered- See Also:
DependencyUtilities.getArchivedLogicalFile(java.lang.String, java.lang.String, boolean)
-
isDisableCache
public boolean isDisableCache()
Returnstrue
if the LogicalFile cache is disabled.
-
getSearchPath
public java.lang.String getSearchPath()
Returns the dependency search path for the dependency resolver
-
-