Skip to content

feat: support freebsd #9041

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions packages/app-builder-lib/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
export class Platform {
static MAC = new Platform("mac", "mac", "darwin")
static LINUX = new Platform("linux", "linux", "linux")
static FREEBSD = new Platform("freebsd", "freebsd", "freebsd")
static WINDOWS = new Platform("windows", "win", "win32")

constructor(
Expand Down Expand Up @@ -65,6 +66,9 @@
case Platform.LINUX.nodeName:
return Platform.LINUX

case Platform.FREEBSD.nodeName:
return Platform.FREEBSD

Check warning on line 70 in packages/app-builder-lib/src/core.ts

View workflow job for this annotation

GitHub Actions / test-linux (ArtifactPublisherTest,BuildTest,ExtraBuildTest,RepoSlugTest,binDownloadTest,configura...

Delete `··`

Check warning on line 70 in packages/app-builder-lib/src/core.ts

View workflow job for this annotation

GitHub Actions / test-linux (oneClickInstallerTest,assistedInstallerTest)

Delete `··`

Check warning on line 70 in packages/app-builder-lib/src/core.ts

View workflow job for this annotation

GitHub Actions / test-linux (concurrentBuildsTest)

Delete `··`

Check warning on line 70 in packages/app-builder-lib/src/core.ts

View workflow job for this annotation

GitHub Actions / test-linux (winPackagerTest,winCodeSignTest,webInstallerTest)

Delete `··`

Check warning on line 70 in packages/app-builder-lib/src/core.ts

View workflow job for this annotation

GitHub Actions / test-linux (snapTest,debTest,fpmTest,protonTest)

Delete `··`

default:
throw new Error(`Unknown platform: ${name}`)
}
Expand Down
3 changes: 3 additions & 0 deletions packages/app-builder-lib/src/packager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ export class Packager {
if (options.linux != null) {
processTargets(Platform.LINUX, options.linux)
}
if (options.freebsd != null) {
processTargets(Platform.FREEBSD, options.freebsd)
}
if (options.win != null) {
processTargets(Platform.WINDOWS, options.win)
}
Expand Down
1 change: 1 addition & 0 deletions packages/app-builder-lib/src/packagerApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface PackagerOptions {

mac?: Array<string>
linux?: Array<string>
freebsd?: Array<string>
win?: Array<string>

projectDir?: string | null
Expand Down
11 changes: 11 additions & 0 deletions packages/electron-builder/src/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ export function normalizeOptions(args: CliOptions): BuildOptions {
processTargets(Platform.LINUX, args.linux)
}

if (args.freebsd != null) {
processTargets(Platform.FREEBSD, args.freebsd)
}

if (args.win != null) {
processTargets(Platform.WINDOWS, args.win)
}
Expand All @@ -100,6 +104,7 @@ export function normalizeOptions(args: CliOptions): BuildOptions {
delete result.dir
delete result.mac
delete result.linux
delete result.freebsd
delete result.win

const r = result
Expand Down Expand Up @@ -231,6 +236,12 @@ export function configureBuildCommand(yargs: yargs.Argv): yargs.Argv {
description: `Build for Linux, accepts target list (see ${chalk.underline("https://goo.gl/4vwQad")})`,
type: "array",
})
.option("freebsd", {
group: buildGroup,
alias: "l",
description: `Build for FreeBSD, accepts target list (see ${chalk.underline("https://goo.gl/4vwQad")})`,
type: "array",
})
.option("win", {
group: buildGroup,
alias: ["w", "windows"],
Expand Down
2 changes: 1 addition & 1 deletion packages/electron-builder/src/cli/install-app-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function configureInstallAppDepsCommand(yargs: yargs.Argv): yargs.Argv {
"camel-case-expansion": false,
})
.option("platform", {
choices: ["linux", "darwin", "win32"],
choices: ["linux", "darwin", "win32", "freebsd"],
default: process.platform,
description: "The target platform",
})
Expand Down
Loading