Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Projucer: Added on option to select the macOS application category
  • Loading branch information
tpoole committed Apr 19, 2021
1 parent e4dba6a commit 70250dd
Show file tree
Hide file tree
Showing 10 changed files with 85 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/DemoRunner/DemoRunner.jucer
Expand Up @@ -33,7 +33,7 @@
<EXPORTFORMATS>
<XCODE_MAC targetFolder="Builds/MacOSX" smallIcon="YyqWd2" bigIcon="YyqWd2"
customXcodeResourceFolders="../Assets&#10;../Audio &#10;../BLOCKS &#10;../DSP &#10;../GUI &#10;../Utilities"
microphonePermissionNeeded="1" cameraPermissionNeeded="1">
microphonePermissionNeeded="1" cameraPermissionNeeded="1" applicationCategory="public.app-category.developer-tools">
<CONFIGURATIONS>
<CONFIGURATION isDebug="1" name="Debug" recommendedWarnings="LLVM"/>
<CONFIGURATION isDebug="0" name="Release" recommendedWarnings="LLVM"/>
Expand Down
2 changes: 1 addition & 1 deletion extras/AudioPluginHost/AudioPluginHost.jucer
Expand Up @@ -9,7 +9,7 @@
<XCODE_MAC targetFolder="Builds/MacOSX" rtasFolder="~/SDKs/PT_80_SDK" objCExtraSuffix="M73TRi"
smallIcon="c97aUr" bigIcon="c97aUr" microphonePermissionNeeded="1"
sendAppleEventsPermissionNeeded="1" sendAppleEventsPermissionText="This is required for some third-party plug-ins to function correctly."
customXcodeResourceFolders="../../examples/Assets">
customXcodeResourceFolders="../../examples/Assets" applicationCategory="public.app-category.developer-tools">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" targetName="AudioPluginHost" recommendedWarnings="LLVM"/>
<CONFIGURATION name="Release" isDebug="0" optimisation="2" targetName="AudioPluginHost"
Expand Down
2 changes: 1 addition & 1 deletion extras/BinaryBuilder/BinaryBuilder.jucer
Expand Up @@ -7,7 +7,7 @@
addUsingNamespaceToJuceHeader="1" jucerFormatVersion="1">
<EXPORTFORMATS>
<XCODE_MAC targetFolder="Builds/MacOSX" vstFolder="~/SDKs/vstsdk2.4" rtasFolder="~/SDKs/PT_80_SDK"
objCExtraSuffix="OeJtJb">
objCExtraSuffix="OeJtJb" applicationCategory="public.app-category.developer-tools">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" targetName="BinaryBuilder"/>
<CONFIGURATION name="Release" isDebug="0" optimisation="2" targetName="BinaryBuilder"/>
Expand Down
3 changes: 3 additions & 0 deletions extras/Build/juce_build_tools/utils/juce_PlistOptions.cpp
Expand Up @@ -162,6 +162,9 @@ namespace build_tools
addPlistDictionaryKey (*dict, "NSHumanReadableCopyright", companyCopyright);
addPlistDictionaryKey (*dict, "NSHighResolutionCapable", true);

if (applicationCategory.isNotEmpty())
addPlistDictionaryKey (*dict, "LSApplicationCategoryType", applicationCategory);

auto replacedDocExtensions = StringArray::fromTokens (replacePreprocessorDefs (allPreprocessorDefs,
documentExtensions), ",", {});
replacedDocExtensions.trim();
Expand Down
2 changes: 2 additions & 0 deletions extras/Build/juce_build_tools/utils/juce_PlistOptions.h
Expand Up @@ -62,6 +62,8 @@ namespace build_tools
String version;
String companyCopyright;

String applicationCategory;

StringPairArray allPreprocessorDefs;
String documentExtensions;

