mirror of
https://github.com/zen-browser/surfer.git
synced 2025-07-07 17:05:33 +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) => {
|
||||
log.info('Applying mozconfig...')
|
||||
|
||||
let commonConfig = readFileSync(
|
||||
resolve(CONFIGS_DIR, 'common', 'mozconfig'),
|
||||
'utf-8'
|
||||
)
|
||||
|
||||
commonConfig = stringTemplate(commonConfig, {
|
||||
const templateOptions = {
|
||||
name: config.name,
|
||||
vendor: config.name,
|
||||
appId: config.appId,
|
||||
brandingDir: existsSync(join(ENGINE_DIR, 'branding', 'melon'))
|
||||
? 'branding/melon'
|
||||
: 'branding/unofficial',
|
||||
})
|
||||
binName: config.binaryName,
|
||||
}
|
||||
|
||||
let commonConfig = readFileSync(
|
||||
resolve(CONFIGS_DIR, 'common', 'mozconfig'),
|
||||
'utf-8'
|
||||
)
|
||||
|
||||
commonConfig = stringTemplate(commonConfig, templateOptions)
|
||||
|
||||
const changesetPrefix = commonConfig
|
||||
.split('\n')
|
||||
|
@ -53,11 +56,7 @@ const applyConfig = async (os: string, arch: string) => {
|
|||
'utf-8'
|
||||
)
|
||||
|
||||
osConfig = stringTemplate(osConfig, {
|
||||
name: config.name,
|
||||
vendor: config.name,
|
||||
appId: config.appId,
|
||||
})
|
||||
osConfig = stringTemplate(osConfig, templateOptions)
|
||||
|
||||
// Allow a custom config to be placed in /mozconfig. This will not be committed
|
||||
// to origin
|
||||
|
@ -65,11 +64,7 @@ const applyConfig = async (os: string, arch: string) => {
|
|||
? readFileSync(join(process.cwd(), 'mozconfig')).toString()
|
||||
: ''
|
||||
|
||||
customConfig = stringTemplate(customConfig, {
|
||||
name: config.name,
|
||||
vendor: config.name,
|
||||
appId: config.appId,
|
||||
})
|
||||
customConfig = stringTemplate(customConfig, templateOptions)
|
||||
|
||||
// TODO: Disable optimization when running artifact builds, as they are not compatible
|
||||
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|.`
|
||||
)
|
||||
|
||||
await dispatch(
|
||||
`./mach`,
|
||||
['build', config.buildOptions.artifactBuilds ? 'faster' : ''].concat(
|
||||
tier ? [tier] : []
|
||||
),
|
||||
ENGINE_DIR
|
||||
)
|
||||
const buildOptions = ['build']
|
||||
|
||||
if (config.buildOptions.artifactBuilds) {
|
||||
buildOptions.push('faster')
|
||||
}
|
||||
|
||||
await dispatch(`./mach`, buildOptions, ENGINE_DIR)
|
||||
}
|
||||
|
||||
const parseDate = (d: number) => {
|
||||
|
|
|
@ -113,7 +113,7 @@ export async function setupProject(): Promise<void> {
|
|||
},
|
||||
])
|
||||
|
||||
const config: Config = {
|
||||
const config: Partial<Config> = {
|
||||
name,
|
||||
vendor,
|
||||
appId,
|
||||
|
|
|
@ -43,6 +43,7 @@ export interface Config {
|
|||
* e.g. co.dothq.melon
|
||||
*/
|
||||
appId: string
|
||||
binaryName: string
|
||||
version: {
|
||||
/**
|
||||
* 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',
|
||||
vendor: 'Unknown',
|
||||
appId: 'unknown.appid',
|
||||
binaryName: 'firefox',
|
||||
version: {
|
||||
product: SupportedProducts.Firefox,
|
||||
displayVersion: '1.0.0',
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
ac_add_options --enable-update-channel=release
|
||||
|
||||
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_APP_VENDOR="${vendor}"
|
||||
export MOZ_APP_BASENAME=Dot
|
||||
export MOZ_APP_PROFILE=dot
|
||||
export MOZ_APP_PROFILE=${binName}
|
||||
export MOZ_APP_DISPLAYNAME="${name}"
|
||||
export MOZ_BRANDING_DIRECTORY=${brandingDir}
|
||||
export MOZ_OFFICIAL_BRANDING_DIRECTORY=${brandingDir}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue