Commit Graph

12 Commits

Author SHA1 Message Date
Joey Parrish 7e6a0f38ff fix: Correct license headers in misc. files
This corrects/normalizes license headers in misc. files, such as
config files, docs, build tools, tests, and externs.  This does not
affect the compiled output, and is only done for consistency.

Issue #2638

Change-Id: I9d8da2de55243b08d7df2b743aac73c6f15e858a
2020-06-09 16:13:56 -07:00
Joey Parrish 1076b78465 Unfork Closure base and update the compiler
The Closure Library's base.js, the Closure Compiler, and the Closure
deps-writer are all now loaded via NPM instead of commiting them
directly to the repo.  This also updates both the library and compiler
to the latest version: 20200406.

We still have a fork of the Closure Library's URI parser.  The latest
upstream version of that has too many dependencies on the rest of the
library to import directly from NPM.

Some internals of the build system have been refactored, and the
"complete" set of files in the build system now includes third_party.

Our forked URI parser does not pass lint checks yet, so the linter
does not run over third_party yet.

A couple of overly-severe sets of compiler checks have been disabled,
since even the latest Closure Library's base.js doesn't pass them.

The script-loader in load.js had to be updated for compatibility with
the new Closure Library.  If you don't return "true" now, Closure's
base.js will stop loading subsequent source files.

Some local externs that we had written are now available from the
compiler, so our local copies have been deleted.

A few type-related changes have been made as well, removing casts that
were necessary with the old compiler, but not necessary with the new
one.

Finally, this corrects some type issues in the tests using the new
"typeof" annotation from the compiler.  This allows us to type a
variable as a class defined elsewhere.  For example, after loading the
compiled library, we can reference compiledShaka.Player, which has the
type "typeof shaka.Player".  The compiler can then type-check all uses
of it in the tests.

Closes #2528 (bad polyfill code generated by the old compiler)

Change-Id: I62ec61e82d4edf342b2c576c2d4f89f11562ee65
2020-04-30 19:32:30 -07:00
Jacob Trimble 6ab4e68ff2 Fix default encoding when reading files.
Under Windows, the default encoding isn't UTF-8, so we are getting
encoding errors when trying to read files.  This adds a helper to
explicitly set the encoding to UTF-8 in Python3.  This doesn't really
affect Python2 since it reads the file as byte strings.

We can't use 'locale.setlocale' to fix this since (at least on my
machine) we can't set the encoding to be UTF-8 on Windows.

Fixes #2206

Change-Id: I76e35cc9ae638b433ca61c7bda6478e989bc755a
2019-10-25 17:23:28 +00:00
Theodore Abshire f24c4a783f Added stylelint, a linter for our CSS/less files.
Also unified CSS/less style based on that.
This does have to use a forked version of stylelint, since there
is a bug (?) in the globbing library they use that causes it to
fail on our buildbot. I found the simplest solution was just to add
an option to disable globbing, a feature we weren't using anyway.

Closes #1867

Change-Id: I9295b01d5b15d060356e314938b64b551b75de6a
2019-08-08 18:38:19 +00:00
Jacob Trimble 0cebfe649c Rebuild for changes in build scripts.
Now if the build scripts change, the auto-detection for changed files
will force the library to be rebuilt.  This allows detecting changes to
the build script when determining if there are changes.

Change-Id: Ibf4fc3fb2197ae5993c9acd7adb65c88e205b6f4
2019-06-11 22:37:06 +00:00
Joey Parrish fd94c685ee Use clean-css plugin in less.js to minify CSS
Saves 30kB on the UI controls CSS and 8.5kB on the demo app CSS.

Change-Id: Ia17a8096bf014f257eefc3ded918ff2452436154
2019-05-13 17:43:40 +00:00
Joey Parrish e07be4b5ac Fix change detection for docs build
When we change the tutorials, this should trigger a rebuild of the
docs.  The full list of source files for the docs is now correct, so
changes to any of them will trigger a rebuild of the docs.

Change-Id: I2328e592237735e41508e8bb984d062e687c8104
2019-04-24 09:45:19 -07:00
Joey Parrish 79f0666c59 Fix a build script corner case
In some cases, build/check.py is run before there are no generated
localizations.  Although this doesn't care what locales are built,
something needs to be built anyway.  So we need a default value to
build with in this case.

Change-Id: Ie7af33d4ba5576ed68d4d558710254012f7d7784
2019-04-17 23:12:29 +00:00
Joey Parrish 00442a9a7c Split up localization data for lazy loading
This changes the format of the localization data to enable apps to
trivially lazy-load translations.  It also adds --locales to the build
scripts to allow app developers to choose the compiled-in locales.
The generated output now goes into dist/ and is not checked into
revision control.  Finally, it adds "description" and "meaning" fields
to the source messages to allow us to more easily integrate with a
context-aware human translation service.  The "description" field
provides application context for the translator, while the "meaning"
field provides linguistic disambiguation for words with multiple
meanings or parts of speech in the original English.

Because the translation service wants to collapse messages with
identical text, we had to merge several messages together.  To this
end, we have removed the prefixes "ARIA_LABEL_" and "LABEL_" from the
messages themselves and collapsed what remained.

Issue #1688

Change-Id: I24c17e71c73f6663cf123cfdba118c486fa80ecc
2019-04-09 16:06:14 -07:00
Joey Parrish b342045afe Add support for multiple Less sources
I will break up our monolithic less file into pieces, but first the
build system needs to understand this.  It should see changes to any
less file as warranting a rebuild, but the actual compiler command
only takes the top-level less file on the command-line.

Pre-work for #1703, #1709, and b/116651454

Change-Id: I7be8f9467fa6df449f89ed8f5488fc1c735f0b75
2018-12-07 10:09:37 -08:00
Jacob Trimble b3f2141dbd Fix paths on Windows.
Fixes #1700

Change-Id: I864da5023e82639a0e81ca8f9c26563add93f2ab
2018-12-04 16:51:12 +00:00
Sandra Lokshina 6b1ca2d229 Initial release of Shaka Player UI
Other contributors:
 - @joeyparrish
 - @michellezhuogg
 - @TheModMaker
 - @theodab
 - @vaage

Change-Id: If6df33d9ab5035d1ead4402004f7de37ee8470f4
2018-11-16 14:40:37 -08:00