add multi-architecture support for MacOS
This commit is contained in:
16
bin/builders/MacBuilder.ts
vendored
16
bin/builders/MacBuilder.ts
vendored
@@ -53,7 +53,7 @@ export default class MacBuilder implements IBuilder {
|
||||
}
|
||||
dmgName = `${name}_${tauriConf.package.version}_${arch}.dmg`;
|
||||
}
|
||||
const appPath = this.getBuildAppPath(npmDirectory, dmgName);
|
||||
const appPath = this.getBuildAppPath(npmDirectory, dmgName, options.multi_arch);
|
||||
const distPath = path.resolve(`${name}.dmg`);
|
||||
await fs.copyFile(appPath, distPath);
|
||||
await fs.unlink(appPath);
|
||||
@@ -62,11 +62,13 @@ export default class MacBuilder implements IBuilder {
|
||||
logger.success('You can find the app installer in', distPath);
|
||||
}
|
||||
|
||||
getBuildAppPath(npmDirectory: string, dmgName: string) {
|
||||
return path.join(
|
||||
npmDirectory,
|
||||
'src-tauri/target/universal-apple-darwin/release/bundle/dmg',
|
||||
dmgName
|
||||
);
|
||||
getBuildAppPath(npmDirectory: string, dmgName: string, multiArch: boolean) {
|
||||
let dmgPath: string;
|
||||
if (multiArch) {
|
||||
dmgPath = 'src-tauri/target/universal-apple-darwin/release/bundle/dmg';
|
||||
} else {
|
||||
dmgPath = 'src-tauri/target/release/bundle/dmg';
|
||||
}
|
||||
return path.join(npmDirectory, dmgPath, dmgName);
|
||||
}
|
||||
}
|
||||
|
||||
13
dist/cli.js
vendored
13
dist/cli.js
vendored
@@ -2033,7 +2033,7 @@ class MacBuilder {
|
||||
}
|
||||
dmgName = `${name}_${tauriConf.package.version}_${arch}.dmg`;
|
||||
}
|
||||
const appPath = this.getBuildAppPath(npmDirectory, dmgName);
|
||||
const appPath = this.getBuildAppPath(npmDirectory, dmgName, options.multi_arch);
|
||||
const distPath = path.resolve(`${name}.dmg`);
|
||||
yield fs.copyFile(appPath, distPath);
|
||||
yield fs.unlink(appPath);
|
||||
@@ -2041,8 +2041,15 @@ class MacBuilder {
|
||||
logger.success('You can find the app installer in', distPath);
|
||||
});
|
||||
}
|
||||
getBuildAppPath(npmDirectory, dmgName) {
|
||||
return path.join(npmDirectory, 'src-tauri/target/universal-apple-darwin/release/bundle/dmg', dmgName);
|
||||
getBuildAppPath(npmDirectory, dmgName, multiArch) {
|
||||
let dmgPath;
|
||||
if (multiArch) {
|
||||
dmgPath = 'src-tauri/target/universal-apple-darwin/release/bundle/dmg';
|
||||
}
|
||||
else {
|
||||
dmgPath = 'src-tauri/target/release/bundle/dmg';
|
||||
}
|
||||
return path.join(npmDirectory, dmgPath, dmgName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user