Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: fixed broken markup introduced in another change

...

  1. Make sure that the path to /codesonar/bin is in the PATH of the user who is running Jenkins.
    • Otherwise, your codesonar analyze command will have to specify the path to the codesonar executable.
  2. Start the CodeSonar hub to use for recording the analysis results (if it is not already running).
    MANUAL: How CodeSonar Works > CodeSonar Structure > Hub > Starting a Hub
    The remainder of these instructions will refer to the hub location as host:port.
  3. Establish a project directory and project name for the CodeSonar project that will be built and analyzed.
    • If you have previously analyzed your software with CodeSonar, you can use the existing project infrastructure.
    • Otherwise, choose a project directory, and create the directory if it does not already exist.
      In either case, make sure the project directory has a suitable location and read/write settings. If Jenkins is running with different OS credentials to your own, remember to take this into account.
    • Use the same project directory and project name every time you perform the CodeSonar build/analysis for a given project.
    • The project directory should not be deleted at the end of the build: the CodeSonar GUI needs to interact with its contents, and incremental builds need information that is stored there.
      • Make sure that the project directory is in a location where Jenkins will not automatically delete it after running the job. For example, it is probably a good idea to locate it outside the Jenkins workspace.
      • Similarly, take steps to ensure that your other build tools will not delete the project directory.
    • Set the project directory permissions to allow the Jenkins process to read and write to it.
      The remainder of these instructions will refer to the project directory as projdir and the project name as proj-name.
  4. If the project directory does not include a general project configuration file (for example, because you just created the directory in the previous step), create one now:

    Code Block
    bgColor#EEFFEE
    codesonar create-conf projdir/proj-name

    MANUAL: Using CodeSonar > Building and Analyzing Projects > Options, Preferences, and Configuration Files > Configuration Files

  5. Edit the general project configuration file (projdir/proj-name.conf) to specify your required configuration parameter settings (unless the factory settings are suitable).
    MANUAL: Using CodeSonar > Building and Analyzing Projects > Options, Preferences, and Configuration Files > Compiler-Independent Configuration File Parameters for CodeSonar
    In particular:
    • You may wish to specify one or more CFLAGS_APPEND rules.
    • If you are performing a clean build every time, set INCREMENTAL_BUILD=No.
  6. Make sure there is a CodeSonar launch daemon running on the analysis machine, with the same owner as the Jenkins process.
    MANUAL: How CodeSonar Works > Build and Analysis > cslaunchd: The CodeSonar Launch Daemon#*
    • If the analysis machine is running Windows, check to see whether there is a cslaunchd service on the analysis machine, with the same owner as the Jenkins process. If not, set one up.
      MANUAL: Using CodeSonar > Building and Analyzing Projects > Continuous Integration > Using CodeSonar With Continuous Integration Tools
      Note that if Jenkins is running as a service, its owner will usually be SYSTEM.
    • Otherwise, arrange to start the launch daemon at system startup.
  7. Go on to Incorporate the CodeSonar build/analysis in your Jenkins job.

...