Skip to content

Commit

Permalink
Build yoga binary as part of website-next scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
NickGerleman committed Oct 31, 2023
1 parent bbf70d9 commit ebc5d37
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/validate-website-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ on:
- name: Setup
uses: ./.github/actions/setup-js

- name: Build Yoga
run: yarn build
working-directory: javascript

- name: Build Website
run: yarn build
working-directory: website-next
Expand Down
21 changes: 18 additions & 3 deletions javascript/just.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const {

const {readFile, writeFile} = require('fs/promises');

const chalk = require('chalk');
const glob = require('glob');
const path = require('path');
const which = require('which');
Expand Down Expand Up @@ -132,10 +133,24 @@ function runBenchTask() {
};
}

function findExecutable(name, failureMessage) {
const exec = tryFindExecutable(name);
if (exec) {
return exec;
}

logger.error(chalk.bold.red(failureMessage));
process.exit(1);
}

function tryFindExecutable(name) {
return which.sync(name, {nothrow: true});
}

function emcmakeGenerateTask() {
return () => {
const emcmake = which.sync('emcmake');
const ninja = which.sync('ninja', {nothrow: true});
const emcmake = findExecutable('emcmake', 'Please install the emscripten SDK: https://emscripten.org/docs/getting_started/');
const ninja = tryFindExecutable('ninja');
const args = [
'cmake',
'-S',
Expand All @@ -152,7 +167,7 @@ function emcmakeGenerateTask() {

function cmakeBuildTask(opts) {
return () => {
const cmake = which.sync('cmake');
const cmake = findExecutable('cmake', 'Please install CMake (e.g. "brew install cmake")');
const args = [
'--build',
'build',
Expand Down
4 changes: 2 additions & 2 deletions website-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build",
"start": "yarn workspace yoga-layout build && docusaurus start",
"build": "yarn workspace yoga-layout build && docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
Expand Down

0 comments on commit ebc5d37

Please sign in to comment.