Commit 27b08c9a authored by timothy@apple.com's avatar timothy@apple.com

Open Source the Safari Web Inspector back to WebKit.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151453 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d30055a8
{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf340
{\fonttbl\f0\fnil\fcharset0 HelveticaNeue;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red255\green0\blue0;}
{\info
{\title Apple Computer, Inc}
{\author Joyce Chow}
{\*\company Apple Computer, Inc.}}\margl1267\margr994\margb1080\margt634\vieww30680\viewh19140\viewkind0
\deftab720
\pard\pardeftab720\ri0
\f0\b\fs24 \cf0 Apple Inc.\
Software License Agreement for Web Inspector Images\
Internal Use License Only \'96 No Redistribution Permitted\
\
PLEASE READ THIS SOFTWARE LICENSE AGREEMENT ("LICENSE") CAREFULLY BEFORE USING THE APPLE SOFTWARE INCLUDED IN THIS PACKAGE. BY USING THIS SOFTWARE, YOU ARE AGREEING TO BE BOUND BY THE TERMS OF THIS LICENSE. IF YOU DO NOT AGREE TO THE TERMS OF THIS LICENSE, DO NOT USE THIS SOFTWARE.\
\pard\pardeftab720\ri0
\b0 \cf0 \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardeftab720\ri0
\b \cf0 1. General.
\b0 The Apple binary runtime software, Apple Web Inspector images, and documentation accompanying this License whether made available by Apple for download, on media, in read only memory or in any other form (collectively the \'93Apple Software\'94) are licensed, not sold, to you by Apple Inc. (\'93Apple\'94) and Apple\'92s licensors for use only under the terms of this License. Apple and/or its licensors retain ownership of the Apple Software itself and reserve all rights not expressly granted to you. The terms of this License will govern any software updates provided by Apple that replace and/or supplement the original Apple Software, unless such update is accompanied by a separate license in which case the terms of that license will govern.\
\pard\pardeftab720\ri0
\cf0 \
\pard\pardeftab720\ri0
\b \cf0 2. Permitted License Uses and Restrictions; No Redistribution.
\b0 \
A. As used in this License, the term \'93WebKit\'94 means the official WebKit Open Source Project that is hosted by Apple at {\field{\*\fldinst{HYPERLINK "http://www"}}{\fldrslt \cf2 \ul \ulc2 www.webkit.org}}, including any and all open source projects that are part of the official WebKit source tree at {\field{\*\fldinst{HYPERLINK "http://www.webkit.org"}}{\fldrslt \cf2 \ul \ulc2 www.webkit.org}}. This License does not extend to any other forks or branches of WebKit. Subject to the terms and conditions of this License:\
\
(i) you may, in connection with your development of WebKit, use the Apple Software for personal use or internally within your business or organization, and you may make a reasonable number of copies of the Apple Software to the extent necessary to effect such internal use purposes; and \
\
(ii) you may also make one copy of the Apple Software in machine-readable form for backup purposes only.\
\
You may not redistribute the Apple Software, in whole or in part. \
\
B. In all cases, you must reproduce the Apple copyright notices that are on the original version of the Apple Software on each copy of the Apple Software that you make. If you provide copies of the Apple Software to others within your business or organization for their internal use in connection with WebKit, you must provide them with a copy of this License. You may not rent, lease, loan, sublicense, sell, transfer or otherwise redistribute the Apple Software, in whole or in part. Except as and only to the extent expressly permitted in this License or by applicable law, you may not copy, decompile, reverse engineer, disassemble, modify, create derivative works of, incorporate into or compile in combination with your own programs, the Apple Software, in whole or in part.\
\
\b 3. Termination.
\b0 This License is effective until terminated. Your rights under this License will terminate automatically without notice from Apple if you fail to comply with any term(s) of this License. Upon the termination of this License, you shall cease all use of the Apple Software and destroy all copies, full or partial, of the Apple Software. Sections 3, 4, 5, 6, 8 and 9 of this License shall survive any such termination.\
\
\b 4. Disclaimer of Warranties
\b0 . \
A. YOU EXPRESSLY ACKNOWLEDGE AND AGREE THAT, TO THE EXTENT PERMITTED BY APPLICABLE LAW, USE OF THE APPLE SOFTWARE IS AT YOUR SOLE RISK AND THAT THE ENTIRE RISK AS TO SATISFACTORY QUALITY, PERFORMANCE, ACCURACY AND EFFORT IS WITH YOU. \
\
B. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE APPLE SOFTWARE IS PROVIDED "AS IS", WITH ALL FAULTS AND WITHOUT WARRANTY OF ANY KIND, AND APPLE AND APPLE'S LICENSORS (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE PURPOSES OF SECTIONS 4 AND 5) HEREBY DISCLAIM ALL WARRANTIES AND CONDITIONS WITH RESPECT TO THE APPLE SOFTWARE, EITHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NON-INFRINGEMENT OF THIRD PARTY RIGHTS. \
\
C. APPLE DOES NOT WARRANT AGAINST INTERFERENCE WITH YOUR ENJOYMENT OF THE APPLE SOFTWARE, THAT THE FUNCTIONS CONTAINED IN THE APPLE SOFTWARE WILL MEET YOUR REQUIREMENTS, THAT THE OPERATION OF THE APPLE SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE, THAT THE APPLE SOFTWARE WILL BE COMPATIBLE OR WORK WITH ANY THIRD PARTY SOFTWARE, APPLICATIONS, OR THIRD PARTY SERVICES, OR THAT DEFECTS IN THE APPLE SOFTWARE WILL BE CORRECTED. INSTALLATION OF THIS SOFTWARE MAY AFFECT THE USABILITY OF THIRD PARTY SOFTWARE, APPLICATIONS OR THIRD PARTY SERVICES. \
\
D. NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE OR AN APPLE AUTHORIZED REPRESENTATIVE SHALL CREATE A WARRANTY. SHOULD THE APPLE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES OR LIMITATIONS ON APPLICABLE STATUTORY RIGHTS OF A CONSUMER, SO THE ABOVE EXCLUSION AND LIMITATIONS MAY NOT APPLY TO YOU. \
\b \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardeftab720\ri0
\cf0 5. Limitation of Liability.
\b0 TO THE EXTENT NOT PROHIBITED BY APPLICABLE LAW, IN NO EVENT SHALL APPLE BE LIABLE FOR PERSONAL INJURY, OR ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES WHATSOEVER, INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, LOSS OF DATA OR INFORMATION, BUSINESS INTERRUPTION OR ANY OTHER COMMERCIAL DAMAGES OR LOSSES, ARISING OUT OF OR RELATED TO YOUR USE OR INABILITY TO USE THE APPLE SOFTWARE, HOWEVER CAUSED, REGARDLESS OF THE THEORY OF LIABILITY (CONTRACT, TORT OR OTHERWISE) AND EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY FOR PERSONAL INJURY, OR OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY TO YOU. In no event shall Apple's total liability to you for all damages (other than as may be required by applicable law in cases involving personal injury) exceed the amount of fifty dollars ($50.00). The foregoing limitations will apply even if the above stated remedy fails of its essential purpose.\
\pard\pardeftab720\ri0
\cf0 \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardeftab720\ri0
\b \cf0 6. Export Control.
\b0 You may not use or otherwise export or reexport the Apple Software except as authorized by United States law and the laws of the jurisdiction in which the Apple Software was obtained. In particular, but without limitation, the Apple Software may not be exported or re-exported (a) into any U.S. embargoed countries or (b) to anyone on the U.S. Treasury Department's list of Specially Designated Nationals or the U.S. Department of Commerce Denied Person\'92s List or Entity List. By using the Apple Software, you represent and warrant that you are not located in any such country or on any such list. You also agree that you will not use the Apple Software for any purposes prohibited by United States law, including, without limitation, the development, design, manufacture or production of missiles, nuclear, chemical or biological weapons.\
\
\b 7. Government End Users.
\b0 The Apple Software and related documentation are \'93Commercial Items\'94, as that term is defined at 48 C.F.R. \'a72.101, consisting of \'93Commercial Computer Software\'94 and \'93Commercial Computer Software Documentation\'94, as such terms are used in 48 C.F.R. \'a712.212 or 48 C.F.R. \'a7227.7202, as applicable. Consistent with 48 C.F.R. \'a712.212 or 48 C.F.R. \'a7227.7202-1 through 227.7202-4, as applicable, the Commercial Computer Software and Commercial Computer Software Documentation are being licensed to U.S. Government end users (a) only as Commercial Items and (b) with only those rights as are granted to all other end users pursuant to the terms and conditions herein. Unpublished-rights reserved under the copyright laws of the United States.\
\
\b 8. Controlling Law and Severability
\b0 . This License will be governed by and construed in accordance with the laws of the State of California, excluding its conflict of law principles. This License shall not be governed by the United Nations Convention on Contracts for the International Sale of Goods, the application of which is expressly excluded. If for any reason a court of competent jurisdiction finds any provision, or portion thereof, to be unenforceable, the remainder of this License shall continue in full force and effect.\
\
\b 9. Complete Agreement.
\b0 This License constitutes the entire agreement between you and Apple relating to the use of the Apple Software and supersedes all prior or contemporaneous understandings regarding such subject matter. No amendment to or modification of this License will be binding unless in writing and signed by Apple. The parties hereto confirm that they have requested that this License and all related documents be drafted in English.\cf3 \
\pard\pardeftab720\ri0
\cf0 \
EA1013\
052413\
\
}
\ No newline at end of file
== Rolled over to ChangeLog-2013-06-11 ==
This diff is collapsed.
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf-with-dsym;
FRAMEWORK_SEARCH_PATHS = $(STAGED_FRAMEWORKS_SEARCH_PATH) $(SYSTEM_LIBRARY_DIR)/PrivateFrameworks $(FRAMEWORK_SEARCH_PATHS_$(TARGET_MAC_OS_X_VERSION_MAJOR)) $(inherited);
STAGED_FRAMEWORKS_SEARCH_PATH = $(STAGED_FRAMEWORKS_SEARCH_PATH_$(USE_STAGING_INSTALL_PATH));
STAGED_FRAMEWORKS_SEARCH_PATH_YES = $(NEXT_ROOT)$(SYSTEM_LIBRARY_DIR)/StagedFrameworks/Safari;
CLANG_CXX_LANGUAGE_STANDARD = gnu++0x;
CLANG_CXX_LIBRARY = libc++;
CLANG_WARN_CXX0X_EXTENSIONS = NO;
CLANG_WARN__DUPLICATE_METHOD_MATCH = NO
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = YES;
GCC_ENABLE_CPP_EXCEPTIONS = NO;
GCC_ENABLE_CPP_RTTI = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_ENABLE_OBJC_GC = NO;
GCC_FAST_OBJC_DISPATCH = YES;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_OPTIMIZATION_LEVEL = s;
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) $(ENGINEERING_BUILD_DEFINES) WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST;
GCC_THREADSAFE_STATICS = NO;
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES
GCC_WARN_UNUSED_VARIABLE = YES
GCC_WARN_UNUSED_VARIABLE = YES;
LINKER_DISPLAYS_MANGLED_NAMES = YES;
WARNING_CFLAGS = -Wall -W -Wchar-subscripts -Wformat-security -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings -Wno-format-y2k -Wno-unused-parameter -Wexit-time-destructors;
ENGINEERING_BUILD_DEFINES = $(ENGINEERING_BUILD_DEFINES_$(ENGINEERING_BUILD));
ENGINEERING_BUILD_DEFINES_1 = ENGINEERING_BUILD=1;
TARGET_MAC_OS_X_VERSION_MAJOR = $(MAC_OS_X_VERSION_MAJOR);
TARGETING_SAME_OS_X_VERSION = $(TARGETING_SAME_OS_X_VERSION_$(MAC_OS_X_VERSION_MAJOR)_$(TARGET_MAC_OS_X_VERSION_MAJOR));
TARGETING_SAME_OS_X_VERSION_1070_1070 = YES;
TARGETING_SAME_OS_X_VERSION_1080_1080 = YES;
TARGETING_SAME_OS_X_VERSION_1090_1090 = YES;
// Don't build against an SDK unless we're targeting an older OS version.
SDKROOT = $(SDKROOT_TARGETING_SAME_OS_X_VERSION_$(TARGETING_SAME_OS_X_VERSION));
SDKROOT_TARGETING_SAME_OS_X_VERSION_ = macosxinternal;
VALID_ARCHS = $(ARCHS_STANDARD_32_64_BIT);
WEBKIT_UMBRELLA_FRAMEWORKS_DIR = $(WEBKIT_UMBRELLA_FRAMEWORKS_DIR_$(USE_STAGING_INSTALL_PATH));
WEBKIT_UMBRELLA_FRAMEWORKS_DIR_ = $(WEBKIT_UMBRELLA_FRAMEWORKS_DIR_NO);
WEBKIT_UMBRELLA_FRAMEWORKS_DIR_NO = $(NEXT_ROOT)$(SYSTEM_LIBRARY_DIR)/Frameworks/WebKit.framework/Versions/A/Frameworks;
WEBKIT_UMBRELLA_FRAMEWORKS_DIR_YES = $(NEXT_ROOT)$(SYSTEM_LIBRARY_DIR)/StagedFrameworks/Safari;
WEBCORE_PRIVATE_HEADERS_DIR = $(WEBKIT_UMBRELLA_FRAMEWORKS_DIR)/WebCore.framework/PrivateHeaders;
WEBCORE_RESOURCES_DIR = $(WEBKIT_UMBRELLA_FRAMEWORKS_DIR)/WebCore.framework/Resources;
OTHER_LDFLAGS_VERSIONED_FRAMEWORK_PATH = -Wl,-dyld_env -Wl,DYLD_VERSIONED_FRAMEWORK_PATH=/System/Library/StagedFrameworks/Safari;
#include "Base.xcconfig"
ARCHS = $(ARCHS_STANDARD_32_64_BIT);
ONLY_ACTIVE_ARCH = YES;
MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(TARGET_MAC_OS_X_VERSION_MAJOR));
MACOSX_DEPLOYMENT_TARGET_1070 = 10.7;
MACOSX_DEPLOYMENT_TARGET_1080 = 10.8;
MACOSX_DEPLOYMENT_TARGET_1090 = 10.9;
ENGINEERING_BUILD = 1;
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
RUN_CLANG_STATIC_ANALYZER = YES;
WEBKIT_UMBRELLA_FRAMEWORKS_DIR = $(BUILT_PRODUCTS_DIR);
MAJOR_VERSION = 537;
MINOR_VERSION = 44;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
// The system version prefix is based on the current system version.
SYSTEM_VERSION_PREFIX = $(SYSTEM_VERSION_PREFIX_$(TARGET_MAC_OS_X_VERSION_MAJOR));
SYSTEM_VERSION_PREFIX_1070 = 7;
SYSTEM_VERSION_PREFIX_1080 = 8;
SYSTEM_VERSION_PREFIX_1090 = 9;
BUNDLE_VERSION = $(SYSTEM_VERSION_PREFIX)$(FULL_VERSION);
SHORT_VERSION_STRING = $(SYSTEM_VERSION_PREFIX)$(MAJOR_VERSION);
#include "Version.xcconfig"
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = $(FULL_VERSION);
FRAMEWORK_VERSION = A;
INFOPLIST_FILE = Info.plist
INSTALL_PATH = $(INSTALL_PATH_$(USE_STAGING_INSTALL_PATH));
INSTALL_PATH_ = $(INSTALL_PATH_NO);
INSTALL_PATH_NO = $(SYSTEM_LIBRARY_DIR)/PrivateFrameworks;
INSTALL_PATH_YES = $(SYSTEM_LIBRARY_DIR)/StagedFrameworks/Safari;
DYLIB_INSTALL_NAME_BASE = $(SYSTEM_LIBRARY_DIR)/PrivateFrameworks;
PRODUCT_NAME = WebInspectorUI;
GCC_DYNAMIC_NO_PIC = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) $(inherited) FRAMEWORK_NAME=WebInspectorUI;
COMBINE_INSPECTOR_RESOURCES = $(COMBINE_INSPECTOR_RESOURCES_$(CONFIGURATION));
COMBINE_INSPECTOR_RESOURCES_Debug = NO;
COMBINE_INSPECTOR_RESOURCES_Release = NO;
COMBINE_INSPECTOR_RESOURCES_Production = YES;
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.apple.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>${SHORT_VERSION_STRING}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${BUNDLE_VERSION}</string>
</dict>
</plist>
Bvar localizedStrings = new Object; Bvar localizedStrings = new Object;
include ../Makefile.shared
#!/usr/bin/perl -w
use strict;
use Getopt::Long;
use File::Basename;
use File::Path;
our $inputDirectory;
our $outputDirectory;
our $outputScriptName;
our $outputStylesheetName;
our $derivedSourcesDirectory;
our $htmlDirectory;
our $htmlFile;
GetOptions('output-dir=s' => \$outputDirectory,
'output-script-name=s' => \$outputScriptName,
'output-style-name=s' => \$outputStylesheetName,
'derived-sources-dir=s' => \$derivedSourcesDirectory,
'input-dir=s' => \$inputDirectory,
'input-html-dir=s' => \$htmlDirectory,
'input-html=s' => \$htmlFile);
unless (defined $htmlFile and defined $derivedSourcesDirectory and defined $outputDirectory and defined $outputScriptName and defined $outputStylesheetName) {
print "Usage: $0 --input-html <path> --derived-sources-dir <path> --output-dir <path> --output-script-name <name> --output-style-name <name>\n";
exit;
}
$htmlDirectory = dirname($htmlFile) unless $htmlDirectory;
our $htmlContents;
{
local $/;
open HTML, $htmlFile or die;
$htmlContents = <HTML>;
close HTML;
}
$htmlContents =~ m/<head>(.*)<\/head>/si;
our $headContents = $1;
mkpath $outputDirectory;
sub concatinateFiles($$$)
{
my $filename = shift;
my $tagExpression = shift;
my $concatinatedTag = shift;
my $fileCount = 0;
open OUT, ">", "$outputDirectory/$filename" or die "Can't open $outputDirectory/$filename: $!";
while ($headContents =~ m/$tagExpression/gi) {
local $/;
open IN, "$htmlDirectory/$1" or open IN, "$derivedSourcesDirectory/$1" or die "Can't open $htmlDirectory/$1: $!";
print OUT "\n" if $fileCount++;
print OUT "/* $1 */\n\n";
print OUT <IN>;
close IN;
}
close OUT;
# Don't use \s so we can control the newlines we consume.
my $replacementExpression = "([\t ]*)" . $tagExpression . "[\t ]*\n+";
# Replace the first occurance with a token so we can inject the concatinated tag in the same place
# as the first file that got consolidated. This makes sure we preserve some order if there are other
# items in the head that we didn't consolidate.
$headContents =~ s/$replacementExpression/$1%CONCATINATED%\n/i;
$headContents =~ s/$replacementExpression//gi;
$headContents =~ s/%CONCATINATED%/$concatinatedTag/;
}
my $inputDirectoryPattern = "(?!External\/)[^\"]*";
$inputDirectoryPattern = $inputDirectory . "\/[^\"]*" if $inputDirectory;
concatinateFiles($outputStylesheetName, "<link rel=\"stylesheet\" href=\"($inputDirectoryPattern)\">", "<link rel=\"stylesheet\" href=\"$outputStylesheetName\">");
concatinateFiles($outputScriptName, "<script src=\"($inputDirectoryPattern)\"><\/script>", "<script src=\"$outputScriptName\"></script>");
$htmlContents =~ s/<head>.*<\/head>/<head>$headContents<\/head>/si;
open HTML, ">", "$outputDirectory/" . basename($htmlFile) or die "Can't open $outputDirectory/" . basename($htmlFile) . ": $!";
print HTML $htmlContents;
close HTML;
#!/bin/sh
LICENSE=$(cat <<EOF
/*
* Copyright (C) 2007-2013 Apple Inc. All rights reserved.
* Copyright (C) 2009-2011 Google Inc. All rights reserved.
* Copyright (C) 2009-2010 Joseph Pecoraro. All rights reserved.
* Copyright (C) 2008 Matt Lilek. All rights reserved.
* Copyright (C) 2008-2009 Anthony Ricaud <rik@webkit.org>
* Copyright (C) 2009 280 North Inc. All Rights Reserved.
* Copyright (C) 2010 Nikita Vasilyev. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
EOF
)
CODE_MIRROR_LICENSE=$(echo "/*" && sed 's/^/ * /' "${SRCROOT}/UserInterface/External/CodeMirror/LICENSE" && echo " */")
if [[ ${COMBINE_INSPECTOR_RESOURCES:=YES} == "YES" ]]; then
# Combine the JavaScript and CSS files in Production builds into single files (Main.js and Main.css).
"${SRCROOT}/Scripts/combine-resources.pl" --input-html "${SRCROOT}/UserInterface/Main.html" --derived-sources-dir "${DERIVED_SOURCES_DIR}" --output-dir "${DERIVED_SOURCES_DIR}" --output-script-name "Main.js" --output-style-name "Main.css"
# Combine the CodeMirror JavaScript and CSS files in Production builds into single files (CodeMirror.js and CodeMirror.css).
"${SRCROOT}/Scripts/combine-resources.pl" --input-dir "External/CodeMirror" --input-html "${DERIVED_SOURCES_DIR}/Main.html" --input-html-dir "${SRCROOT}/UserInterface" --derived-sources-dir "${DERIVED_SOURCES_DIR}" --output-dir "${DERIVED_SOURCES_DIR}" --output-script-name "CodeMirror.js" --output-style-name "CodeMirror.css"
# Remove console.assert calls from the Main.js file.
"${SRCROOT}/Scripts/remove-console-asserts.pl" --input-script "${DERIVED_SOURCES_DIR}/Main.js" --output-script "${DERIVED_SOURCES_DIR}/Main.js"
# Export the license into Main.js.
echo "${LICENSE}" > "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Main.js"
# Export the license into CodeMirror.js and CodeMirror.css.
echo "${CODE_MIRROR_LICENSE}" > "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CodeMirror.js"
echo "${CODE_MIRROR_LICENSE}" > "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CodeMirror.css"
# Minify the Main.js and Main.css files, with Main.js appending to the license that was exported above.
python "${SRCROOT}/Scripts/jsmin.py" <"${DERIVED_SOURCES_DIR}/Main.js" >>"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Main.js"
python "${SRCROOT}/Scripts/cssmin.py" <"${DERIVED_SOURCES_DIR}/Main.css" >"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Main.css"
# Minify the CodeMirror.js and CodeMirror.css files, appending to the license that was exported above.
python "${SRCROOT}/Scripts/jsmin.py" <"${DERIVED_SOURCES_DIR}/CodeMirror.js" >>"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CodeMirror.js"
python "${SRCROOT}/Scripts/cssmin.py" <"${DERIVED_SOURCES_DIR}/CodeMirror.css" >>"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CodeMirror.css"
# Copy over Main.html and the Images directory.