-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathXCSwiftPackageProductDependency.ts
More file actions
40 lines (33 loc) · 1.27 KB
/
Copy pathXCSwiftPackageProductDependency.ts
File metadata and controls
40 lines (33 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import * as json from "../json/types";
import { AbstractObject } from "./AbstractObject";
import type { SansIsa } from "./utils/util.types";
import type { XcodeProject } from "./XcodeProject";
import type { XCRemoteSwiftPackageReference } from "./XCRemoteSwiftPackageReference";
import type { XCLocalSwiftPackageReference } from "./XCLocalSwiftPackageReference";
export type XCSwiftPackageProductDependencyModel =
json.XCSwiftPackageProductDependency<
XCRemoteSwiftPackageReference | XCLocalSwiftPackageReference
>;
export class XCSwiftPackageProductDependency extends AbstractObject<XCSwiftPackageProductDependencyModel> {
static isa = json.ISA.XCSwiftPackageProductDependency as const;
static is(object: any): object is XCSwiftPackageProductDependency {
return object.isa === XCSwiftPackageProductDependency.isa;
}
static create(
project: XcodeProject,
opts: SansIsa<XCSwiftPackageProductDependencyModel>
) {
return project.createModel<XCSwiftPackageProductDependencyModel>({
isa: XCSwiftPackageProductDependency.isa,
...opts,
}) as XCSwiftPackageProductDependency;
}
protected getObjectProps() {
return {
package: String,
};
}
getDisplayName(): string {
return this.props.productName ?? super.getDisplayName();
}
}