Skip to content

Commit

Permalink
Split platform specific modules
Browse files Browse the repository at this point in the history
  • Loading branch information
JrMasterModelBuilder committed Nov 13, 2023
1 parent ebc54e0 commit 543ab35
Show file tree
Hide file tree
Showing 13 changed files with 609 additions and 595 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/mac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ jobs:
- name: NPM
run: npm ci

- name: NPM util/mac
working-directory: util/mac
run: npm ci

- name: shockpkg Cache
uses: actions/cache@v3
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ jobs:
- name: NPM
run: npm ci

- name: NPM util/windows
working-directory: util/windows
run: npm ci

- name: shockpkg Cache
uses: actions/cache@v3
with:
Expand Down
19 changes: 10 additions & 9 deletions make.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ import {
distName
} from './util/meta.mjs';
import {docs} from './util/doc.mjs';
import {isMac, codesign} from './util/mac.mjs';
import {makeZip, makeTgz, makeExe, makeDmg} from './util/dist.mjs';
import {zip, tgz} from './util/archive.mjs';
import {isMac, codesign, dmg} from './util/mac/index.mjs';
import {exe} from './util/windows/index.mjs';
import {flash4FpsCap, setFps} from './util/fps.mjs';

async function * resources() {
Expand Down Expand Up @@ -92,8 +93,8 @@ for (const [type, flat] of Object.entries({
}

for (const [type, make] of Object.entries({
'zip': makeZip,
'tgz': makeTgz
'zip': zip,
'tgz': tgz
})) {
task[`dist:browser:${type}`] = async () => {
await make(`dist/${distName}-Browser.${type}`, 'build/browser');
Expand Down Expand Up @@ -136,10 +137,10 @@ for (const [type, pkg] of Object.entries({
await docs('docs', build);
};
task[`dist:windows-${type}:zip`] = async () => {
await makeZip(`dist/${distName}-Windows-${type}.zip`, build);
await zip(`dist/${distName}-Windows-${type}.zip`, build);
};
task[`dist:windows-${type}:exe`] = async () => {
await makeExe(
await exe(
`dist/${distName}-Windows-${type}.exe`,
/x86_64/.test(type) ? 'x64 arm64' : '',
appDomain,
Expand Down Expand Up @@ -216,10 +217,10 @@ for (const [type, pkg] of Object.entries({
await docs('docs', build);
};
task[`dist:mac-${type}:tgz`] = async () => {
await makeTgz(`dist/${distName}-Mac-${type}.tgz`, build);
await tgz(`dist/${distName}-Mac-${type}.tgz`, build);
};
task[`dist:mac-${type}:dmg`] = async () => {
await makeDmg(
await dmg(
`dist/${distName}-Mac-${type}.dmg`,
appDmgTitle,
'res/dmg-icon.icns',
Expand Down Expand Up @@ -259,7 +260,7 @@ for (const [type, pkg] of Object.entries({
await docs('docs', build);
};
task[`dist:linux-${type}:tgz`] = async () => {
await makeTgz(`dist/${distName}-Linux-${type}.tgz`, build);
await tgz(`dist/${distName}-Linux-${type}.tgz`, build);
};
}

Expand Down
Loading

0 comments on commit 543ab35

Please sign in to comment.