Expand Down
2 changes: 1 addition & 1 deletion extras/NetworkGraphicsDemo/NetworkGraphicsDemo.jucer
Expand Up @@ -17,7 +17,7 @@
<FILE id="Ww6bQw" name="juce_icon.png" compile="0" resource="1" file="Source/juce_icon.png"/>
</MAINGROUP>
<EXPORTFORMATS>
<XCODE_MAC targetFolder="Builds/MacOSX" bigIcon="Ww6bQw">
<XCODE_MAC targetFolder="Builds/MacOSX" bigIcon="Ww6bQw" applicationCategory="public.app-category.developer-tools">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" osxCompatibility="10.9 SDK" isDebug="1" targetName="JUCE Network Graphics Demo"/>
<CONFIGURATION name="Release" osxCompatibility="10.9 SDK" isDebug="0" targetName="JUCE Network Graphics Demo"/>
Expand Down
7 changes: 4 additions & 3 deletions extras/Projucer/Projucer.jucer
Expand Up @@ -9,7 +9,8 @@
<XCODE_MAC targetFolder="Builds/MacOSX" vstFolder="~/SDKs/vstsdk2.4" rtasFolder="~/SDKs/PT_80_SDK"
documentExtensions=".jucer" objCExtraSuffix="zkVtji" bigIcon="Zrx1Gl"
extraFrameworks="AudioUnit; Accelerate; AVFoundation; CoreAudio; CoreAudioKit; CoreMIDI; DiscRecording; QuartzCore; AudioToolbox; OpenGL; QTKit; QuickTime"
microphonePermissionNeeded="1" cameraPermissionNeeded="1" smallIcon="Zrx1Gl">
microphonePermissionNeeded="1" cameraPermissionNeeded="1" smallIcon="Zrx1Gl"
applicationCategory="public.app-category.developer-tools">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" isDebug="1" targetName="Projucer" cppLibType="libc++"
recommendedWarnings="LLVM"/>
Expand Down Expand Up @@ -290,8 +291,8 @@
file="Source/BinaryData/colourscheme_dark.xml"/>
<FILE id="bvFank" name="colourscheme_light.xml" compile="0" resource="1"
file="Source/BinaryData/colourscheme_light.xml"/>
<FILE id="SDFoQY" name="juce_runtime_arch_detection.cpp" compile="0" resource="1"
file="../Build/CMake/juce_runtime_arch_detection.cpp"/>
<FILE id="SDFoQY" name="juce_runtime_arch_detection.cpp" compile="0"
resource="1" file="../Build/CMake/juce_runtime_arch_detection.cpp"/>
</GROUP>
<GROUP id="{A5AE7471-B900-FD9D-8DE7-2FB68D11AE30}" name="CodeEditor">
<FILE id="w3ka6n" name="jucer_DocumentEditorComponent.cpp" compile="1"
Expand Down
71 changes: 70 additions & 1 deletion extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h
Expand Up @@ -133,6 +133,7 @@ class XcodeProjectExporter : public ProjectExporter
: ProjectExporter (p, t),
xcodeCanUseDwarf (true),
iOS (isIOS),
applicationCategoryValue (settings, Ids::applicationCategory, getUndoManager(), ""),
customPListValue (settings, Ids::customPList, getUndoManager()),
pListPrefixHeaderValue (settings, Ids::pListPrefixHeader, getUndoManager()),
pListPreprocessValue (settings, Ids::pListPreprocess, getUndoManager()),
Expand Down Expand Up @@ -209,6 +210,8 @@ class XcodeProjectExporter : public ProjectExporter
}

//==============================================================================
String getApplicationCategoryString() const { return applicationCategoryValue.get(); }

String getPListToMergeString() const { return customPListValue.get(); }
String getPListPrefixHeaderString() const { return pListPrefixHeaderValue.get(); }
bool isPListPreprocessEnabled() const { return pListPreprocessValue.get(); }
Expand Down Expand Up @@ -415,6 +418,70 @@ class XcodeProjectExporter : public ProjectExporter

