55For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
77
8- Responsible for loading a config file of the following format:
9-
10- [general]
11- # Path to the pom template, used when generating pom.xml files for jar artifacts
12- pom_template_path=
13- # A list of paths to pinned maven_install json files.
14- # Globs are supported, for example: tools/maven_install/*.json
15- maven_install_paths=maven_install.json,
16-
17- [crawler]
18- # A list of path prefixes that are not crawled by pomgen. Any dependency
19- # that starts with one of the strings returned by this method is skipped
20- # and not processed (and not included in the generated pom.xml).
21- # These dependencies are similar to Maven's "provided" scope: if they are
22- # needed at runtime, it is expected that the final runtime assembly
23- # contains them.
24- excluded_dependency_paths=projects/protos/,
25-
26- [artifact]
27- # Globally toggles change detection, the default value is on (True).
28- # See /docs/change_detection.md
29- change_detection_enabled=True
30-
31- # Paths not considered when determining whether an artifact has changed
32- excluded_relative_paths=src/tests,
33-
34- # File names not considered when determining whether an artifact has changed
35- excluded_filenames=.gitignore,
36-
37- # Ignored file extensions when determining whether an artifact has changed
38- excluded_extensions=.md,
39-
40- # query versioning mode for proposed next versions
41- transitives_versioning_mode=semver|counter
42-
43- # The classifier used for all jars artifacts assembled by pomgen
44- # By default, no classifier is set
45- # The same value can also be specified by setting the environment variable
46- # POMGEN_JAR_CLASSIFIER - the environment variable takes precedence over the
47- # value set in this cfg file
48- jar_classifier=
8+ Responsible for loading a config file. For the config file format, see /README.md#configuration.
499"""
5010
51- try :
52- import ConfigParser as configparser
53- except ImportError :
54- import configparser
5511
56- from config import exclusions
5712from common import logger
13+ from config import exclusions
14+ import configparser
5815import os
5916
6017
@@ -92,6 +49,7 @@ def artifact(option, dflt, valid_values=None):
9249 pom_template_path_and_content = _read_files (repo_root , pom_template_p )[0 ],
9350 maven_install_paths = gen ("maven_install_paths" , ("maven_install.json" ,)),
9451 excluded_dependency_paths = crawl ("excluded_dependency_paths" , ()),
52+ excluded_dependency_labels = crawl ("excluded_dependency_labels" , ()),
9553 excluded_src_relpaths = artifact ("excluded_relative_paths" , ("src/test" ,)),
9654 excluded_src_file_names = artifact ("excluded_filenames" , (".gitignore" ,)),
9755 excluded_src_file_extensions = artifact ("excluded_extensions" , (".md" ,)),
@@ -124,6 +82,7 @@ def __init__(self,
12482 pom_template_path_and_content = ("" ,"" ),
12583 maven_install_paths = (),
12684 excluded_dependency_paths = (),
85+ excluded_dependency_labels = (),
12786 excluded_src_relpaths = (),
12887 excluded_src_file_names = (),
12988 excluded_src_file_extensions = (),
@@ -137,6 +96,7 @@ def __init__(self,
13796
13897 # crawler
13998 self .excluded_dependency_paths = _add_pathsep (_to_tuple (excluded_dependency_paths ))
99+ self .excluded_dependency_labels = _to_tuple (excluded_dependency_labels )
140100
141101 # artifact
142102 self .excluded_src_relpaths = _add_pathsep (_to_tuple (excluded_src_relpaths ))
@@ -178,21 +138,25 @@ def __str__(self):
178138
179139[crawler]
180140excluded_dependency_paths=%s
141+ excluded_dependency_labels=%s
181142
182143[artifact]
183144excluded_relative_paths=%s
184145excluded_filenames=%s
185146excluded_extensions=%s
186147transitives_versioning_mode=%s
187148jar_artifact_classifier=%s
149+ change_detection_enabled=%s
188150""" % (self .pom_template_path_and_content [0 ],
189151 self .maven_install_paths ,
190152 self .excluded_dependency_paths ,
153+ self .excluded_dependency_labels ,
191154 self .excluded_src_relpaths ,
192155 self .excluded_src_file_names ,
193156 self .excluded_src_file_extensions ,
194157 self .transitives_versioning_mode ,
195- self .jar_artifact_classifier )
158+ self .jar_artifact_classifier ,
159+ self .change_detection_enabled )
196160
197161
198162def _to_tuple (thing ):
0 commit comments