Modified: trunk/Source/WebInspectorUI/Scripts/copy-user-interface-resources.pl (220872 => 220873)
--- trunk/Source/WebInspectorUI/Scripts/copy-user-interface-resources.pl 2017-08-17 20:25:32 UTC (rev 220872)
+++ trunk/Source/WebInspectorUI/Scripts/copy-user-interface-resources.pl 2017-08-17 20:30:12 UTC (rev 220873)
@@ -144,10 +144,12 @@
my $codeMirrorPath = File::Spec->catdir($uiRoot, 'External', 'CodeMirror');
my $esprimaPath = File::Spec->catdir($uiRoot, 'External', 'Esprima');
my $eslintPath = File::Spec->catdir($uiRoot, 'External', 'ESLint');
+my $threejsPath = File::Spec->catdir($uiRoot, 'External', 'three.js');
my $codeMirrorLicense = readLicenseFile(File::Spec->catfile($codeMirrorPath, 'LICENSE'));
my $esprimaLicense = readLicenseFile(File::Spec->catfile($esprimaPath, 'LICENSE'));
my $eslintLicense = readLicenseFile(File::Spec->catfile($eslintPath, 'LICENSE'));
+my $threejsLicense = readLicenseFile(File::Spec->catfile($threejsPath, 'LICENSE'));
make_path($protocolDir, $targetResourcePath);
# Copy over dynamically loaded files from other frameworks, even if we aren't combining resources.
@@ -218,6 +220,15 @@
'--output-dir', $derivedSourcesDir,
'--output-script-name', 'ESLint.js');
+ # Combine the three.js _javascript_ files in Production builds into a single file (Three.js).
+ system($perl, $combineResourcesCmd,
+ '--input-dir', 'External/three.js',
+ '--input-html', $derivedSourcesMainHTML,
+ '--input-html-dir', $uiRoot,
+ '--derived-sources-dir', $derivedSourcesDir,
+ '--output-dir', $derivedSourcesDir,
+ '--output-script-name', 'Three.js');
+
# Remove console.assert calls from the Main.js file.
my $derivedSourcesMainJS = File::Spec->catfile($derivedSourcesDir, 'Main.js');
system($perl, File::Spec->catfile($scriptsRoot, 'remove-console-asserts.pl'),
@@ -258,6 +269,10 @@
my $targetESLintJS = File::Spec->catfile($targetResourcePath, 'ESLint.js');
seedFile($targetESLintJS, $eslintLicense);
+ # Export the license into Three.js.
+ my $targetThreejsJS = File::Spec->catfile($targetResourcePath, 'Three.js');
+ seedFile($targetThreejsJS, $threejsLicense);
+
# Minify the Main.js and Main.css files, with Main.js appending to the license that was exported above.
my $jsMinScript = File::Spec->catfile($sharedScriptsRoot, 'jsmin.py');
my $cssMinScript = File::Spec->catfile($sharedScriptsRoot, 'cssmin.py');
@@ -278,6 +293,10 @@
my $derivedSourcesESLintJS = File::Spec->catfile($derivedSourcesDir, 'ESLint.js');
system(qq("$python" "$jsMinScript" < "$derivedSourcesESLintJS" >> "$targetESLintJS")) and die "Failed to minify $derivedSourcesESLintJS: $!";
+ # Minify the Three.js file, appending to the license that was exported above.
+ my $derivedSourcesThreejsJS = File::Spec->catfile($derivedSourcesDir, 'Three.js');
+ system(qq("$python" "$jsMinScript" < "$derivedSourcesThreejsJS" >> "$targetThreejsJS")) and die "Failed to minify $derivedSourcesThreejsJS: $!";
+
# Copy over Main.html and the Images directory.
copy($derivedSourcesMainHTML, File::Spec->catfile($targetResourcePath, 'Main.html'));