This repository was archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[package_info] add support for macos to package_info plugin #2618
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
35660c8
[package_info] macos support for package_info
hpoul efec1e3
[package_info] add macos example
hpoul a6e5e43
[package_info] added macos test, fixed other tests with new build num…
hpoul 301a684
[package_info] bump version number, add changelog.
hpoul 90327f9
[package_info] remove version name for example
hpoul ae8f678
[package_info] fix typo in changelog.
hpoul 08bf9d1
revert example/ios/Runner.xcodeproj/project.pbxproj
hpoul ae5d992
Merge remote-tracking branch 'upstream/master' into package_info_macos
hpoul File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| ## 0.4.1 | ||
|
|
||
| * Add support for macOS. | ||
|
|
||
| ## 0.4.0+18 | ||
|
|
||
| * Update lower bound of dart dependency to 2.1.0. | ||
|
|
||
32 changes: 32 additions & 0 deletions
32
packages/package_info/darwin/Classes/FLTPackageInfoPlugin.m
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| // Copyright 2017 The Chromium Authors. All rights reserved. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| #import "FLTPackageInfoPlugin.h" | ||
|
|
||
| @implementation FLTPackageInfoPlugin | ||
| + (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar { | ||
| FlutterMethodChannel* channel = | ||
| [FlutterMethodChannel methodChannelWithName:@"plugins.flutter.io/package_info" | ||
| binaryMessenger:[registrar messenger]]; | ||
| FLTPackageInfoPlugin* instance = [[FLTPackageInfoPlugin alloc] init]; | ||
| [registrar addMethodCallDelegate:instance channel:channel]; | ||
| } | ||
|
|
||
| - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { | ||
| if ([call.method isEqualToString:@"getAll"]) { | ||
| result(@{ | ||
| @"appName" : [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"] | ||
| ?: [NSNull null], | ||
| @"packageName" : [[NSBundle mainBundle] bundleIdentifier] ?: [NSNull null], | ||
| @"version" : [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"] | ||
| ?: [NSNull null], | ||
| @"buildNumber" : [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"] | ||
| ?: [NSNull null], | ||
| }); | ||
| } else { | ||
| result(FlutterMethodNotImplemented); | ||
| } | ||
| } | ||
|
|
||
| @end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Flutter-related | ||
| **/Flutter/ephemeral/ | ||
| **/Pods/ | ||
|
|
||
| # Xcode-related | ||
| **/xcuserdata/ | ||
2 changes: 2 additions & 0 deletions
2
packages/package_info/example/macos/Flutter/Flutter-Debug.xcconfig
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" | ||
| #include "ephemeral/Flutter-Generated.xcconfig" |
2 changes: 2 additions & 0 deletions
2
packages/package_info/example/macos/Flutter/Flutter-Release.xcconfig
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" | ||
| #include "ephemeral/Flutter-Generated.xcconfig" |
653 changes: 653 additions & 0 deletions
653
packages/package_info/example/macos/Runner.xcodeproj/project.pbxproj
Large diffs are not rendered by default.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
.../example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| <plist version="1.0"> | ||
| <dict> | ||
| <key>IDEDidComputeMac32BitWarning</key> | ||
| <true/> | ||
| </dict> | ||
| </plist> |
97 changes: 97 additions & 0 deletions
97
packages/package_info/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <Scheme | ||
| LastUpgradeVersion = "1000" | ||
| version = "1.3"> | ||
| <BuildAction | ||
| parallelizeBuildables = "YES" | ||
| buildImplicitDependencies = "YES"> | ||
| <BuildActionEntries> | ||
| <BuildActionEntry | ||
| buildForTesting = "YES" | ||
| buildForRunning = "YES" | ||
| buildForProfiling = "YES" | ||
| buildForArchiving = "YES" | ||
| buildForAnalyzing = "YES"> | ||
| <BuildableReference | ||
| BuildableIdentifier = "primary" | ||
| BlueprintIdentifier = "33CC10EC2044A3C60003C045" | ||
| BuildableName = "Package Info Example.app" | ||
| BlueprintName = "Runner" | ||
| ReferencedContainer = "container:Runner.xcodeproj"> | ||
| </BuildableReference> | ||
| </BuildActionEntry> | ||
| </BuildActionEntries> | ||
| </BuildAction> | ||
| <TestAction | ||
| buildConfiguration = "Debug" | ||
| selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
| selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
| shouldUseLaunchSchemeArgsEnv = "YES"> | ||
| <MacroExpansion> | ||
| <BuildableReference | ||
| BuildableIdentifier = "primary" | ||
| BlueprintIdentifier = "33CC10EC2044A3C60003C045" | ||
| BuildableName = "Package Info Example.app" | ||
| BlueprintName = "Runner" | ||
| ReferencedContainer = "container:Runner.xcodeproj"> | ||
| </BuildableReference> | ||
| </MacroExpansion> | ||
| <Testables> | ||
| <TestableReference | ||
| skipped = "NO"> | ||
| <BuildableReference | ||
| BuildableIdentifier = "primary" | ||
| BlueprintIdentifier = "00380F9121DF178D00097171" | ||
| BuildableName = "RunnerUITests.xctest" | ||
| BlueprintName = "RunnerUITests" | ||
| ReferencedContainer = "container:Runner.xcodeproj"> | ||
| </BuildableReference> | ||
| </TestableReference> | ||
| </Testables> | ||
| </TestAction> | ||
| <LaunchAction | ||
| buildConfiguration = "Debug" | ||
| selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
| selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
| launchStyle = "0" | ||
| useCustomWorkingDirectory = "NO" | ||
| ignoresPersistentStateOnLaunch = "NO" | ||
| debugDocumentVersioning = "YES" | ||
| debugServiceExtension = "internal" | ||
| allowLocationSimulation = "YES"> | ||
| <BuildableProductRunnable | ||
| runnableDebuggingMode = "0"> | ||
| <BuildableReference | ||
| BuildableIdentifier = "primary" | ||
| BlueprintIdentifier = "33CC10EC2044A3C60003C045" | ||
| BuildableName = "Package Info Example.app" | ||
| BlueprintName = "Runner" | ||
| ReferencedContainer = "container:Runner.xcodeproj"> | ||
| </BuildableReference> | ||
| </BuildableProductRunnable> | ||
| </LaunchAction> | ||
| <ProfileAction | ||
| buildConfiguration = "Release" | ||
| shouldUseLaunchSchemeArgsEnv = "YES" | ||
| savedToolIdentifier = "" | ||
| useCustomWorkingDirectory = "NO" | ||
| debugDocumentVersioning = "YES"> | ||
| <BuildableProductRunnable | ||
| runnableDebuggingMode = "0"> | ||
| <BuildableReference | ||
| BuildableIdentifier = "primary" | ||
| BlueprintIdentifier = "33CC10EC2044A3C60003C045" | ||
| BuildableName = "Package Info Example.app" | ||
| BlueprintName = "Runner" | ||
| ReferencedContainer = "container:Runner.xcodeproj"> | ||
| </BuildableReference> | ||
| </BuildableProductRunnable> | ||
| </ProfileAction> | ||
| <AnalyzeAction | ||
| buildConfiguration = "Debug"> | ||
| </AnalyzeAction> | ||
| <ArchiveAction | ||
| buildConfiguration = "Release" | ||
| revealArchiveInOrganizer = "YES"> | ||
| </ArchiveAction> | ||
| </Scheme> |
10 changes: 10 additions & 0 deletions
10
packages/package_info/example/macos/Runner.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
packages/package_info/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| <plist version="1.0"> | ||
| <dict> | ||
| <key>IDEDidComputeMac32BitWarning</key> | ||
| <true/> | ||
| </dict> | ||
| </plist> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import Cocoa | ||
cyanglaz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| import FlutterMacOS | ||
|
|
||
| @NSApplicationMain | ||
| class AppDelegate: FlutterAppDelegate { | ||
| override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { | ||
| return true | ||
| } | ||
| } | ||
68 changes: 68 additions & 0 deletions
68
packages/package_info/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| { | ||
| "images" : [ | ||
| { | ||
| "size" : "16x16", | ||
| "idiom" : "mac", | ||
| "filename" : "app_icon_16.png", | ||
| "scale" : "1x" | ||
| }, | ||
| { | ||
| "size" : "16x16", | ||
| "idiom" : "mac", | ||
| "filename" : "app_icon_32.png", | ||
| "scale" : "2x" | ||
| }, | ||
| { | ||
| "size" : "32x32", | ||
| "idiom" : "mac", | ||
| "filename" : "app_icon_32.png", | ||
| "scale" : "1x" | ||
| }, | ||
| { | ||
| "size" : "32x32", | ||
| "idiom" : "mac", | ||
| "filename" : "app_icon_64.png", | ||
| "scale" : "2x" | ||
| }, | ||
| { | ||
| "size" : "128x128", | ||
| "idiom" : "mac", | ||
| "filename" : "app_icon_128.png", | ||
| "scale" : "1x" | ||
| }, | ||
| { | ||
| "size" : "128x128", | ||
| "idiom" : "mac", | ||
| "filename" : "app_icon_256.png", | ||
| "scale" : "2x" | ||
| }, | ||
| { | ||
| "size" : "256x256", | ||
| "idiom" : "mac", | ||
| "filename" : "app_icon_256.png", | ||
| "scale" : "1x" | ||
| }, | ||
| { | ||
| "size" : "256x256", | ||
| "idiom" : "mac", | ||
| "filename" : "app_icon_512.png", | ||
| "scale" : "2x" | ||
| }, | ||
| { | ||
| "size" : "512x512", | ||
| "idiom" : "mac", | ||
| "filename" : "app_icon_512.png", | ||
| "scale" : "1x" | ||
| }, | ||
| { | ||
| "size" : "512x512", | ||
| "idiom" : "mac", | ||
| "filename" : "app_icon_1024.png", | ||
| "scale" : "2x" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "version" : 1, | ||
| "author" : "xcode" | ||
| } | ||
| } |
Binary file added
BIN
+45.9 KB
..._info/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.2 KB
...e_info/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.4 KB
...ge_info/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.79 KB
...e_info/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.21 KB
...ge_info/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.5 KB
...e_info/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.83 KB
...ge_info/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.