Skip to content

Commit

Permalink
fix(macos): add applicationCategoryType and humanReadableCopyright (
Browse files Browse the repository at this point in the history
  • Loading branch information
tido64 committed Apr 26, 2024
1 parent 669205a commit 58e6cc1
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions .rubocop.yml
Expand Up @@ -32,6 +32,7 @@ Metrics/CyclomaticComplexity:

Metrics/PerceivedComplexity:
AllowedMethods:
- generate_info_plist!
- make_project!
- react_native_pods
- use_test_app_internal!
Expand Down
10 changes: 10 additions & 0 deletions ios/test_app.rb
Expand Up @@ -153,6 +153,16 @@ def generate_info_plist!(project_root, target_platform, destination)
info['UIAppFonts'] = fonts unless target_platform == :macos
end

if target_platform == :macos
config = manifest[target_platform.to_s]
unless config.nil?
category = config['applicationCategoryType']
info['LSApplicationCategoryType'] = category unless category.nil?
copyright = config['humanReadableCopyright']
info['NSHumanReadableCopyright'] = copyright unless copyright.nil?
end
end

plist.value = CFPropertyList.guess(info)
plist.save(infoplist_dst, CFPropertyList::List::FORMAT_XML, { :formatted => true })
end
Expand Down
10 changes: 10 additions & 0 deletions schema.json
Expand Up @@ -296,6 +296,16 @@
],
"type": "object",
"properties": {
"applicationCategoryType": {
"description": "The category that best describes the app for the App Store.",
"markdownDescription": "The category that best describes the app for the App Store.\n\nThe equivalent key in `Info.plist` is\n[`LSApplicationCategoryType`](https://developer.apple.com/documentation/bundleresources/information_property_list/lsapplicationcategorytype).",
"type": "string"
},
"humanReadableCopyright": {
"description": "A human-readable copyright notice for the bundle.",
"markdownDescription": "A human-readable copyright notice for the bundle.\n\nThe equivalent key in `Info.plist` is\n[`NSHumanReadableCopyright`](https://developer.apple.com/documentation/bundleresources/information_property_list/nshumanreadablecopyright).",
"type": "string"
},
"reactNativePath": {
"description": "Sets a custom path to React Native for macOS. Useful for when `require(\"react-native-macos\")` does not return the desired path.",
"type": "string"
Expand Down
4 changes: 4 additions & 0 deletions scripts/docs/macos.applicationCategoryType.md
@@ -0,0 +1,4 @@
The category that best describes the app for the App Store.

The equivalent key in `Info.plist` is
[`LSApplicationCategoryType`](https://developer.apple.com/documentation/bundleresources/information_property_list/lsapplicationcategorytype).
4 changes: 4 additions & 0 deletions scripts/docs/macos.humanReadableCopyright.md
@@ -0,0 +1,4 @@
A human-readable copyright notice for the bundle.

The equivalent key in `Info.plist` is
[`NSHumanReadableCopyright`](https://developer.apple.com/documentation/bundleresources/information_property_list/nshumanreadablecopyright).
2 changes: 2 additions & 0 deletions scripts/generate-schema.mjs
Expand Up @@ -32,6 +32,8 @@ export async function readDocumentation() {
"ios.icons",
"ios.icons.primaryIcon",
"ios.icons.alternateIcons",
"macos.applicationCategoryType",
"macos.humanReadableCopyright",
"windows.appxManifest",
"windows.certificateKeyFile",
"windows.certificatePassword",
Expand Down
10 changes: 10 additions & 0 deletions scripts/schema.js
Expand Up @@ -274,6 +274,16 @@ function generateSchema(docs = {}) {
allOf: [{ $ref: "#/$defs/apple" }],
type: "object",
properties: {
applicationCategoryType: {
description: extractBrief(docs["macos.applicationCategoryType"]),
markdownDescription: docs["macos.applicationCategoryType"],
type: "string",
},
humanReadableCopyright: {
description: extractBrief(docs["macos.humanReadableCopyright"]),
markdownDescription: docs["macos.humanReadableCopyright"],
type: "string",
},
reactNativePath: {
description: `Sets a custom path to React Native for macOS. Useful for when \`require("${defaultPlatformPackages.macos}")\` does not return the desired path.`,
type: "string",
Expand Down
2 changes: 2 additions & 0 deletions scripts/types.ts
Expand Up @@ -208,6 +208,8 @@ export type Docs = {
"ios.icons": string;
"ios.icons.primaryIcon": string;
"ios.icons.alternateIcons": string;
"macos.applicationCategoryType": string;
"macos.humanReadableCopyright": string;
"windows.appxManifest": string;
"windows.certificateKeyFile": string;
"windows.certificatePassword": string;
Expand Down

0 comments on commit 58e6cc1

Please sign in to comment.