Compare commits

...

4 Commits

Author SHA1 Message Date
Roman Aliyev
c6ca3e47d3
Merge f0e1db79e0 into 8beb3b2d2d 2024-08-10 09:12:10 -04:00
Mizuo Nagayama
8beb3b2d2d
fix plural in ProjectSpec.md (#1487) 2024-08-06 05:35:27 +09:00
Yonas Kolb
adfb8c001b remove brew references from makefile 2024-07-20 21:42:30 +10:00
Roman Aliyev
f0e1db79e0 added examples of production-ready manifests for common tasks. 2023-09-24 17:22:56 +02:00
7 changed files with 334 additions and 3 deletions

View File

@ -1039,7 +1039,7 @@ The different actions share some properties:
- [ ] **askForAppToLaunch**: **Bool** - `run` and `profile` actions can define the executable set to ask to launch. This defaults to false.
- [ ] **launchAutomaticallySubstyle**: **String** - `run` action can define the launch automatically substyle ('2' for extensions).
- [ ] **storeKitConfiguration**: **String** - `run` action can specify a storekit configuration. See [Options](#options).
- [ ] **macroExpansion**: **String** - `run` and `test` action can define the macro expansion from other target. This defaults to nil.
- [ ] **macroExpansion**: **String** - `run` and `test` actions can define the macro expansion from other target. This defaults to nil.
### Execution Action

View File

@ -0,0 +1,53 @@
# (iOS) Alternate app icons
## Description
Adds alternate app icons to include in the built product.
## File structure
```diff
.
├── MyApp
│   ├── AppDelegate.swift
│   ├── Assets.xcassets
│   │   ├── AppIcon.appiconset
│   │   │   ├── AppIcon.png
| | | └── Contents.json
+│   │   ├── AppIcon2.appiconset
+│   │   │   ├── AppIcon.png
+| | | └── Contents.json
+│   │   ├── AppIcon3.appiconset
+│   │   │   ├── AppIcon.png
+| | | └── Contents.json
│   │   └── Contents.json
│   ├── LaunchScreen.storyboard
│   └── RootViewController.swift
└── project.yml
```
## project.yml
```diff
name: MyApp
targets:
MyApp:
type: application
platform: iOS
deploymentTarget: 12.0
settings:
TARGETED_DEVICE_FAMILY: 1
MARKETING_VERSION: 1.0
CURRENT_PROJECT_VERSION: 1
DEVELOPMENT_TEAM: MYTEAMID
PRODUCT_BUNDLE_IDENTIFIER: com.mycompany.myapp
GENERATE_INFOPLIST_FILE: YES
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents: YES
INFOPLIST_KEY_UILaunchStoryboardName: LaunchScreen.storyboard
INFOPLIST_KEY_UISupportedInterfaceOrientations: UIInterfaceOrientationPortrait
+ ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS: YES
+ ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES: AppIcon2 AppIcon3
sources:
- MyApp
```

View File

@ -0,0 +1,72 @@
# (iOS) Environments
## Description
Best way to setup Development, Testing and Production environments.
## File structure
```diff
.
├── MyApp
│   ├── AppDelegate.swift
│   ├── Assets.xcassets
│   │   ├── AppIcon.appiconset
│   │   │   ├── AppIcon.png
| | | └── Contents.json
│   │   └── Contents.json
│   ├── LaunchScreen.storyboard
│   └── RootViewController.swift
└── project.yml
```
## project.yml
```diff
name: MyApp
+configs:
+ Dev Debug: debug
+ Test Debug: debug
+ Prod Debug: debug
+ Dev Release: release
+ Test Release: release
+ Prod Release: release
+settings:
+ configs:
+ Dev Debug:
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS: DEBUG DEV
+ Test Debug:
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS: DEBUG TEST
+ Prod Debug:
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS: DEBUG PROD
+ Dev Release:
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS: DEV
+ Test Release:
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS: TEST
+ Prod Release:
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS: PROD
targets:
MyApp:
type: application
platform: iOS
deploymentTarget: 12.0
settings:
TARGETED_DEVICE_FAMILY: 1
MARKETING_VERSION: 1.0
CURRENT_PROJECT_VERSION: 1
DEVELOPMENT_TEAM: MYTEAMID
PRODUCT_BUNDLE_IDENTIFIER: com.mycompany.myapp
GENERATE_INFOPLIST_FILE: YES
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents: YES
INFOPLIST_KEY_UILaunchStoryboardName: LaunchScreen.storyboard
INFOPLIST_KEY_UISupportedInterfaceOrientations: UIInterfaceOrientationPortrait
sources:
- MyApp
+ scheme:
+ configVariants:
+ - Dev
+ - Test
+ - Prod
```

View File

@ -0,0 +1,90 @@
# (iOS) Playground
## Description
An alternative to XCode Playground.
Example of Source.swift:
```swift
import UIKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
var greeting = "Hello, playground"
print(greeting)
return true
}
}
```
Another example with UI:
```swift
import UIKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
let window = UIWindow()
self.window = window
let rootViewController = RootViewController(nibName: nil, bundle: nil)
window.rootViewController = rootViewController
window.makeKeyAndVisible()
return true
}
}
class RootViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
}
```
## File structure
```diff
.
├── Source.swift
└── project.yml
```
## project.yml
```diff
name: MyApp
targets:
MyApp:
type: application
platform: iOS
deploymentTarget: 12.0
settings:
TARGETED_DEVICE_FAMILY: 1
MARKETING_VERSION: 1.0
CURRENT_PROJECT_VERSION: 1
DEVELOPMENT_TEAM: MYTEAMID
PRODUCT_BUNDLE_IDENTIFIER: com.mycompany.myapp
GENERATE_INFOPLIST_FILE: YES
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents: YES
- INFOPLIST_KEY_UILaunchStoryboardName: LaunchScreen.storyboard
+ INFOPLIST_KEY_UILaunchScreen_Generation: YES
INFOPLIST_KEY_UISupportedInterfaceOrientations: UIInterfaceOrientationPortrait
sources:
- Source.swift
```

View File

@ -0,0 +1,58 @@
# (iOS) UI Testing Bundle
## Description
Adds a user interface testing bundle that uses the XCTest framework.
## File structure
```diff
.
├── MyApp
│   ├── AppDelegate.swift
│   ├── Assets.xcassets
│   │   ├── AppIcon.appiconset
│   │   │   ├── AppIcon.png
| | | └── Contents.json
│   │   └── Contents.json
│   ├── LaunchScreen.storyboard
│   └── RootViewController.swift
+├── MyAppUITests
+│   └── SomeUITests.swift
└── project.yml
```
## project.yml
```diff
name: MyApp
targets:
MyApp:
type: application
platform: iOS
deploymentTarget: 12.0
settings:
TARGETED_DEVICE_FAMILY: 1
MARKETING_VERSION: 1.0
CURRENT_PROJECT_VERSION: 1
DEVELOPMENT_TEAM: MYTEAMID
PRODUCT_BUNDLE_IDENTIFIER: com.mycompany.myapp
GENERATE_INFOPLIST_FILE: YES
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents: YES
INFOPLIST_KEY_UILaunchStoryboardName: LaunchScreen.storyboard
INFOPLIST_KEY_UISupportedInterfaceOrientations: UIInterfaceOrientationPortrait
sources:
- MyApp
+ MyAppUITests:
+ type: bundle.ui-testing
+ platform: iOS
+ settings:
+ DEVELOPMENT_TEAM: MYTEAMID
+ PRODUCT_BUNDLE_IDENTIFIER: com.company.myappuitests
+ GENERATE_INFOPLIST_FILE: YES
+ sources:
+ - MyAppUITests
+ dependencies:
+ - target: MyApp
```

View File

@ -0,0 +1,58 @@
# (iOS) Unit Testing Bundle
## Description
Adds a unit test bundle that uses the XCTest framework.
## File structure
```diff
.
├── MyApp
│   ├── AppDelegate.swift
│   ├── Assets.xcassets
│   │   ├── AppIcon.appiconset
│   │   │   ├── AppIcon.png
| | | └── Contents.json
│   │   └── Contents.json
│   ├── LaunchScreen.storyboard
│   └── RootViewController.swift
+├── MyAppTests
+│   └── SomeTests.swift
└── project.yml
```
## project.yml
```diff
name: MyApp
targets:
MyApp:
type: application
platform: iOS
deploymentTarget: 12.0
settings:
TARGETED_DEVICE_FAMILY: 1
MARKETING_VERSION: 1.0
CURRENT_PROJECT_VERSION: 1
DEVELOPMENT_TEAM: MYTEAMID
PRODUCT_BUNDLE_IDENTIFIER: com.mycompany.myapp
GENERATE_INFOPLIST_FILE: YES
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents: YES
INFOPLIST_KEY_UILaunchStoryboardName: LaunchScreen.storyboard
INFOPLIST_KEY_UISupportedInterfaceOrientations: UIInterfaceOrientationPortrait
sources:
- MyApp
+ MyAppTests:
+ type: bundle.unit-test
+ platform: iOS
+ settings:
+ DEVELOPMENT_TEAM: MYTEAMID
+ PRODUCT_BUNDLE_IDENTIFIER: com.company.myapptests
+ GENERATE_INFOPLIST_FILE: YES
+ sources:
+ - MyAppTests
+ dependencies:
+ - target: MyApp
```

View File

@ -11,7 +11,7 @@ SWIFT_BUILD_FLAGS = --disable-sandbox -c release --arch arm64 --arch x86_64
BUILD_PATH = $(shell swift build $(SWIFT_BUILD_FLAGS) --show-bin-path)
EXECUTABLE_PATH = $(BUILD_PATH)/$(EXECUTABLE_NAME)
.PHONY: install build uninstall format_code brew release
.PHONY: install build uninstall format_code release
install: build
mkdir -p $(PREFIX)/bin
@ -37,7 +37,7 @@ release:
git commit -m "Update to $(VERSION)"
#git tag $(VERSION)
publish: archive brew
publish: archive
echo "published $(VERSION)"
archive: build