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
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
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
This updates our build requirements to NodeJS v8+ and NPM v5+, both
released in 2017.
This also clarifies our support for Python 3 (not well-documented
before) to the version we are using on Debian, v3.5.
Requiring NodeJS v8+ means our node tools (like our extern generator)
no longer need shims for compatibility. This allows us to drop the
"es6-shim" and "array-includes" modules.
In NPM v5+, the "prepublish" script has been deprecated, and replaced
with "prepublishOnly" (which is what we want) and "prepare" (the old
behavior we had to work around). This allows us to drop the
"in-publish" module.
Change-Id: Ied189c76a58fe981c12d41155b834f2d6ea73bbd
Prereleases and other build metadata can come after the three numeric
parts of the version, separated by a hyphen. This fixes both parsing
and sorting of these versions.
Fixes#1758
Change-Id: I6e24f1a96a19204178eef014e2765fc40ccb48e8
Currently when building, the compiler prints a confusing log while
compiling the wrapper. "The compiler is waiting for input via stdin."
Since we are handling that, just suppress the message.
Change-Id: Ie1ad7eba51774e80b515d37d5ae926aabc507a5f
This avoids line-length limits on Windows in the node module's
pass-through shell script.
The long list of files, combined with a node module's bin file,
tripped the Windows command-line length limit of 8k. The transition
to eslint, therefore, broke the Windows build.
Issue #1157Closes#1228
Change-Id: Ie57624efbbbfb4a27035e82ab12e788d18652ae3
If the shaka-player directory doesn't have a '.git' file, we'll use the
npm version instead of finding the '.git' file in the whole repository.
This is to prevent grabbing version tag from a parent project, which
uses shaka-player as a dependency.
Test command:
python -c 'from build import shakaBuildHelpers; print
shakaBuildHelpers.calculate_version()'
If there's is a .git file, it shows the git version.
If not, it shows the npm version.
Closes#871
Change-Id: Iee3cd6868c46f327966fd6ce5071ca7b750174b6
Rather than using print, use the logging module. This allows embedding
environments to setup logging how they want. This also ensures the logs
are flushed properly.
The prints for check.py, checkversion.py, stats.py, and for the --help
flag will still be printed to stdout since that would be the expected
output location.
Change-Id: I26e1bc866803c42981628c7e62261d13c7b3ff2b
Since node modules are required in several parts of the build
process now, avoid updating them unless package.json has changed
since the last update.
Change-Id: Ied40f198fff80bf261f77269995e9a58881a0462
/usr/bin/env python is preferable, since it allows us to support
executable scripts on systems where python is installed in places
other than /usr/bin.
Incidentally, this was the only thing I needed to do to confirm
full build support on Windows, so I'm dropping a TODO about Windows
support for the extern generator.
Change-Id: Ice93174428e0d8015d0a7787f07a17e8ac808dc7
A recent change for printing errors for missing dependencies broke
the tests script by always piping stdout to a string. This makes the
tests (and similar subprocesses) inherit stdout so it prints to the
terminal.
Change-Id: I13bcb2ac49b3ae5b1b1cc81c458124f5ac78a1e8
When a program (e.g. Java) cannot be found in the build scripts, it
will now print a more specific error message and quit early to avoid
other confusing messages.
Change-Id: I5f1f26a6c05b8db45355bfbc8d799d603c80c55c
There is a meaningless and unhelpful error message appearing at publish
time with some npm versions. Suppress it by including stderr into the
captured stdout.
Change-Id: I73693433e5df5cc8d63375c08f765fbbb801f10f
* Node binaries should have .cmd appended to file name.
* htmlhint cannot find .htmlhintrc file.
* Use same python environment for subprocesses.
Closes#526
Change-Id: I6b4c898b39a3e2eb8d808feb2b46b79fba5dc455
On versions before v1.3.12, 'npm update' appears to do nothing and
and returns success. This causes the tests to fail if the node
modules are not installed yet. Now it will detect the npm version
and print an error message if it is unsupported.
Closes#318
Change-Id: Iff1db8a6f85d5ce705e5504ee9cb23d2246b87c3
(Leaning just on traversal order, two different checkouts may produce different
file list orders for different people building, on some OS:es / file systems.)
This happens, for example, if you have modules installed locally
which are not required by shaka-player.
Change-Id: I338b66382d4e6046e1560161b192dab8e4ac78d9
Created a new build script written in python. This can be used to
build one of several available build types as well as any custom
build. It uses a custom file format to specify the contents of a
build. The default is to build the complete build.
There will be a follow up change to replace the rest of the build
scripts with python. This replaces lib.sh and build.sh, but lib.sh
still exists.
This also updates the stat script for the new output location and
now supports giving the build type name as the argument. Also can
now be run with any working directory.
Change-Id: I1243e8ad2c7e780ef67d002d4ac8d7d5e3bd5211