Skip to content

Commit 6f274cb

Browse files
authored
build: Stop using deprecated tool to generate closure deps (#4060)
The depswriter.py tool from google-closure-library was generating deprecation warnings. This switches to a newer, rewritten version called google-closure-deps.
1 parent 33e8400 commit 6f274cb

File tree

3 files changed

+61
-39
lines changed

3 files changed

+61
-39
lines changed

build/gendeps.py

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,6 @@
2424
import shakaBuildHelpers
2525

2626

27-
# The relative path in each of these is relative to Closure's base.js, which
28-
# lives at node_modules/google-closure-library/closure/goog/base.js
29-
deps_args = [
30-
'--root_with_prefix=lib ../../../../lib',
31-
'--root_with_prefix=ui ../../../../ui',
32-
'--root_with_prefix=third_party ../../../../third_party',
33-
'--root_with_prefix=dist ../../../../dist',
34-
'--root_with_prefix=demo ../../../../demo',
35-
]
36-
37-
3827
def main(_):
3928
"""Generates the uncompiled dependencies files."""
4029
# Update node modules if needed.
@@ -50,12 +39,19 @@ def main(_):
5039
except OSError:
5140
pass
5241
os.chdir(base)
53-
deps_writer = os.path.join(
54-
'node_modules', 'google-closure-library',
55-
'closure', 'bin', 'build', 'depswriter.py')
42+
43+
make_deps = shakaBuildHelpers.get_node_binary(
44+
'google-closure-deps', 'closure-make-deps')
5645

5746
try:
58-
cmd_line = [sys.executable or 'python', deps_writer] + deps_args
47+
cmd_line = make_deps + [
48+
# Folders to search for sources using goog.require/goog.provide
49+
'-r', 'demo', 'lib', 'ui', 'third_party',
50+
# Individual files to add to those
51+
'-f', 'dist/locales.js',
52+
# The path to the folder containing the Closure library's base.js
53+
'--closure-path', 'node_modules/google-closure-library/closure/goog',
54+
]
5955
deps = shakaBuildHelpers.execute_get_output(cmd_line)
6056
with open(os.path.join(base, 'dist', 'deps.js'), 'wb') as f:
6157
f.write(deps)

package-lock.json

Lines changed: 47 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@
2929
"esprima": "^4.0.1",
3030
"fastestsmallesttextencoderdecoder": "^1.0.22",
3131
"fontfaceonload": "^1.0.2",
32-
"google-closure-compiler-java": "^20220202.0.0",
33-
"google-closure-library": "^20220104.0.0",
32+
"google-closure-compiler-java": "^20220301.0.0",
33+
"google-closure-deps": "^20220301.0.0",
34+
"google-closure-library": "^20220301.0.0",
3435
"htmlhint": "github:joeyparrish/HTMLHint#1c3a7e8b",
3536
"jasmine-ajax": "^4.0.0",
3637
"jimp": "^0.16.1",

0 commit comments

Comments
 (0)