Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(macos): add applicationCategoryType and humanReadableCopyright #1992

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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