phetsims / chipper

Tools for developing and building PhET interactive simulations.
MIT License
11 stars 14 forks source link

Make sure license.json entries match directory contents #185

Closed samreid closed 9 years ago

samreid commented 9 years ago

From the following issues: https://github.com/phetsims/sherpa/issues/35 https://github.com/phetsims/sherpa/issues/38 https://github.com/phetsims/chipper/issues/182

It is desirable to make sure that the entries in the license.json exactly match the directory listing, so that we can be sure there are no orphan entries or library contents. Now that license.json has been normalized across images/audio/code, we can address this uniformly.

Let's start this as a grunt task that iterates starting at a directory. Getting this to run on the appropriate sub-set of directories for a single simulation build would be much more difficult.

samreid commented 9 years ago

I added a test for license.json entry orphans: here is the result:

balancing-act/images/balance-with-supports-icon.png balancing-act/images/balance-without-supports-icon.png balloons-and-static-electricity/images/sweater.svg beaker/images/concentration-meter-probe.png capacitor-lab-basics/images/probe_3D_black.png capacitor-lab-basics/images/probe_3D_red.png color-vision/images/head-no-brain.png color-vision/images/head-with-brain.png energy-forms-and-changes/images/license.txt energy-skate-park-basics/images/close-button.png energy-skate-park-basics/images/reset_arrow.svg energy-skate-park-basics/images/scissors.png energy-skate-park-basics/images/scissors-closed.png energy-skate-park-basics/images/scissors-gray.png forces-and-motion-basics/images/go_hover.png forces-and-motion-basics/images/go_pressed.png forces-and-motion-basics/images/go_up.png forces-and-motion-basics/images/pull_figure_BLUE_1.png forces-and-motion-basics/images/pull_figure_BLUE_2.png forces-and-motion-basics/images/pull_figure_lrg_BLUE_1.png forces-and-motion-basics/images/pull_figure_lrg_BLUE_2.png forces-and-motion-basics/images/pull_figure_lrg_RED_1.png forces-and-motion-basics/images/pull_figure_RED_1.png forces-and-motion-basics/images/pull_figure_RED_2.png forces-and-motion-basics/images/pull_figure_small_BLUE_1.png forces-and-motion-basics/images/pull_figure_small_BLUE_2.png forces-and-motion-basics/images/pull_figure_small_RED_1.png forces-and-motion-basics/images/pull_figure_small_RED_2.png forces-and-motion-basics/images/stop_hover.png forces-and-motion-basics/images/stop_pressed.png forces-and-motion-basics/images/stop_up.png gravity-and-orbits/images/measuringTape.png gravity-and-orbits/images/sun.png isotopes-and-atomic-mass/images/BlackBox.png scenery-phet/assets/Clock.ai scenery-phet/assets/SimpleClock.ai sherpa/lib/jama-1.0.2 sherpa/lib/numeric-quadratic-programming-1.2.6 sherpa/lib/pegjs-0.7.0.js sherpa/lib/requirejs-2.1.11.js sherpa/lib/syntaxhighlighter-3.0.83.js sherpa/lib/easing-equations-r12 under-pressure/images/handle.png under-pressure/images/mass.png wave-on-a-string/images/button_sim_pause.png wave-on-a-string/images/button_sim_play.png wave-on-a-string/images/button_step_unpressed.png wave-on-a-string/images/button_step_hover.png wave-on-a-string/images/button_step_pressed.png wave-on-a-string/images/button_step_deactivated.png wave-on-a-string/images/button_timer_pause_unpressed.png wave-on-a-string/images/button_timer_start_unpressed.png wave-on-a-string/images/wrench_2.svg wave-on-a-string/images/oscillator_wheel.png wave-on-a-string/images/window_edge.png

samreid commented 9 years ago

After cleaning up orphan entries, I have this output:

sherpa/lib/jama-1.0.2 sherpa/lib/numeric-quadratic-programming-1.2.6 sherpa/lib/pegjs-0.7.0.js sherpa/lib/requirejs-2.1.11.js sherpa/lib/syntaxhighlighter-3.0.83.js sherpa/lib/easing-equations-r12

