Build fix. Rolling back changes in http://trac.webkit.org/changeset/174721.
[WebKit-https.git] / Source / WebInspectorUI / Scripts / copy-user-interface-resources-dryrun.rb
1 #!/usr/bin/ruby
2
3 require 'fileutils'
4 require 'tmpdir'
5
6 if ARGV.size != 1
7   puts "usage: #{File.basename $0} <output-directory>"
8   exit 1
9 end
10
11 WEB_INSPECTOR_PATH = File.expand_path File.join(File.dirname(__FILE__), "..")
12 COPY_USER_INTERFACE_RESOURCES_PATH = File.join WEB_INSPECTOR_PATH, "Scripts", "copy-user-interface-resources.pl"
13
14 $output_directory = File.expand_path ARGV[0]
15
16 Dir.mktmpdir do |tmpdir|
17
18   # Create the output directory if needed.
19   FileUtils.mkdir_p $output_directory
20   
21   # Create empty derived sources expected to exist.
22   FileUtils.touch(File.join(tmpdir, 'InspectorJSBackendCommands.js'))
23   FileUtils.touch(File.join(tmpdir, 'InspectorWebBackendCommands.js'))
24   
25   # Setup the environment and run.
26   ENV["DERIVED_SOURCES_DIR"] = tmpdir
27   ENV["JAVASCRIPTCORE_PRIVATE_HEADERS_DIR"] = tmpdir
28   ENV["WEBCORE_PRIVATE_HEADERS_DIR"] = tmpdir
29   ENV["SRCROOT"] = WEB_INSPECTOR_PATH
30   ENV["TARGET_BUILD_DIR"] = $output_directory
31   ENV["UNLOCALIZED_RESOURCES_FOLDER_PATH"] = ""
32   ENV["COMBINE_INSPECTOR_RESOURCES"] = "YES"
33   exec COPY_USER_INTERFACE_RESOURCES_PATH
34
35 end