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`;
|
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`);
|
const distPath = path.resolve(`${name}.dmg`);
|
||||||
await fs.copyFile(appPath, distPath);
|
await fs.copyFile(appPath, distPath);
|
||||||
await fs.unlink(appPath);
|
await fs.unlink(appPath);
|
||||||
@@ -62,11 +62,13 @@ export default class MacBuilder implements IBuilder {
|
|||||||
logger.success('You can find the app installer in', distPath);
|
logger.success('You can find the app installer in', distPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
getBuildAppPath(npmDirectory: string, dmgName: string) {
|
getBuildAppPath(npmDirectory: string, dmgName: string, multiArch: boolean) {
|
||||||
return path.join(
|
let dmgPath: string;
|
||||||
npmDirectory,
|
if (multiArch) {
|
||||||
'src-tauri/target/universal-apple-darwin/release/bundle/dmg',
|
dmgPath = 'src-tauri/target/universal-apple-darwin/release/bundle/dmg';
|
||||||
dmgName
|
} 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`;
|
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`);
|
const distPath = path.resolve(`${name}.dmg`);
|
||||||
yield fs.copyFile(appPath, distPath);
|
yield fs.copyFile(appPath, distPath);
|
||||||
yield fs.unlink(appPath);
|
yield fs.unlink(appPath);
|
||||||
@@ -2041,8 +2041,15 @@ class MacBuilder {
|
|||||||
logger.success('You can find the app installer in', distPath);
|
logger.success('You can find the app installer in', distPath);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
getBuildAppPath(npmDirectory, dmgName) {
|
getBuildAppPath(npmDirectory, dmgName, multiArch) {
|
||||||
return path.join(npmDirectory, 'src-tauri/target/universal-apple-darwin/release/bundle/dmg', dmgName);
|
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