-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmanifest.py
82 lines (66 loc) · 1.83 KB
/
manifest.py
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
from dataclasses import dataclass
from enum import Enum
from const import APPLE_TEAM_ID
class CdSigningType(Enum):
DMG = "dmg"
APP = "app"
IME = "ime"
@dataclass
class EmbeddedRequirement:
path: str
identifier: str
def manifest(
name: str,
identifier: str,
entitlements: bool | None = None,
embedded_requirements: list[EmbeddedRequirement] | None = None,
):
m = {
"type": "app",
"os": "osx",
"name": name,
"outputs": [{"label": "macos", "path": name}],
"app": {
"identifier": identifier,
"signing_requirements": {
"certificate_type": "developerIDAppDistribution",
"app_id_prefix": APPLE_TEAM_ID,
},
},
}
if entitlements:
m["app"]["signing_args"] = {"entitlements_path": "SIGNING_METADATA/entitlements.plist"}
if embedded_requirements:
m["app"]["embedded_requirements"] = {
req.path: {
"identifier": req.identifier,
}
for req in embedded_requirements
}
return m
def app_manifest():
return manifest(
name="Amazon Q.app",
identifier="com.amazon.codewhisperer",
entitlements=True,
embedded_requirements=[
EmbeddedRequirement(
path="Contents/MacOS/q",
identifier="com.amazon.q",
),
EmbeddedRequirement(
path="Contents/MacOS/qterm",
identifier="com.amazon.qterm",
),
],
)
def dmg_manifest(name: str):
return manifest(
name=name,
identifier="com.amazon.codewhisperer.installer",
)
def ime_manifest():
return manifest(
name="CodeWhispererInputMethod.app",
identifier="com.amazon.inputmethod.codewhisperer",
)