C/C++ Application Analysis

NEW IN RELEASE 86

The Conan coordinate based matching feature provides the ability to scan and evaluate C/C++ dependencies found in either a conanfile.txt or conanfile.py file.

What is supported

Files named conanfile.txt or conanfile.py will be analyzed.

What do we parse from the files?

In conanfile.txt

Only dependencies with an exact version under the "requires" and "build_requires" groups are evaluated, for example:

[requires]
      apache-apr/0.9.1@jgsogo/stable

[build-requires]
      libxml2/2.9.8@bincrafters/stable

In conanfile.py

Only dependencies with an exact version (directly as strings, not built using python code) in the attributes "requires", "build_requires" and the methods "self.requires" and "self.build_requires" are evaluated, for example:

from conans import ConanFile, CMake

class ExampleConan(ConanFile):
	build_requires = "libxml2/2.9.8@bincrafters/stable"
    requires = "opencv/2.2@drl/stable"

	def requirements(self):
		self.build_requires("apache-apr/0.9.1@jgsogo/stable")
		self.requires("zlib/1.2.0@conan/stable")

Integrations with Conan scanning support

  • conanfile.txt
    • CLI from version 86
    • Jenkins from version 3.8.20200310-130318.c482b58
    • Bamboo from version 1.15.1-01
  • conanfile.py
    • CLI from version 94
    • Jenkins from version TBD
    • Bamboo from version 1.16.0

Steps to analyze using the CLI

Invoke a CLI scan of a directory or subdirectories containing either a conanfile.txt or conanfile.py file.  Instructions on how to do this can be found here: Nexus IQ CLI.

Example conanfile.txt File

[requires]
      apache-apr/0.9.1@jgsogo/stable
      zlib/1.2.0@conan/stable

[build-requires]
      libxml2/2.9.8@bincrafters/stable


Example conanfile.py File

from conans import ConanFile, CMake

class ExampleConan(ConanFile):
	build_requires = "libxml2/2.9.8@bincrafters/stable"

	def requirements(self):
		self.requires("apache-apr/0.9.1@jgsogo/stable")
		self.requires("zlib/1.2.0@conan/stable")

Output from cli

Dashboard results

Report results