~longsleep/snapcraft/snapcraft-debs-plugin

« back to all changes in this revision

Viewing changes to snapcraft/yaml.py

  • Committer: Snappy Tarmac
  • Author(s): Sergio Schvezov
  • Date: 2015-10-01 12:03:32 UTC
  • mfrom: (221.1.5 snapcraft)
  • Revision ID: snappy_tarmac-20151001120332-g1hif1gp284abj8h
Remove the -project from plugin names that have been released and add a deprecation message by sergiusens approved by chipaca

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
logger = logging.getLogger(__name__)
30
30
 
31
31
 
 
32
_DEPRECATION_LIST = [
 
33
    'ant-project',
 
34
    'autotools-project',
 
35
    'cmake-project',
 
36
    'go-project',
 
37
    'make-project',
 
38
    'maven-project',
 
39
    'python2-project',
 
40
    'python3-project',
 
41
]
 
42
 
 
43
 
32
44
@jsonschema.FormatChecker.cls_checks('file-path')
33
45
@jsonschema.FormatChecker.cls_checks('icon-path')
34
46
def _validate_file_exists(instance):
93
105
            if not plugin_name:
94
106
                raise PluginNotDefinedError
95
107
 
 
108
            if plugin_name in _DEPRECATION_LIST:
 
109
                plugin_name = plugin_name.rsplit('-project')[0]
 
110
                logger.warning(
 
111
                    'DEPRECATED: plugin names ending in -project are '
 
112
                    'deprecated. Using {0} instead of {0}-project'.format(
 
113
                        plugin_name))
 
114
 
96
115
            if "after" in properties:
97
 
                after_requests[part_name] = properties["after"]
98
 
                del properties["after"]
 
116
                after_requests[part_name] = properties.pop('after')
99
117
 
100
118
            properties['stage'] = _expand_filesets_for('stage', properties)
101
119
            properties['snap'] = _expand_filesets_for('snap', properties)
140
158
                    wiki_part = w.get_part(dep)
141
159
                    found = True if wiki_part else False
142
160
                    if found:
143
 
                        part.deps.append(self.load_plugin(dep, wiki_part['type'], wiki_part))
 
161
                        part.deps.append(self.load_plugin(dep, wiki_part['plugin'], wiki_part))
144
162
                if not found:
145
163
                    raise SnapcraftLogicError('part name missing {}'.format(dep))
146
164