Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion packages/app-builder-lib/src/macPackager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -590,11 +590,25 @@ export class MacPackager extends PlatformPackager<MacConfiguration> {
}

protected async signApp(packContext: AfterPackContext, isAsar: boolean): Promise<boolean> {
// Determine if this is a MAS build and construct appropriate options
const isMas = packContext.electronPlatformName === "mas"
let masOptions: MasConfiguration | null = null
if (isMas) {
masOptions = deepAssign({}, this.platformSpecificBuildOptions, this.config.mas)
// Check if this is a mas-dev build
const isMasDev = packContext.targets.some(t => t.name === "mas-dev")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might backfire since we're using some.

signApp is supposed to be per-target, so an invocation of it could be from a t.name: mas, then a 2nd invocation of it could be t.name: mas-dev. With this current logic, type: development would be set on both invocations.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though I don't necessarily like this specific PR over #9509, but would it be more appropriate to use packContext.electronPlatformName? Tried to grep through and I don't think electronPlatforname necesarily support mas-dev, only mas.

Actually. looking at the code again it seems siSignAfterPack also has a platformSpecificBuildOptions argument with a .target. Perhaps we could feed that through to signApp

if (isMasDev) {
deepAssign(masOptions, this.config.masDev, {
type: "development",
})
}
}

const readDirectoryAndSign = async (sourceDirectory: string, directories: string[], shouldSign: (file: string) => boolean): Promise<boolean> => {
await Promise.all(
directories.map(async (file: string) => {
if (shouldSign(file)) {
await this.sign(path.join(sourceDirectory, file), null, null, packContext.arch)
await this.sign(path.join(sourceDirectory, file), packContext.outDir, masOptions, packContext.arch)
}
})
)
Expand Down
Loading