if (isOSX())
{
std::vector<std::pair<String, String>> appCategories
{
{ "None", "" },
{ "Business", "business" },
{ "Developer Tools", "developer-tools" },
{ "Education", "education" },
{ "Entertainment", "entertainment" },
{ "Finace", "finance" },
{ "Games", "games" },
{ "Games - Action", "action-games" },
{ "Games - Adventure", "adventure-games" },
{ "Games - Arcade", "arcade-games" },
{ "Games - Board", "board-games" },
{ "Games - Card", "card-games" },
{ "Games - Casino", "casino-games" },
{ "Games - Dice", "dice-games" },
{ "Games - Educational", "educational-games" },
{ "Games - Family", "family-games" },
{ "Games - Kids", "kids-games" },
{ "Games - Music", "music-games" },
{ "Games - Puzzle", "puzzle-games" },
{ "Games - Racing", "racing-games" },
{ "Games - Role Playing", "role-playing-games" },
{ "Games - Simulation", "simulation-games" },
{ "Games - Sports", "sports-games" },
{ "Games - Strategy", "strategy-games" },
{ "Games - Trivia", "trivia-games" },
{ "Games - Word", "word-games" },
{ "Graphics Design", "graphics-design" },
{ "Healthcare & Fitness", "healthcare-fitness" },
{ "Lifestyle", "lifestyle" },
{ "Medial", "medical" },
{ "Music", "music" },
{ "News", "news" },
{ "Photography", "photography" },
{ "Productivity", "productivity" },
{ "Reference", "reference" },
{ "Social Networking", "social-networking" },
{ "Sports", "sports" },
{ "Travel", "travel" },
{ "Utilities", "utilities" },
{ "Video", "video" },
{ "Weather" , "weather" }
};

StringArray appCategoryKeys;
Array<var> appCategoryValues;

for (auto& opt : appCategories)
{
appCategoryKeys.add (opt.first);

if (opt.second.isNotEmpty())
appCategoryValues.add ("public.app-category." + opt.second);
else
appCategoryValues.add ("");
}

props.add (new ChoicePropertyComponent (applicationCategoryValue,
"App Category",
appCategoryKeys,
appCategoryValues),
"The application category.");

props.add (new MultiChoicePropertyComponent (validArchsValue, "Valid Architectures", getAllArchs(), getAllArchs()),
"The full set of architectures which this project may target. "
"Each configuration will build for the intersection of this property, and the per-configuration macOS Architecture property");
Expand Down Expand Up @@ -1739,6 +1806,7 @@ class XcodeProjectExporter : public ProjectExporter
options.type = type;
options.executableName = "${EXECUTABLE_NAME}";
options.bundleIdentifier = getBundleIdentifier();
options.applicationCategory = owner.getApplicationCategoryString();
options.plistToMerge = owner.getPListToMergeString();
options.iOS = owner.iOS;
options.microphonePermissionEnabled = owner.isMicrophonePermissionEnabled();
Expand Down Expand Up @@ -3488,7 +3556,8 @@ class XcodeProjectExporter : public ProjectExporter

const bool iOS;

ValueWithDefault customPListValue, pListPrefixHeaderValue, pListPreprocessValue,
ValueWithDefault applicationCategoryValue,
customPListValue, pListPrefixHeaderValue, pListPreprocessValue,
subprojectsValue,
validArchsValue,
extraFrameworksValue, frameworkSearchPathsValue, extraCustomFrameworksValue, embeddedFrameworksValue,
Expand Down
1 change: 1 addition & 0 deletions extras/Projucer/Source/Utility/Helpers/jucer_PresetIDs.h
Expand Up @@ -103,6 +103,7 @@ namespace Ids
DECLARE_ID (customLaunchStoryboard);
DECLARE_ID (customXcodeResourceFolders);
DECLARE_ID (plistPreprocessorDefinitions);
DECLARE_ID (applicationCategory);
DECLARE_ID (customPList);
DECLARE_ID (pListPrefixHeader);
DECLARE_ID (pListPreprocess);
Expand Down
2 changes: 1 addition & 1 deletion extras/UnitTestRunner/UnitTestRunner.jucer
Expand Up @@ -10,7 +10,7 @@
</GROUP>
</MAINGROUP>
<EXPORTFORMATS>
<XCODE_MAC targetFolder="Builds/MacOSX">
<XCODE_MAC targetFolder="Builds/MacOSX" applicationCategory="public.app-category.developer-tools">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" osxCompatibility="10.10 SDK" isDebug="1" targetName="UnitTestRunner"
recommendedWarnings="LLVM"/>
Expand Down

0 comments on commit 70250dd

Please sign in to comment.