mirror of
https://github.com/zen-browser/surfer.git
synced 2025-07-08 17:30:02 +02:00
✨ Binary name option
This commit is contained in:
parent
331c2b2235
commit
b52a4d97b3
4 changed files with 24 additions and 27 deletions
|
@ -20,19 +20,22 @@ const platform: any = {
|
||||||
const applyConfig = async (os: string, arch: string) => {
|
const applyConfig = async (os: string, arch: string) => {
|
||||||
log.info('Applying mozconfig...')
|
log.info('Applying mozconfig...')
|
||||||
|
|
||||||
let commonConfig = readFileSync(
|
const templateOptions = {
|
||||||
resolve(CONFIGS_DIR, 'common', 'mozconfig'),
|
|
||||||
'utf-8'
|
|
||||||
)
|
|
||||||
|
|
||||||
commonConfig = stringTemplate(commonConfig, {
|
|
||||||
name: config.name,
|
name: config.name,
|
||||||
vendor: config.name,
|
vendor: config.name,
|
||||||
appId: config.appId,
|
appId: config.appId,
|
||||||
brandingDir: existsSync(join(ENGINE_DIR, 'branding', 'melon'))
|
brandingDir: existsSync(join(ENGINE_DIR, 'branding', 'melon'))
|
||||||
? 'branding/melon'
|
? 'branding/melon'
|
||||||
: 'branding/unofficial',
|
: 'branding/unofficial',
|
||||||
})
|
binName: config.binaryName,
|
||||||
|
}
|
||||||
|
|
||||||
|
let commonConfig = readFileSync(
|
||||||
|
resolve(CONFIGS_DIR, 'common', 'mozconfig'),
|
||||||
|
'utf-8'
|
||||||
|
)
|
||||||
|
|
||||||
|
commonConfig = stringTemplate(commonConfig, templateOptions)
|
||||||
|
|
||||||
const changesetPrefix = commonConfig
|
const changesetPrefix = commonConfig
|
||||||
.split('\n')
|
.split('\n')
|
||||||
|
@ -53,11 +56,7 @@ const applyConfig = async (os: string, arch: string) => {
|
||||||
'utf-8'
|
'utf-8'
|
||||||
)
|
)
|
||||||
|
|
||||||
osConfig = stringTemplate(osConfig, {
|
osConfig = stringTemplate(osConfig, templateOptions)
|
||||||
name: config.name,
|
|
||||||
vendor: config.name,
|
|
||||||
appId: config.appId,
|
|
||||||
})
|
|
||||||
|
|
||||||
// Allow a custom config to be placed in /mozconfig. This will not be committed
|
// Allow a custom config to be placed in /mozconfig. This will not be committed
|
||||||
// to origin
|
// to origin
|
||||||
|
@ -65,11 +64,7 @@ const applyConfig = async (os: string, arch: string) => {
|
||||||
? readFileSync(join(process.cwd(), 'mozconfig')).toString()
|
? readFileSync(join(process.cwd(), 'mozconfig')).toString()
|
||||||
: ''
|
: ''
|
||||||
|
|
||||||
customConfig = stringTemplate(customConfig, {
|
customConfig = stringTemplate(customConfig, templateOptions)
|
||||||
name: config.name,
|
|
||||||
vendor: config.name,
|
|
||||||
appId: config.appId,
|
|
||||||
})
|
|
||||||
|
|
||||||
// TODO: Disable optimization when running artifact builds, as they are not compatible
|
// TODO: Disable optimization when running artifact builds, as they are not compatible
|
||||||
const internalConfig = `# Internally defined by melon\n${
|
const internalConfig = `# Internally defined by melon\n${
|
||||||
|
@ -110,13 +105,13 @@ const genericBuild = async (os: string, tier: string) => {
|
||||||
`If you get any dependency errors, try running |${bin_name} bootstrap|.`
|
`If you get any dependency errors, try running |${bin_name} bootstrap|.`
|
||||||
)
|
)
|
||||||
|
|
||||||
await dispatch(
|
const buildOptions = ['build']
|
||||||
`./mach`,
|
|
||||||
['build', config.buildOptions.artifactBuilds ? 'faster' : ''].concat(
|
if (config.buildOptions.artifactBuilds) {
|
||||||
tier ? [tier] : []
|
buildOptions.push('faster')
|
||||||
),
|
}
|
||||||
ENGINE_DIR
|
|
||||||
)
|
await dispatch(`./mach`, buildOptions, ENGINE_DIR)
|
||||||
}
|
}
|
||||||
|
|
||||||
const parseDate = (d: number) => {
|
const parseDate = (d: number) => {
|
||||||
|
|
|
@ -113,7 +113,7 @@ export async function setupProject(): Promise<void> {
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
const config: Config = {
|
const config: Partial<Config> = {
|
||||||
name,
|
name,
|
||||||
vendor,
|
vendor,
|
||||||
appId,
|
appId,
|
||||||
|
|
|
@ -43,6 +43,7 @@ export interface Config {
|
||||||
* e.g. co.dothq.melon
|
* e.g. co.dothq.melon
|
||||||
*/
|
*/
|
||||||
appId: string
|
appId: string
|
||||||
|
binaryName: string
|
||||||
version: {
|
version: {
|
||||||
/**
|
/**
|
||||||
* What branch of firefox you are forking. e.g. stable ('firefox'), dev ('firefox-dev')
|
* What branch of firefox you are forking. e.g. stable ('firefox'), dev ('firefox-dev')
|
||||||
|
@ -85,6 +86,7 @@ const defaultConfig: Config = {
|
||||||
name: 'Unknown melon build',
|
name: 'Unknown melon build',
|
||||||
vendor: 'Unknown',
|
vendor: 'Unknown',
|
||||||
appId: 'unknown.appid',
|
appId: 'unknown.appid',
|
||||||
|
binaryName: 'firefox',
|
||||||
version: {
|
version: {
|
||||||
product: SupportedProducts.Firefox,
|
product: SupportedProducts.Firefox,
|
||||||
displayVersion: '1.0.0',
|
displayVersion: '1.0.0',
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
ac_add_options --enable-update-channel=release
|
ac_add_options --enable-update-channel=release
|
||||||
|
|
||||||
ac_add_options --with-branding=${brandingDir}
|
ac_add_options --with-branding=${brandingDir}
|
||||||
ac_add_options --with-app-name=dot
|
ac_add_options --with-app-name=${binName}
|
||||||
export MOZ_USER_DIR="${name}"
|
export MOZ_USER_DIR="${name}"
|
||||||
export MOZ_APP_VENDOR="${vendor}"
|
export MOZ_APP_VENDOR="${vendor}"
|
||||||
export MOZ_APP_BASENAME=Dot
|
export MOZ_APP_BASENAME=Dot
|
||||||
export MOZ_APP_PROFILE=dot
|
export MOZ_APP_PROFILE=${binName}
|
||||||
export MOZ_APP_DISPLAYNAME="${name}"
|
export MOZ_APP_DISPLAYNAME="${name}"
|
||||||
export MOZ_BRANDING_DIRECTORY=${brandingDir}
|
export MOZ_BRANDING_DIRECTORY=${brandingDir}
|
||||||
export MOZ_OFFICIAL_BRANDING_DIRECTORY=${brandingDir}
|
export MOZ_OFFICIAL_BRANDING_DIRECTORY=${brandingDir}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue