Change the operating system name from OSX to MacOS everywhere

Summary:
- Changed the name in all build artifacts
- Everywhere in C++

Reviewers: #swift_pilot_client, kbasan

Reviewed By: #swift_pilot_client, kbasan

Subscribers: jenkins

Maniphest Tasks: T205

Differential Revision: https://dev.swift-project.org/D69
This commit is contained in:
Roland Winklmeier
2017-12-06 22:49:03 +01:00
parent d7d4fdff2c
commit f53ec46d20
26 changed files with 85 additions and 78 deletions

View File

@@ -22,7 +22,7 @@ win32 {
QT5_LIBRARY_DIR = $$[QT_INSTALL_BINS]
}
else:macx {
# OSX workaround using rsync. Otherwise all headers are also copied.
# MacOS workaround using rsync. Otherwise all headers are also copied.
qt5_target.path = $${PREFIX}/lib/QtCore.framework
qt5_target.extra += rsync -avzl --exclude \'Headers*\' --exclude \'*debug*\' $$[QT_INSTALL_LIBS]/QtCore.framework/ $${PREFIX}/lib/QtCore.framework/ &&
qt5_target.extra += rsync -avzl --exclude \'Headers*\' --exclude \'*debug*\' $$[QT_INSTALL_LIBS]/QtGui.framework/ $${PREFIX}/lib/QtGui.framework/ &&
@@ -211,13 +211,13 @@ bitrock_builder_bin = $$(BITROCK_BUILDER)
WINDOWS64BITMODE = 0
win32 {
INSTALLER_PLATFORM = windows
INSTALLER_BASENAME = swift-installer-win-$${WORD_SIZE}-$${BLACK_VERSION}
INSTALLER_BASENAME = swift-installer-windows-$${WORD_SIZE}-$${BLACK_VERSION}
INSTALLER_EXT = exe
equals(WORD_SIZE,64): WINDOWS64BITMODE = 1
}
else:macx {
INSTALLER_PLATFORM = osx
INSTALLER_BASENAME = swift-installer-osx-$${WORD_SIZE}-$${BLACK_VERSION}
INSTALLER_BASENAME = swift-installer-macos-$${WORD_SIZE}-$${BLACK_VERSION}
INSTALLER_EXT = app
}
else:unix {

View File

@@ -27,7 +27,7 @@
<folder>
<description>/</description>
<destination>${installdir}</destination>
<name>autoupdaterosx</name>
<name>autoupdatermacos</name>
<platforms>osx</platforms>
<distributionFileList>
<distributionFile>

View File

@@ -11,7 +11,7 @@
</setInstallerVariable>
<setInstallerVariableFromRegEx>
<name>installerBasename</name>
<pattern>(swift-installer-osx-\d+-\d.\d.\d).app</pattern>
<pattern>(swift-installer-macos-\d+-\d.\d.\d).app</pattern>
<substitution>\1</substitution>
<text>${project.installerFilename}</text>
</setInstallerVariableFromRegEx>

View File

@@ -124,7 +124,7 @@
<allowComponentSelection>1</allowComponentSelection>
<compressionAlgorithm>lzma</compressionAlgorithm>
<!-- Generate a DMG for OSX Installer -->
<!-- Generate a DMG for MacOS Installer -->
<createOsxBundleDmg>0</createOsxBundleDmg>
<!-- <allowedLanguages>en fr es it de ja nl ru zh_CN no pt_BR</allowedLanguages> -->

View File

@@ -110,7 +110,7 @@
<folder>
<description>lib</description>
<destination>${installdir}/lib</destination>
<name>lib_osx</name>
<name>lib_macos</name>
<platforms>osx</platforms>
<distributionFileList>
<distributionFile>
@@ -148,7 +148,7 @@
<folder>
<description>bin</description>
<destination>${installdir}/bin</destination>
<name>bin_osx</name>
<name>bin_macos</name>
<platforms>osx</platforms>
<distributionFileList>
<distributionFile>

View File

@@ -32,7 +32,7 @@ equals (TEMPLATE, app) {
include(copyfiles.pri)
################################
# Allow "empty" projects on OSX
# Allow "empty" projects on MacOS
################################
macx:staticlib:isEmpty(SOURCES) {

View File

@@ -91,7 +91,7 @@ class Builder:
def publish(self):
if self._should_publish():
os_map = {'Linux': 'linux', 'Darwin': 'osx', 'Windows': 'win'}
os_map = {'Linux': 'linux', 'Darwin': 'macos', 'Windows': 'windows'}
extension_map = {'Linux': 'run', 'Darwin': 'dmg', 'Windows': 'exe'}
version_segments = self.version.split('.')
lastSegment = version_segments.pop()
@@ -111,7 +111,8 @@ class Builder:
print('Packaging xswiftbus ...')
build_path = self._get_swift_build_path()
os.chdir(build_path)
archive_name = '-'.join(['xswiftbus', platform.system(), self.word_size, self.version]) + '.7z'
os_map = {'Linux': 'linux', 'Darwin': 'macos', 'Windows': 'windows'}
archive_name = '-'.join(['xswiftbus', os_map[platform.system()], self.word_size, self.version]) + '.7z'
archive_path = path.abspath(path.join(os.pardir, archive_name))
content_path = path.abspath(path.join(os.curdir, 'dist', 'xswiftbus'))
subprocess.check_call(['7z', 'a', '-mx=9', archive_path, content_path], env=dict(os.environ))
@@ -130,7 +131,8 @@ class Builder:
dumper = symbolstore.get_platform_specific_dumper(dump_syms=self.dump_syms, symbol_path=symbol_path)
dumper.process(binary_path)
dumper.finish()
tar_filename = '-'.join(['swift', 'symbols', platform.system(), self.word_size, self.version]) + '.tar.gz'
os_map = {'Linux': 'linux', 'Darwin': 'macos', 'Windows': 'windows'}
tar_filename = '-'.join(['swift', 'symbols', os_map[platform.system()], self.word_size, self.version]) + '.tar.gz'
tar_path = path.abspath(path.join(self._get_swift_source_path(), tar_filename))
dumper.pack(tar_path)
if upload_symbols:

View File

@@ -79,9 +79,9 @@ namespace BlackConfig
#endif
}
bool CBuildConfig::isRunningOnMacOSXPlatform()
bool CBuildConfig::isRunningOnMacOSPlatform()
{
#ifdef Q_OS_OSX
#ifdef Q_OS_MACOS
return true;
#else
return false;
@@ -99,7 +99,7 @@ namespace BlackConfig
bool CBuildConfig::isRunningOnUnixPlatform()
{
return isRunningOnMacOSXPlatform() || isRunningOnLinuxPlatform();
return isRunningOnMacOSPlatform() || isRunningOnLinuxPlatform();
}
bool CBuildConfig::isDebugBuild()
@@ -269,7 +269,7 @@ namespace BlackConfig
{
p = "win-" + ws;
}
else if (BlackConfig::CBuildConfig::isRunningOnMacOSXPlatform()) { p = "macos-64"; }
else if (BlackConfig::CBuildConfig::isRunningOnMacOSPlatform()) { p = "macos-64"; }
else if (BlackConfig::CBuildConfig::isRunningOnLinuxPlatform()) { p = "linux-64"; }
if (!p.isEmpty() && BlackConfig::CBuildConfig::isVatsimVersion()) { p += "-vatsim"; }

View File

@@ -80,8 +80,8 @@ namespace BlackConfig
//! Windows 10
static bool isRunningOnWindows10();
//! Running on Mac OS X platform?
static bool isRunningOnMacOSXPlatform();
//! Running on MacOS platform?
static bool isRunningOnMacOSPlatform();
//! Running on Linux platform?
static bool isRunningOnLinuxPlatform();

View File

@@ -532,8 +532,8 @@ namespace BlackCore
QLatin1String(" Unix: ") %
boolToYesNo(CBuildConfig::isRunningOnUnixPlatform()) %
separator %
QLatin1String("MacOSX: ") %
boolToYesNo(CBuildConfig::isRunningOnMacOSXPlatform());
QLatin1String("MacOS: ") %
boolToYesNo(CBuildConfig::isRunningOnMacOSPlatform());
return env;
}

View File

@@ -39,7 +39,7 @@
#include <atomic>
#include <functional>
#if defined(Q_CC_MSVC) || defined(Q_OS_OSX) // Crashpad only supported on MSVC and MacOS/X
#if defined(Q_CC_MSVC) || defined(Q_OS_MACOS) // Crashpad only supported on MSVC and MacOS/X
#define BLACK_USE_CRASHPAD
#endif

View File

@@ -41,7 +41,7 @@ namespace BlackGui
// Use datarefs Sim/operation/windows/system window via xswiftbus to grab the OS's native window handle
// http://www.xsquawkbox.net/xpsdk/mediawiki/sim%252Foperation%252Fwindows%252Fsystem_window
// For the time being, use IWindowFinder.
// The if condition is to prevent a crash on Linux/OSX.
// The if condition is to prevent a crash on Linux/MacOS.
if (!m_windowFinder.isNull()) simulatorWindow = m_windowFinder->findForeignWindow("X-System", "");
return simulatorWindow;

View File

@@ -482,7 +482,7 @@ namespace BlackGui
{
specific = fn + ".win" + qss;
}
else if (CBuildConfig::isRunningOnMacOSXPlatform())
else if (CBuildConfig::isRunningOnMacOSPlatform())
{
specific = fn + ".mac" + qss;
}

View File

@@ -14,7 +14,7 @@
#if defined(Q_OS_WIN)
#include "win/windowfinderwindows.h"
#elif defined(Q_OS_LINUX)
#elif defined(Q_OS_OSX)
#elif defined(Q_OS_MACOS)
#else
#error "Platform is not supported!"
#endif
@@ -28,7 +28,7 @@ namespace BlackGui
#if defined(Q_OS_WIN)
finder = new CWindowFinderWindows();
#elif defined(Q_OS_LINUX)
#elif defined(Q_OS_OSX)
#elif defined(Q_OS_MACOS)
#endif
return finder;

View File

@@ -33,9 +33,9 @@ unix:!macx {
}
macx {
HEADERS += $$PWD/osx/*.h
SOURCES += $$PWD/osx/*.cpp
OBJECTIVE_SOURCES += $$PWD/osx/*.mm
HEADERS += $$PWD/macos/*.h
SOURCES += $$PWD/macos/*.cpp
OBJECTIVE_SOURCES += $$PWD/macos/*.mm
LIBS += -framework CoreFoundation -framework ApplicationServices -framework Foundation -framework AppKit
}

View File

@@ -13,8 +13,8 @@
#include "win/joystickwindows.h"
#elif defined(Q_OS_LINUX)
#include "linux/joysticklinux.h"
#elif defined(Q_OS_OSX)
#include "osx/joystickmac.h"
#elif defined(Q_OS_MACOS)
#include "macos/joystickmacos.h"
#else
#error "Platform is not supported!"
#endif
@@ -33,8 +33,8 @@ namespace BlackInput
std::unique_ptr<IJoystick> ptr(new CJoystickWindows(parent));
#elif defined(Q_OS_LINUX)
std::unique_ptr<IJoystick> ptr(new CJoystickLinux(parent));
#elif defined(Q_OS_OSX)
std::unique_ptr<IJoystick> ptr(new CJoystickMac(parent));
#elif defined(Q_OS_MACOS)
std::unique_ptr<IJoystick> ptr(new CJoystickMacOS(parent));
#endif
return ptr;

View File

@@ -13,8 +13,8 @@
#include "win/keyboardwindows.h"
#elif defined(Q_OS_LINUX)
#include "linux/keyboardlinux.h"
#elif defined(Q_OS_OSX)
#include "osx/keyboardmac.h"
#elif defined(Q_OS_MACOS)
#include "macos/keyboardmacos.h"
#else
#error "Platform is not supported!"
#endif
@@ -29,8 +29,8 @@ namespace BlackInput
std::unique_ptr<IKeyboard> ptr(new CKeyboardWindows(parent));
#elif defined(Q_OS_LINUX)
std::unique_ptr<IKeyboard> ptr(new CKeyboardLinux(parent));
#elif defined(Q_OS_OSX)
std::unique_ptr<IKeyboard> ptr(new CKeyboardMac(parent));
#elif defined(Q_OS_MACOS)
std::unique_ptr<IKeyboard> ptr(new CKeyboardMacOS(parent));
#endif
ptr->init();
return ptr;

View File

@@ -7,18 +7,18 @@
* contained in the LICENSE file.
*/
#include "joystickmac.h"
#include "joystickmacos.h"
using namespace BlackMisc::Input;
namespace BlackInput
{
CJoystickMac::CJoystickMac(QObject *parent) :
CJoystickMacOS::CJoystickMacOS(QObject *parent) :
IJoystick(parent)
{
}
CJoystickMac::~CJoystickMac()
CJoystickMacOS::~CJoystickMacOS()
{
}

View File

@@ -7,8 +7,8 @@
* contained in the LICENSE file.
*/
#ifndef BLACKINPUT_JOYSTICKMAC_H
#define BLACKINPUT_JOYSTICKMAC_H
#ifndef BLACKINPUT_JOYSTICKMACOS_H
#define BLACKINPUT_JOYSTICKMACOS_H
//! \file
@@ -18,30 +18,30 @@
namespace BlackInput
{
//! OSX implemenation of IJoystick
//! MacOS implemenation of IJoystick
//! \todo Not implmeneted yet
class CJoystickMac : public IJoystick
class CJoystickMacOS : public IJoystick
{
Q_OBJECT
public:
//! Copy Constructor
CJoystickMac(CJoystickMac const &) = delete;
CJoystickMacOS(CJoystickMacOS const &) = delete;
//! Assignment operator
CJoystickMac &operator=(CJoystickMac const &) = delete;
CJoystickMacOS &operator=(CJoystickMacOS const &) = delete;
//! \brief Destructor
virtual ~CJoystickMac();
virtual ~CJoystickMacOS();
private:
friend class IJoystick;
//! Destructor
CJoystickMac(QObject *parent = nullptr);
CJoystickMacOS(QObject *parent = nullptr);
};
} // namespace BlackInput
#endif // BLACKINPUT_JOYSTICKMAC_H
#endif // BLACKINPUT_JOYSTICKMACOS_H

View File

@@ -9,8 +9,8 @@
//! \file
#ifndef BLACKINPUT_KEYBOARD_MAC_H
#define BLACKINPUT_KEYBOARD_MAC_H
#ifndef BLACKINPUT_KEYBOARDMACOS_H
#define BLACKINPUT_KEYBOARDMACOS_H
#include "blackinput/keyboard.h"
#include "blackmisc/input/hotkeycombination.h"
@@ -19,20 +19,20 @@
namespace BlackInput
{
//! Mac OSX implemenation of IKeyboard using hook procedure
class CKeyboardMac : public IKeyboard
//! MacOS implemenation of IKeyboard using hook procedure
class CKeyboardMacOS : public IKeyboard
{
Q_OBJECT
public:
//! Copy Constructor
CKeyboardMac(CKeyboardMac const&) = delete;
CKeyboardMacOS(CKeyboardMacOS const&) = delete;
//! Assignment operator
CKeyboardMac &operator=(CKeyboardMac const&) = delete;
CKeyboardMacOS &operator=(CKeyboardMacOS const&) = delete;
//! Destructor
virtual ~CKeyboardMac();
virtual ~CKeyboardMacOS();
//! Process key event
virtual void processKeyEvent(CGEventType type, CGEventRef event);
@@ -47,7 +47,7 @@ namespace BlackInput
friend class IKeyboard;
//! Constructor
CKeyboardMac(QObject *parent = nullptr);
CKeyboardMacOS(QObject *parent = nullptr);
BlackMisc::Input::KeyCode convertToKey(int keyCode);
static CGEventRef myCGEventCallback(CGEventTapProxy proxy,
@@ -60,4 +60,4 @@ namespace BlackInput
};
}
#endif // BLACKINPUT_KEYBOARD_MAC_H
#endif // BLACKINPUT_KEYBOARDMACOS_H

View File

@@ -7,7 +7,7 @@
* contained in the LICENSE file.
*/
#include "keyboardmac.h"
#include "keyboardmacos.h"
#include "blackmisc/logmessage.h"
#include <QHash>
@@ -63,16 +63,16 @@ namespace BlackInput
{ kVK_ANSI_Z, Key_Z },
};
CKeyboardMac::CKeyboardMac(QObject *parent) :
CKeyboardMacOS::CKeyboardMacOS(QObject *parent) :
IKeyboard(parent)
{
}
CKeyboardMac::~CKeyboardMac()
CKeyboardMacOS::~CKeyboardMacOS()
{
}
bool CKeyboardMac::init()
bool CKeyboardMacOS::init()
{
// 10.9 and later
const void *keys[] = { kAXTrustedCheckOptionPrompt };
@@ -114,7 +114,7 @@ namespace BlackInput
return true;
}
void CKeyboardMac::processKeyEvent(CGEventType type,
void CKeyboardMacOS::processKeyEvent(CGEventType type,
CGEventRef event)
{
BlackMisc::Input::CHotkeyCombination oldCombination(m_keyCombination);
@@ -191,21 +191,21 @@ namespace BlackInput
}
}
KeyCode CKeyboardMac::convertToKey(int keyCode)
KeyCode CKeyboardMacOS::convertToKey(int keyCode)
{
return keyMapping.value(keyCode, Key_Unknown);
}
CGEventRef CKeyboardMac::myCGEventCallback(CGEventTapProxy,
CGEventRef CKeyboardMacOS::myCGEventCallback(CGEventTapProxy,
CGEventType type,
CGEventRef event,
void *refcon)
{
CKeyboardMac *keyboardMac = static_cast<CKeyboardMac*>(refcon);
CKeyboardMacOS *keyboardMac = static_cast<CKeyboardMacOS*>(refcon);
if (type == kCGEventTapDisabledByTimeout)
{
BlackMisc::CLogMessage(static_cast<CKeyboardMac *>(nullptr)).warning("Event tap got disabled by timeout. Enable it again.");
BlackMisc::CLogMessage(static_cast<CKeyboardMacOS *>(nullptr)).warning("Event tap got disabled by timeout. Enable it again.");
CGEventTapEnable(keyboardMac->m_eventTap, true);
}
else

View File

@@ -59,9 +59,14 @@ namespace BlackMisc
{
if (!p.contains("linux", Qt::CaseInsensitive)) continue;
}
else if (CBuildConfig::isRunningOnMacOSXPlatform())
else if (CBuildConfig::isRunningOnMacOSPlatform())
{
if (!(p.contains("mac", Qt::CaseInsensitive) || p.contains("osx", Qt::CaseInsensitive))) continue;
if (!(p.contains("mac", Qt::CaseInsensitive) ||
p.contains("macos", Qt::CaseInsensitive) ||
p.contains("osx", Qt::CaseInsensitive)))
{
continue;
}
}
reduced << p;
}

View File

@@ -51,9 +51,9 @@ namespace BlackMisc
Q_ASSERT_X(CBuildConfig::isKnownExecutableName(executable), Q_FUNC_INFO, "Unknown exectuable");
QString s = CFileUtils::appendFilePaths(CDirectoryUtils::binDirectory(), executable);
if (CBuildConfig::isRunningOnMacOSXPlatform())
if (CBuildConfig::isRunningOnMacOSPlatform())
{
// Mac OSX bundle may or may not be a bundle
// MacOS bundle may or may not be a bundle
const QDir dir(s + QLatin1String(".app/Contents/MacOS"));
if (dir.exists())
{
@@ -82,9 +82,9 @@ namespace BlackMisc
return appDir;
}
bool CDirectoryUtils::isMacOSXAppBundle()
bool CDirectoryUtils::isMacOSAppBundle()
{
static const bool appBundle = CBuildConfig::isRunningOnMacOSXPlatform() &&
static const bool appBundle = CBuildConfig::isRunningOnMacOSPlatform() &&
qApp->applicationDirPath().contains("Contents/MacOS", Qt::CaseInsensitive);
return appBundle;
}

View File

@@ -46,9 +46,9 @@ namespace BlackMisc
//! swift application data sub directories
static QStringList applicationDataDirectoryList(bool withoutCurrent = false, bool beautify = false);
//! Is MacOSX application bundle?
//! \remark: Means the currently running executable is a MacOSX bundle, but not all our executables are bundles on MacOSX
static bool isMacOSXAppBundle();
//! Is MacOS application bundle?
//! \remark: Means the currently running executable is a MacOS bundle, but not all our executables are bundles on MacOS
static bool isMacOSAppBundle();
//! swift application data directory for one specific installation (a version)
static const QString &normalizedApplicationDataDirectory();

View File

@@ -12,7 +12,7 @@
#include <QFileInfo>
#include <type_traits>
#if defined(Q_OS_OSX)
#if defined(Q_OS_MACOS)
#include <libproc.h>
#elif defined(Q_OS_WIN)
#include <windows.h>
@@ -33,7 +33,7 @@ namespace BlackMisc
QString path = QFileInfo(QString("/proc/%1/exe").arg(pid)).symLinkTarget();
return QFileInfo(path).fileName();
}
#elif defined(Q_OS_OSX)
#elif defined(Q_OS_MACOS)
QString CProcessInfo::processNameFromId(qint64 pid)
{
char name[1024];

View File

@@ -23,7 +23,7 @@
// Change QSharedPointer<QCoreApplication> to QSharedPointer<QApplication> below
// in case you want to have Qt Gui components inside a X-Plane plugin. The current
// default was used since QApplication causes an infinite loop in X-Plane on OSX
// default was used since QApplication causes an infinite loop in X-Plane on MacOS
// platforms. X-Plane is allocating an NSApplication but never calling run(), rather
// it controls the main loop itself and pumps the event Q as needed. This causes
// unusual start conditions for QCocoaEventDispatcher and ends up in the infinite