From 345ff7f8d18b2a0fbeb3a3821f2274232c90c53a Mon Sep 17 00:00:00 2001 From: "aroben@apple.com" Date: Thu, 22 Sep 2011 17:48:45 +0000 Subject: [PATCH] Remove FindSafari It isn't used or built anymore. Fixes Reviewed by Darin Adler. * FindSafari: Removed this directory and its contents. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95735 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Tools/ChangeLog | 12 + Tools/FindSafari/FindSafari.cpp | 169 -------- Tools/FindSafari/FindSafari.rc | 70 --- Tools/FindSafari/FindSafari.vcproj | 481 --------------------- Tools/FindSafari/FindSafariCommon.vsprops | 13 - Tools/FindSafari/FindSafariDebug.vsprops | 11 - Tools/FindSafari/FindSafariDebugAll.vsprops | 11 - .../FindSafari/FindSafariDebugCairoCFLite.vsprops | 12 - Tools/FindSafari/FindSafariProduction.vsprops | 12 - Tools/FindSafari/FindSafariRelease.vsprops | 12 - .../FindSafariReleaseCairoCFLite.vsprops | 13 - Tools/FindSafari/FindSafariReleasePGO.vsprops | 12 - Tools/FindSafari/Safari.exe.manifest | 129 ------ Tools/FindSafari/resource.h | 16 - 14 files changed, 12 insertions(+), 961 deletions(-) delete mode 100644 Tools/FindSafari/FindSafari.cpp delete mode 100644 Tools/FindSafari/FindSafari.rc delete mode 100644 Tools/FindSafari/FindSafari.vcproj delete mode 100644 Tools/FindSafari/FindSafariCommon.vsprops delete mode 100644 Tools/FindSafari/FindSafariDebug.vsprops delete mode 100644 Tools/FindSafari/FindSafariDebugAll.vsprops delete mode 100644 Tools/FindSafari/FindSafariDebugCairoCFLite.vsprops delete mode 100644 Tools/FindSafari/FindSafariProduction.vsprops delete mode 100644 Tools/FindSafari/FindSafariRelease.vsprops delete mode 100644 Tools/FindSafari/FindSafariReleaseCairoCFLite.vsprops delete mode 100644 Tools/FindSafari/FindSafariReleasePGO.vsprops delete mode 100644 Tools/FindSafari/Safari.exe.manifest delete mode 100644 Tools/FindSafari/resource.h diff --git a/Tools/ChangeLog b/Tools/ChangeLog index 60a6a2f..63e0727 100644 --- a/Tools/ChangeLog +++ b/Tools/ChangeLog @@ -1,5 +1,17 @@ 2011-09-22 Adam Roben + Remove FindSafari + + It isn't used or built anymore. + + Fixes + + Reviewed by Darin Adler. + + * FindSafari: Removed this directory and its contents. + +2011-09-22 Adam Roben + Remove FindSafari from all our .sln files It isn't used anymore, so there's no point in building it. diff --git a/Tools/FindSafari/FindSafari.cpp b/Tools/FindSafari/FindSafari.cpp deleted file mode 100644 index c3d149f..0000000 --- a/Tools/FindSafari/FindSafari.cpp +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright (C) 2007, 2009 Apple Inc. 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ - -#include "resource.h" - -#include -#include -#include -#include - -#define LOG(header, ...) \ - do { \ - _ftprintf(stderr, header); \ - _ftprintf(stderr, __VA_ARGS__); \ - } while (0) -#define LOG_WARNING(...) LOG(TEXT("WARNING: "), __VA_ARGS__) -#define LOG_ERROR(...) LOG(TEXT("ERROR: "), __VA_ARGS__) - -static TCHAR* getStringValue(HKEY key, LPCTSTR valueName) -{ - DWORD type = 0; - DWORD bufferSize = 0; - if (RegQueryValueEx(key, valueName, 0, &type, 0, &bufferSize) != ERROR_SUCCESS || type != REG_SZ) - return 0; - - TCHAR* buffer = (TCHAR*)malloc(bufferSize); - if (RegQueryValueEx(key, valueName, 0, &type, reinterpret_cast(buffer), &bufferSize) != ERROR_SUCCESS) { - free(buffer); - return 0; - } - - return buffer; -} - -static TCHAR* getInstalledWebKitDirectory() -{ - LPCTSTR installPathKeyString = TEXT("SOFTWARE\\Apple Computer, Inc.\\Safari"); - LPCTSTR installPathWin64KeyString = TEXT("SOFTWARE\\Wow6432Node\\Apple Computer, Inc.\\Safari"); - HKEY installPathKey = 0; - LONG error = RegOpenKeyEx(HKEY_LOCAL_MACHINE, installPathKeyString, 0, KEY_READ, &installPathKey); - if (error != ERROR_SUCCESS) - error = RegOpenKeyEx(HKEY_LOCAL_MACHINE, installPathWin64KeyString, 0, KEY_READ, &installPathKey); - if (error != ERROR_SUCCESS) { - LOG_WARNING(TEXT("Failed to open registry key %s\n"), installPathKeyString); - return 0; - } - LPTSTR webKitPath = getStringValue(installPathKey, TEXT("InstallDir")); - RegCloseKey(installPathKey); - if (!webKitPath) { - LOG_WARNING(TEXT("Couldn't retrieve value for registry key %s\n"), installPathKeyString); - return 0; - } - return webKitPath; -} - -int _tmain(int argc, TCHAR* argv[]) -{ - TCHAR* path = getInstalledWebKitDirectory(); - if (!path) { - LOG_ERROR(TEXT("Couldn't determine installed Safari path\n")); - return 1; - } - - bool printLauncher = false; - bool printEnvironment = false; - bool debugger = false; - - for (int i = 1; i < argc; ++i) { - if (!_tcscmp(argv[i], TEXT("/printSafariLauncher"))) { - printLauncher = true; - continue; - } - if (!_tcscmp(argv[i], TEXT("/printSafariEnvironment"))) { - printEnvironment = true; - continue; - } - if (!_tcscmp(argv[i], TEXT("/debugger"))) { - debugger = true; - continue; - } - } - - // printLauncher is inclusive of printEnvironment, so do not - // leave both enabled: - if (printLauncher && printEnvironment) - printEnvironment = false; - - if (!printLauncher && !printEnvironment) { - _tprintf(TEXT("%s\n"), path); - free(path); - return 0; - } - - LPCTSTR lines[] = { - TEXT("@echo off"), - TEXT("del /s /q \"%%TMP%%\\WebKitNightly\""), - TEXT("mkdir 2>NUL \"%%TMP%%\\WebKitNightly\\Safari.resources\""), - TEXT("mkdir 2>NUL \"%%TMP%%\\WebKitNightly\\WebKit.resources\""), - TEXT("mkdir 2>NUL \"%%TMP%%\\WebKitNightly\\JavaScriptCore.resources\""), - TEXT("xcopy /y /i /d \"%sSafari.exe\" \"%%TMP%%\\WebKitNightly\""), - TEXT("if exist \"%sSafari.dll\" xcopy /y /i /d \"%sSafari.dll\" \"%%TMP%%\\WebKitNightly\""), - TEXT("xcopy /y /i /d /e \"%sSafari.resources\" \"%%TMP%%\\WebKitNightly\\Safari.resources\""), - TEXT("xcopy /y /i /d /e \"%splugins\" \"%%TMP%%\\WebKitNightly\\plugins\""), - TEXT("xcopy /y /i /d WebKit.dll \"%%TMP%%\\WebKitNightly\""), - TEXT("xcopy /y /i /d WebKit.pdb \"%%TMP%%\\WebKitNightly\""), - TEXT("xcopy /y /i /d /e WebKit.resources \"%%TMP%%\\WebKitNightly\\WebKit.resources\""), - TEXT("xcopy /y /i /d JavaScriptCore.dll \"%%TMP%%\\WebKitNightly\""), - TEXT("xcopy /y /i /d JavaScriptCore.pdb \"%%TMP%%\\WebKitNightly\""), - TEXT("xcopy /y /i /d /e JavaScriptCore.resources \"%%TMP%%\\WebKitNightly\\JavaScriptCore.resources\""), - TEXT("set PATH=%%CD%%;%s;%%PATH%%"), - }; - - LPCTSTR command = TEXT("\"%TMP%\\WebKitNightly\\Safari.exe\""); - - LPCTSTR launchLines[] = { - TEXT("%s"), - }; - - LPCTSTR debuggerLines[] = { - TEXT("if exist \"%%DevEnvDir%%\\VCExpress.exe\" ("), - TEXT("\"%%DevEnvDir%%\\VCExpress.exe\" /debugExe %s"), - TEXT(") else ("), - TEXT("\"%%DevEnvDir%%\\devenv.exe\" /debugExe %s"), - TEXT(")"), - }; - - for (int i = 0; i < ARRAYSIZE(lines); ++i) { - _tprintf(lines[i], path, path); - _tprintf(TEXT("\n")); - } - - LPCTSTR* endLines = debugger ? debuggerLines : launchLines; - - // Don't print launch command if we just want the environment set up... - if (!printEnvironment) { - for (unsigned i = 0; i < (debugger ? ARRAYSIZE(debuggerLines) : ARRAYSIZE(launchLines)); ++i) { - _tprintf(endLines[i], command); - _tprintf(TEXT("\n")); - } - } - - free(path); - return 0; -} diff --git a/Tools/FindSafari/FindSafari.rc b/Tools/FindSafari/FindSafari.rc deleted file mode 100644 index 7d4abac..0000000 --- a/Tools/FindSafari/FindSafari.rc +++ /dev/null @@ -1,70 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "windows.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""windows.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// RT_MANIFEST -// - -IDR_SAFARI_MANIFEST RT_MANIFEST "Safari.exe.manifest" -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/Tools/FindSafari/FindSafari.vcproj b/Tools/FindSafari/FindSafari.vcproj deleted file mode 100644 index 12fbc7b..0000000 --- a/Tools/FindSafari/FindSafari.vcproj +++ /dev/null @@ -1,481 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Tools/FindSafari/FindSafariCommon.vsprops b/Tools/FindSafari/FindSafariCommon.vsprops deleted file mode 100644 index cbbc8e6..0000000 --- a/Tools/FindSafari/FindSafariCommon.vsprops +++ /dev/null @@ -1,13 +0,0 @@ - - - - diff --git a/Tools/FindSafari/FindSafariDebug.vsprops b/Tools/FindSafari/FindSafariDebug.vsprops deleted file mode 100644 index 4babd3c..0000000 --- a/Tools/FindSafari/FindSafariDebug.vsprops +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/Tools/FindSafari/FindSafariDebugAll.vsprops b/Tools/FindSafari/FindSafariDebugAll.vsprops deleted file mode 100644 index 67a087d..0000000 --- a/Tools/FindSafari/FindSafariDebugAll.vsprops +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/Tools/FindSafari/FindSafariDebugCairoCFLite.vsprops b/Tools/FindSafari/FindSafariDebugCairoCFLite.vsprops deleted file mode 100644 index e445dbd..0000000 --- a/Tools/FindSafari/FindSafariDebugCairoCFLite.vsprops +++ /dev/null @@ -1,12 +0,0 @@ - - - diff --git a/Tools/FindSafari/FindSafariProduction.vsprops b/Tools/FindSafari/FindSafariProduction.vsprops deleted file mode 100644 index afb7d22..0000000 --- a/Tools/FindSafari/FindSafariProduction.vsprops +++ /dev/null @@ -1,12 +0,0 @@ - - - diff --git a/Tools/FindSafari/FindSafariRelease.vsprops b/Tools/FindSafari/FindSafariRelease.vsprops deleted file mode 100644 index ca994f4..0000000 --- a/Tools/FindSafari/FindSafariRelease.vsprops +++ /dev/null @@ -1,12 +0,0 @@ - - - diff --git a/Tools/FindSafari/FindSafariReleaseCairoCFLite.vsprops b/Tools/FindSafari/FindSafariReleaseCairoCFLite.vsprops deleted file mode 100644 index b1e4748..0000000 --- a/Tools/FindSafari/FindSafariReleaseCairoCFLite.vsprops +++ /dev/null @@ -1,13 +0,0 @@ - - - diff --git a/Tools/FindSafari/FindSafariReleasePGO.vsprops b/Tools/FindSafari/FindSafariReleasePGO.vsprops deleted file mode 100644 index 1755933..0000000 --- a/Tools/FindSafari/FindSafariReleasePGO.vsprops +++ /dev/null @@ -1,12 +0,0 @@ - - - diff --git a/Tools/FindSafari/Safari.exe.manifest b/Tools/FindSafari/Safari.exe.manifest deleted file mode 100644 index 08c85cf..0000000 --- a/Tools/FindSafari/Safari.exe.manifest +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Tools/FindSafari/resource.h b/Tools/FindSafari/resource.h deleted file mode 100644 index 91d1053..0000000 --- a/Tools/FindSafari/resource.h +++ /dev/null @@ -1,16 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by FindSafari.rc -// -#define IDR_SAFARI_MANIFEST 100 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 103 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif -- 2.7.4