These entries do not require a file in sherpa.

samreid commented 9 years ago

The cleanup commits are above.

samreid commented 9 years ago

For images & audio, the build process checks to see if there are any images & audio used by the simulation that don't have an entry in the license.json.

However, there are still 2 tasks we should complete:

  1. Are there any sherpa code entries that are missing annotations in license.json?
  2. Are there any images/audio that are checked in to a simulation directory but not used?
samreid commented 9 years ago

For (2) above, we may just wish to create a review item that says "check that all images/audio are used in the simulation"

samreid commented 9 years ago

Here is a report of all of the images that do not have an entry in the license.json files. Perhaps some of these will be used in the future?

build-a-molecule/images/green-left.png build-a-molecule/images/green-middle.png build-a-molecule/images/green-right.png build-a-molecule/images/ico2cur.py build-a-molecule/images/scissors-closed-up.cur build-a-molecule/images/scissors-closed-up.png build-a-molecule/images/scissors-closed.cur build-a-molecule/images/scissors-closed.png build-a-molecule/images/scissors-up.cur build-a-molecule/images/scissors-up.png build-a-molecule/images/scissors.cur build-a-molecule/images/split-blue.png capacitor-lab-basics/images/closeButton.png capacitor-lab-basics/images/probe_3D_field_large.png color-vision/images/head.svg gene-expression-basics/images/GEB-02.png gene-expression-basics/images/GEB-03.png gene-expression-basics/images/GEB-04.png gene-expression-basics/images/GEB-05.png gene-expression-basics/images/GEB-06.png neuron/images/neuron-mockup.png neuron/images/neuron-particles-test-texture.png neuron/images/neuron-particles-texture-2.png neuron/images/neuron-particles.png plinko-probability/images/mockup01.png plinko-probability/images/mockup02.png rutherford-scattering/images/exampleGun.jpg rutherford-scattering/images/gunOffButton.png rutherford-scattering/images/gunOnButton.png rutherford-scattering/images/plumPudding-Fireworks.png rutherford-scattering/images/plumPudding.png rutherford-scattering/images/ray-gun.png rutherford-scattering/images/testImage.png scenery-phet/assets/battery-D-cell.ai scenery-phet/assets/eye_dropper.ai scenery-phet/assets/flame.ai scenery-phet/assets/ice-cube-stack.ai scenery-phet/assets/light-bulb.ai sherpa/lib/bootstrap-2.2.2.css sherpa/lib/bootstrap-responsive-2.2.2.css sherpa/lib/jquery-2.1.0.min.js sherpa/lib/lodash-2.4.1.min.js sherpa/lib/poly2tri-1.3.5.js sherpa/lib/qunit-1.14.0.css sherpa/lib/require-2.1.11.js sherpa/lib/syntaxhighlighter-3.0.83 sherpa/lib/three-r68.min.js sugar-and-salt-solutions/images/battery.png sugar-and-salt-solutions/images/lightBulbBase.png sugar-and-salt-solutions/images/lightBulbGlass.png sugar-and-salt-solutions/images/lightBulbGlassMask.png

samreid commented 9 years ago

I think at this week's developer meeting we decided on a warning for unused images/audio.

samreid commented 9 years ago

Committed: 78faca3b125c5f9e45a684bdcf1c5956ac8d1f52

samreid commented 9 years ago

Are there any images/audio that are checked in to a simulation directory but not used?

This was solved by adding a warning into the build step.

So all that is left for this issue is

Are there any sherpa code entries that are missing annotations in license.json?

This latter issue should just be done manually since sherpa entries are used in a variety of ways & places.

samreid commented 9 years ago

I manually verified that all sherpa entries are (a) used or needed for a project where they might be used and (b) have an entry in license.json for at least one of their files. I don't think it's worth the trouble at this point to modify the license.json schema to accommodate multiple files (such as the minified and non-minified jquery or the multiple files for bootstrap, etc.) Closing.