Skip to content

Commit

Permalink
Copy phet-io wrappers on build, see #785
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Aug 5, 2019
1 parent 0dcc680 commit cbefe57
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion js/grunt/buildRunnable.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ module.exports = async function( repo, minifyOptions, instrument, allHTML, brand
}

if ( brand === 'phet-io' ) {
await copySupplementalPhetioFiles( repo, version, englishTitle );
await copySupplementalPhetioFiles( repo, version, englishTitle, packageObject );
}

// Thumbnails and twitter card
Expand Down
5 changes: 5 additions & 0 deletions js/grunt/getPhetLibs.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ module.exports = function getPhetLibs( repo, brand ) {
phetLibs = phetLibs.concat( packageObject.phet[ brand ].phetLibs );
}

// wrappers are also marked as phetLibs, so we can get their shas without listing them twice
if ( brand === 'phet-io' ) {
phetLibs = phetLibs.concat( packageObject.phet[ brand ].wrappers || [] );
}

// sort and remove duplicates
return _.uniq( phetLibs.sort() );
}
Expand Down
7 changes: 6 additions & 1 deletion js/grunt/phet-io/copySupplementalPhetioFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const JSDOC_FILES = [
];
const JSDOC_README_FILE = '../phet-io/doc/wrapper/phet-io-documentation_README.md';

module.exports = async function( repo, version, simulationDisplayName ) {
module.exports = async function( repo, version, simulationDisplayName, packageObject ) {

const buildDir = `../${repo}/build/phet-io/`;
const wrappersLocation = `${buildDir}${WRAPPERS_FOLDER}`;
Expand Down Expand Up @@ -238,6 +238,11 @@ module.exports = async function( repo, version, simulationDisplayName ) {

// Make sure to copy the phet-io-wrappers common wrapper code too.
wrappers.push( WRAPPER_COMMON_FOLDER );

// Add sim-specific wrappers
const simSpecificWrappers = packageObject.phet && packageObject.phet[ 'phet-io' ] && packageObject.phet[ 'phet-io' ].wrappers ? packageObject.phet[ 'phet-io' ].wrappers : [];
simSpecificWrappers.forEach( simSpecificWrapper => wrappers.push( simSpecificWrapper ) );

wrappers.forEach( function( wrapper ) {

const wrapperParts = wrapper.split( '/' );
Expand Down

0 comments on commit cbefe57

Please sign in to comment.