Exemple #1
0
    def create(self, opts, args):
        """
        Creates configuration from command line parameters like url, artifact list files etc.

        :param opts: options parsed by an OptionParser
        """
        self.singleVersion = False
        includedGatcvs = []
        for filename in args:
            includedGatcvs.extend(maven_repo_util.loadArtifactFile(filename))
        self.artifactSources = [{
            "type": "repository",
            "repo-url": opts.url.split(","),
            "included-gatcvs": includedGatcvs
        }]

        self._setDefaults()
        self._validate()

        self.addClassifiers = self._parseClassifiers(opts.classifiers)
        self.excludedTypes = opts.excludedtypes.split(':')
        if opts.whitelist:
            # TODO read the file properly (skip comments, enable regexps, ...)
            self.gatcvWhitelist = maven_repo_util.loadArtifactFile(
                opts.whitelist)
        if hasattr(opts, "cache"):
            self.useCache = opts.cache
    def create(self, opts, args):
        """
        Creates configuration from command line parameters like url, artifact list files etc.

        :param opts: options parsed by an OptionParser
        """
        self.singleVersion = False
        includedGatcvs = []
        for filename in args:
            includedGatcvs.extend(maven_repo_util.loadArtifactFile(filename))
        self.artifactSources = [{
            "type": "repository",
            "repo-url": opts.url.split(","),
            "included-gatcvs": includedGatcvs
        }]

        self._setDefaults()
        self._validate()

        self.addClassifiers = self._parseClassifiers(opts.classifiers)
        self.excludedTypes = opts.excludedtypes.split(':')
        if opts.whitelist:
            # TODO read the file properly (skip comments, enable regexps, ...)
            self.gatcvWhitelist = maven_repo_util.loadArtifactFile(opts.whitelist)
        if hasattr(opts, "cache"):
            self.useCache = opts.cache
Exemple #3
0
 def _loadArtifactFileBySourceParameter(self, source, parameter, filePath):
     if parameter in source:
         relFilename = self._getRelativeFilename(source[parameter],
                                                 filePath)
         return maven_repo_util.loadArtifactFile(relFilename)
     else:
         return []
    def load(self, opts):
        """
        Load configuration from command line arguments using requested config file.

        :param opts: options parsed by an OptionParser
        """

        if opts.config is None:
            logging.error('You must specify a config file')
            sys.exit(1)

        self.addClassifiers = self._parseClassifiers(opts.classifiers)
        self.excludedTypes = opts.excludedtypes.split(':')
        if opts.whitelist:
            self.gatcvWhitelist = maven_repo_util.loadArtifactFile(opts.whitelist)
        if hasattr(opts, "cache"):
            self.useCache = opts.cache
        self.analyze = (not opts.reportdir == None)

        self.loadFromFile(opts.config)
    def load(self, opts):
        """
        Load configuration from command line arguments using requested config file.

        :param opts: options parsed by an OptionParser
        """

        if opts.config is None:
            logging.error('You must specify a config file')
            sys.exit(1)

        self.addClassifiers = self._parseClassifiers(opts.classifiers)
        self.excludedTypes = opts.excludedtypes.split(':')
        if opts.whitelist:
            self.gatcvWhitelist = maven_repo_util.loadArtifactFile(opts.whitelist)
        if hasattr(opts, "cache"):
            self.useCache = opts.cache
        self.analyze = (not opts.reportdir == None)

        self.loadFromFile(opts.config)
 def _loadArtifactFileBySourceParameter(self, source, parameter, filePath):
     if parameter in source:
         relFilename = self._getRelativeFilename(source[parameter], filePath)
         return maven_repo_util.loadArtifactFile(relFilename)
     else:
         return []