@@ -6,9 +6,12 @@ package builder
6
6
7
7
import (
8
8
"fmt"
9
+
9
10
"github.com/spdx/tools-golang/builder/builder2v1"
10
11
"github.com/spdx/tools-golang/builder/builder2v2"
11
- "github.com/spdx/tools-golang/spdx"
12
+ "github.com/spdx/tools-golang/spdx/common"
13
+ "github.com/spdx/tools-golang/spdx/v2_1"
14
+ "github.com/spdx/tools-golang/spdx/v2_2"
12
15
)
13
16
14
17
// ===== 2.1 builder =====
@@ -48,7 +51,7 @@ type Config2_1 struct {
48
51
// - packageName: name of package / directory
49
52
// - dirRoot: path to directory to be analyzed
50
53
// - config: Config object
51
- func Build2_1 (packageName string , dirRoot string , config * Config2_1 ) (* spdx. Document2_1 , error ) {
54
+ func Build2_1 (packageName string , dirRoot string , config * Config2_1 ) (* v2_1. Document , error ) {
52
55
// build Package section first -- will include Files and make the
53
56
// package verification code available
54
57
pkg , err := builder2v1 .BuildPackageSection2_1 (packageName , dirRoot , config .PathsIgnored )
@@ -66,15 +69,15 @@ func Build2_1(packageName string, dirRoot string, config *Config2_1) (*spdx.Docu
66
69
return nil , err
67
70
}
68
71
69
- doc := & spdx. Document2_1 {
72
+ doc := & v2_1. Document {
70
73
SPDXVersion : "SPDX-2.1" ,
71
74
DataLicense : "CC0-1.0" ,
72
- SPDXIdentifier : spdx .ElementID ("DOCUMENT" ),
75
+ SPDXIdentifier : common .ElementID ("DOCUMENT" ),
73
76
DocumentName : packageName ,
74
77
DocumentNamespace : fmt .Sprintf ("%s%s-%s" , config .NamespacePrefix , packageName , pkg .PackageVerificationCode ),
75
78
CreationInfo : ci ,
76
- Packages : []* spdx. Package2_1 {pkg },
77
- Relationships : []* spdx. Relationship2_1 {rln },
79
+ Packages : []* v2_1. Package {pkg },
80
+ Relationships : []* v2_1. Relationship {rln },
78
81
}
79
82
80
83
return doc , nil
@@ -117,7 +120,7 @@ type Config2_2 struct {
117
120
// - packageName: name of package / directory
118
121
// - dirRoot: path to directory to be analyzed
119
122
// - config: Config object
120
- func Build2_2 (packageName string , dirRoot string , config * Config2_2 ) (* spdx. Document2_2 , error ) {
123
+ func Build2_2 (packageName string , dirRoot string , config * Config2_2 ) (* v2_2. Document , error ) {
121
124
// build Package section first -- will include Files and make the
122
125
// package verification code available
123
126
pkg , err := builder2v2 .BuildPackageSection2_2 (packageName , dirRoot , config .PathsIgnored )
@@ -135,15 +138,15 @@ func Build2_2(packageName string, dirRoot string, config *Config2_2) (*spdx.Docu
135
138
return nil , err
136
139
}
137
140
138
- doc := & spdx. Document2_2 {
141
+ doc := & v2_2. Document {
139
142
SPDXVersion : "SPDX-2.2" ,
140
143
DataLicense : "CC0-1.0" ,
141
- SPDXIdentifier : spdx .ElementID ("DOCUMENT" ),
144
+ SPDXIdentifier : common .ElementID ("DOCUMENT" ),
142
145
DocumentName : packageName ,
143
146
DocumentNamespace : fmt .Sprintf ("%s%s-%s" , config .NamespacePrefix , packageName , pkg .PackageVerificationCode ),
144
147
CreationInfo : ci ,
145
- Packages : []* spdx. Package2_2 {pkg },
146
- Relationships : []* spdx. Relationship2_2 {rln },
148
+ Packages : []* v2_2. Package {pkg },
149
+ Relationships : []* v2_2. Relationship {rln },
147
150
}
148
151
149
152
return doc , nil
0 commit comments