Page tree
Skip to end of metadata
Go to start of metadata

Discovery - how does it work?


Discovery is the second step in the Package action. Users of older versions of CAST will be familiar with the concept of Discovery, but for newcomers it can be described as follows:

Discovery is a process whereby the CAST Delivery Manager Tool will attempt to automatically identify projects (for example: an Eclipse Java project, or an SQL database) within your Source Package using a set of predefined rules. When the Package action is complete, you can view the projects that have been identified in the Package Content tab (in the List of projects that will be analyzed section).

When a successfully Packaged Source Code Package is subsequently deployed in the CAST Management Studio, an Analysis Unit will be created for each project that has been identified during the Discovery process and is not excluded by a rule or filter.

How does it work?

The Discovery step works as follows:

  • the Discovery engine lists the files in each folder, then each sub-folder recursively
  • the Discovery engine submits each file to the Discoverers (i.e. for each supported technology)
  • each Discoverer can reply as follows:
    • it is not interested in the file (the Discovery process continues)
    • it created a Project from the file but the the Discovery process continues
    • it owns the folder (no need to continue the Discovery process for this folder)
  • the Project(s) created by the Discoverer has:
    • a Root Path: the file or folder that was used to create this Project (for example: .project for Eclipse)
    • a list of Significant Paths (optional): a sample of files that ensure that the project is still in existence (e.g.: for SAP, some ABAP files are discovered)
Discoverers

Below is a list of all current Discoverers for each supported technology:

ASP

Type Notes Discovered options
Source-based support Configures a project for the highest level source code folder using ASP extensions. Root path

.NET

Type Notes
C#/VB.NET project support Configures a project for each Microsoft Visual Studio C# project (*.csproj file) or VB.NET (*.vbproj file) identified.
C#/VB.NET Web Site support Configures a project for each Microsoft Visual Studio C#/VB.NET Web Site identified. In order to be identified as a Web Site project, the  root folder must contain a web.config file.

If a .csproj or .vbproj file is found in a sub-folder of the root Web Site project folder, a corresponding C# or VB.NET project will be created and the sub-folder will not be included in the Web Site delivery.

Note that an exclusion rule is active by default, which will force basic .NET web site projects to be discovered but ignored when a full .NET project exists:

C++

Type Notes Source Package configuration
Visual Studio 20xx project support Configures a project for each Microsoft Visual Studio 2003 - 2008 project (*.vcproj file) and each Visual Studio 2010/2012 project (*.vcxproj file) identified.

Handles Inherited Property Sheets and standard Visual Studio macros:

  • $(SolutionDir)
  • $(ProjectName)
  • $(InputName)
  • $(ProjectDir)
  • $(InputDir)

Only the Release configuration is identified. If there is no Release, then the first configuration is identified instead.

  • Source files:
    • resolved in File System
    • matches pre-defined extensions
    • Not excluded from build
  • Compile directive
  • includes
  • macros
  • Visual Studio version & MFC usage
  • Console
Please note the following:

If a property sheet (.vsprops) is referenced from a Visual C++ project (.vcproj or .vcxproj) through the use of an environment variable, no alert (see Package Alert tab - Packaging alerts) is triggered for this variable when discovering the project and no remediation can be added for this alert. Therefore, the property sheet may not be found during the discovery (which leads to badly configured analyses).

In the case an Environment Variable is used to reference a property sheet, you have several possibilities:

  • Before the discovery, you can change the content of your C++ project so that it refers to the property sheet through a relative path, instead of through an Environment Variable. You can write a script to automate this process.
  • You can also ignore the missing property sheet during the discovery and modify the settings of the Analysis Units in the CAST-Management Studio (mostly add the include paths and macro definitions that would have been provided by the property sheet). A good way to share the additional settings between several Analysis Units is to create a new Environment Profile to handle the required changes.

Forms

Type Notes Discovered options
Option: Source-based support (extractor embedded in the CAST Delivery Manager Tool) Configures a project for each of the following extracted files:

FORMS Analysis Unit (pointing to .uaxdirectory file)

  • .fmb
  • .olb
  • .mmb
  • .pll

Oracle Reports Analysis Unit (pointing to .rex file)

  • .rex
Project path only
Option: extractor output

J2EE

Type Notes Source Package configuration
Eclipse project support Configures a project for each Eclipse Java project (.project with Java nature) identified
  • Application root path:
    • using WEB-INF/web.xml grand parent folder if it exists
  • Source folders configured in .classpath
  • Class path configured in .classpath
  • Java language & environment (1.1 to 8.0) according to .classpath and project settings
  • XML files found in project folder (excluding files in Eclipse .settings folders and output class folders)
  • PROPERTIES files found in project folder (excluding files in output class folders)
  • Libraries according to jar names in the project classpath: JUnit, Log4J, Commons logging, DOM4J, JSF, MX4J, Hibernate, Struts, Spring
Maven project simplified support Configures a project on each folder that contains a pom.xml file except when the type of packaging declared in the pom.xml is "pom".

Note that project inheritance and project aggregation is supported

  • Java language and environment (1.1 to 8.0).
  • Application root path:
    • Standard MAVEN path (src/main/webapp) when "war" packaging is declared in pom.xml
    • otherwise folder containing POM
  • Source folders configured in standard maven paths:
    • src\main\java
    • src\test\java
  • Libraries according to artifact ids in the pom.xml dependencies declaration: JUnit, Log4J, Commons logging, DOM4J, JSF, MX4J, Hibernate, Struts, Spring

Note that any Maven project whose type is set to "eclipse-plugin" will be ignored by the Maven discoverer. An "eclipse-plugin" project means that an associated Eclipse project also exists and therefore should be handled by the Eclipse discoverer. In this siutation, CAST highly recommends that you tick the following exclusion rule in the CAST Delivery Manager Tool:

Mainframe - when "Files on your system" option is used

Type Notes Discovered options Stop conditions
Source-based support Configures a project for the highest level source code folder if one of the following file types is discovered:
  • COB, CBL, PCO, SQB  > COBOL Programs
  • JCL, PRC > JCL Jobs and Procs
  • DBD, PSB > IMS database
  • CSD, CICS, BMS > CICS Transaction Manager
Root path None

PowerBuilder

Type Notes Discovered options Stop conditions
Source-based support Configures a project for each .PBT file identified.
  • Project path
  • Path to .PBT file
None

SAP

Type Notes Discovered options Stop conditions
Source-based support Configures a project for the highest level source code folder using ABAP extension.
  • Root path
  • SAP Table extraction folder
Does not scan in sub-folders of a SAP Table extraction folder

SQL

Type Notes Discovered options Stop conditions
Offline SQL extraction support (PL/SQL (Oracle) and T-SQL (Microsoft/Sybase)). Configures a project for each extracted database/schema (or *.uaxdirectory / .castextraction files) Database/schema name Does not scan in sub-folders below .uaxdirectory file.

VB

Type Notes Source Package configuration
VB project support Configures a project for each VB project identified (each *.vbp file identified) Project path only
Notes
  • Some file extensions are ignored because they are used by multiple technologies supported by CAST. Currently these extensions are:
    • .INC (Mainframe and C++ technologies)

CAST Website

  • No labels