|
| 1 | +# encoding: utf-8 |
| 2 | + |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | +# |
| 15 | +# SPDX-License-Identifier: Apache-2.0 |
| 16 | + |
| 17 | +from os.path import dirname, join |
| 18 | +from typing import Dict, Optional |
| 19 | + |
| 20 | +from .. import SchemaVersion |
| 21 | + |
| 22 | +""" |
| 23 | +Content in here is internal, not for public use. |
| 24 | +Breaking changes without notice may happen. |
| 25 | +""" |
| 26 | + |
| 27 | +__DIR = dirname(__file__) |
| 28 | + |
| 29 | +BOM_XML: Dict[SchemaVersion, Optional[str]] = { |
| 30 | + SchemaVersion.V1_4: join(__DIR, 'bom-1.4.SNAPSHOT.xsd'), |
| 31 | + SchemaVersion.V1_3: join(__DIR, 'bom-1.3.SNAPSHOT.xsd'), |
| 32 | + SchemaVersion.V1_2: join(__DIR, 'bom-1.2.SNAPSHOT.xsd'), |
| 33 | + SchemaVersion.V1_1: join(__DIR, 'bom-1.1.SNAPSHOT.xsd'), |
| 34 | + SchemaVersion.V1_0: join(__DIR, 'bom-1.0.SNAPSHOT.xsd'), |
| 35 | +} |
| 36 | + |
| 37 | +BOM_JSON: Dict[SchemaVersion, Optional[str]] = { |
| 38 | + SchemaVersion.V1_4: join(__DIR, 'bom-1.4.SNAPSHOT.schema.json'), |
| 39 | + SchemaVersion.V1_3: join(__DIR, 'bom-1.3.SNAPSHOT.schema.json'), |
| 40 | + SchemaVersion.V1_2: join(__DIR, 'bom-1.2.SNAPSHOT.schema.json'), |
| 41 | + # <= v1.1 is not defined in JSON |
| 42 | + SchemaVersion.V1_1: None, |
| 43 | + SchemaVersion.V1_0: None, |
| 44 | +} |
| 45 | + |
| 46 | +BOM_JSON_STRICT: Dict[SchemaVersion, Optional[str]] = { |
| 47 | + # >= v1.4 is already strict - no special file here |
| 48 | + SchemaVersion.V1_4: join(__DIR, 'bom-1.4.SNAPSHOT.schema.json'), |
| 49 | + # <= 1.3 need special files |
| 50 | + SchemaVersion.V1_3: join(__DIR, 'bom-1.3-strict.SNAPSHOT.schema.json'), |
| 51 | + SchemaVersion.V1_2: join(__DIR, 'bom-1.2-strict.SNAPSHOT.schema.json'), |
| 52 | + # <= v1.1 is not defined in JSON |
| 53 | + SchemaVersion.V1_1: None, |
| 54 | + SchemaVersion.V1_0: None, |
| 55 | +} |
| 56 | + |
| 57 | +SPDX_JSON = join(__DIR, 'spdx.SNAPSHOT.schema.json') |
| 58 | +SPDX_XML = join(__DIR, 'spdx.SNAPSHOT.xsd') |
| 59 | + |
| 60 | +JSF = join(__DIR, 'jsf-0.82.SNAPSHOT.schema.json') |
0 commit comments