diff options
author | Jake Petroules <jake.petroules@qt.io> | 2017-01-12 14:51:46 -0800 |
---|---|---|
committer | Jake Petroules <jake.petroules@qt.io> | 2017-01-18 05:15:05 +0000 |
commit | b9887f3d9a8eff2b23b5f7c561054f215c5cc185 (patch) | |
tree | f2622de3b73ea231b9e6c470d09dc1a61eed5b3a /qmake/generators/mac/pbuilder_pbx.cpp | |
parent | ae072cd9c4a575e0ed3f073c6ab395ccdf7c2b37 (diff) |
Remove dead code in Xcode generator
These code paths have not needed to be exercised since Xcode < 3.2 was
dropped from support, which is beyond ancient at this point.
Incidentally, this removes use of a deprecated function.
Change-Id: I3e5a45794c21b434b31a48da8a8b0ff22f2852fa
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'qmake/generators/mac/pbuilder_pbx.cpp')
-rw-r--r-- | qmake/generators/mac/pbuilder_pbx.cpp | 115 |
1 files changed, 5 insertions, 110 deletions
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index feedec298a..f42b3021f1 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -1886,108 +1886,12 @@ ProjectBuilderMakefileGenerator::openOutput(QFile &file, const QString &build) c return UnixMakefileGenerator::openOutput(file, build); } -/* This function is such a hack it is almost pointless, but it - eliminates the warning message from ProjectBuilder that the project - file is for an older version. I guess this could be used someday if - the format of the output is dependant upon the version of - ProjectBuilder as well. -*/ int ProjectBuilderMakefileGenerator::pbuilderVersion() const { - QString ret; - if(!project->isEmpty("QMAKE_PBUILDER_VERSION")) { - ret = project->first("QMAKE_PBUILDER_VERSION").toQString(); - } else { - QString version, version_plist = project->first("QMAKE_PBUILDER_VERSION_PLIST").toQString(); - if(version_plist.isEmpty()) { -#ifdef Q_OS_DARWIN - ret = QLatin1String("34"); - QCFType<CFURLRef> cfurl; - // Check for XCode 4 first - OSStatus err = LSFindApplicationForInfo(0, CFSTR("com.apple.dt.Xcode"), 0, 0, &cfurl); - // Now check for XCode 3 - if (err == kLSApplicationNotFoundErr) - err = LSFindApplicationForInfo(0, CFSTR("com.apple.Xcode"), 0, 0, &cfurl); - if (err == noErr) { - QCFType<CFBundleRef> bundle = CFBundleCreate(0, cfurl); - if (bundle) { - CFStringRef str = CFStringRef(CFBundleGetValueForInfoDictionaryKey(bundle, - CFSTR("CFBundleShortVersionString"))); - if (str) { - QStringList versions = QString::fromCFString(str).split(QLatin1Char('.')); - int versionMajor = versions.at(0).toInt(); - int versionMinor = versions.at(1).toInt(); - if (versionMajor >= 3) { - ret = QLatin1String("46"); - } else if (versionMajor >= 2) { - ret = QLatin1String("42"); - } else if (versionMajor == 1 && versionMinor >= 5) { - ret = QLatin1String("39"); - } - } - } - } -#else - if(exists("/Developer/Applications/Xcode.app/Contents/version.plist")) - version_plist = "/Developer/Applications/Xcode.app/Contents/version.plist"; - else - version_plist = "/Developer/Applications/Project Builder.app/Contents/version.plist"; -#endif - } - if (ret.isEmpty()) { - QFile version_file(version_plist); - if (version_file.open(QIODevice::ReadOnly)) { - debug_msg(1, "pbuilder: version.plist: Reading file: %s", version_plist.toLatin1().constData()); - QTextStream plist(&version_file); - - bool in_dict = false; - QString current_key; - QRegExp keyreg("^<key>(.*)</key>$"), stringreg("^<string>(.*)</string>$"); - while(!plist.atEnd()) { - QString line = plist.readLine().trimmed(); - if(line == "<dict>") - in_dict = true; - else if(line == "</dict>") - in_dict = false; - else if(in_dict) { - if(keyreg.exactMatch(line)) - current_key = keyreg.cap(1); - else if(current_key == "CFBundleShortVersionString" && stringreg.exactMatch(line)) - version = stringreg.cap(1); - } - } - plist.flush(); - version_file.close(); - } else { - debug_msg(1, "pbuilder: version.plist: Failure to open %s", version_plist.toLatin1().constData()); - } - if(version.isEmpty() && version_plist.contains("Xcode")) { - ret = "39"; - } else { - int versionMajor = version.left(1).toInt(); - if(versionMajor >= 2) - ret = "42"; - else if(version == "1.5") - ret = "39"; - else if(version == "1.1") - ret = "34"; - } - } - } - - if(!ret.isEmpty()) { - bool ok; - int int_ret = ret.toInt(&ok); - if(ok) { - debug_msg(1, "pbuilder: version.plist: Got version: %d", int_ret); - if (int_ret < 46) - warn_msg(WarnLogic, "XCode version is too old, at least XCode 3.2 is required"); - return int_ret; - } - } - debug_msg(1, "pbuilder: version.plist: Fallback to default version"); - return 46; //my fallback + if (!project->isEmpty("QMAKE_PBUILDER_VERSION")) + return project->first("QMAKE_PBUILDER_VERSION").toQString().toInt(); + return 46; // Xcode 3.2-compatible; default format since that version } int @@ -2002,22 +1906,13 @@ ProjectBuilderMakefileGenerator::reftypeForFile(const QString &where) QString ProjectBuilderMakefileGenerator::projectSuffix() const { - const int pbVersion = pbuilderVersion(); - if(pbVersion >= 42) - return ".xcodeproj"; - else if(pbVersion >= 38) - return ".xcode"; - return ".pbproj"; + return ".xcodeproj"; } QString ProjectBuilderMakefileGenerator::pbxbuild() { - if(exists("/usr/bin/pbbuild")) - return "pbbuild"; - if(exists("/usr/bin/xcodebuild")) - return "xcodebuild"; - return (pbuilderVersion() >= 38 ? "xcodebuild" : "pbxbuild"); + return "xcodebuild"; } static QString quotedStringLiteral(const QString &value) |