Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# CI for FrameGen: builds the macOS app and runs its unit tests with Xcode 27
# on every push to main, every pull request targeting main, and on demand.
#
# Note: GitHub-hosted macOS runners may lag behind Xcode 27. If the
# "Select Xcode 27" step fails because no Xcode 27 is installed, switch
# `runs-on` to `[self-hosted, macOS, ARM64]`.

name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
build-and-test:
name: Build and test
runs-on: macos-latest
timeout-minutes: 30
permissions:
contents: read

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Select Xcode 27
shell: bash
run: |
set -euo pipefail
xcode_app="$(ls -d /Applications/Xcode_27*.app 2>/dev/null | sort -V | tail -n 1 || true)"
if [[ -z "$xcode_app" ]]; then
echo "::error::Xcode 27 is not installed on this runner. GitHub-hosted runners don't have Xcode 27 yet; use a self-hosted runner with labels: self-hosted, macOS, ARM64."
exit 1
fi
echo "Selecting $xcode_app"
sudo xcode-select -s "$xcode_app"
xcodebuild -version

- name: Build and test
shell: bash
run: |
set -o pipefail
if command -v xcbeautify >/dev/null 2>&1; then
xcodebuild test \
-project FrameGen.xcodeproj \
-scheme FrameGen \
-destination 'platform=macOS,arch=arm64' \
-resultBundlePath TestResults.xcresult \
CODE_SIGNING_ALLOWED=NO \
| xcbeautify --renderer github-actions
else
xcodebuild test \
-project FrameGen.xcodeproj \
-scheme FrameGen \
-destination 'platform=macOS,arch=arm64' \
-resultBundlePath TestResults.xcresult \
CODE_SIGNING_ALLOWED=NO
fi

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: TestResults
path: TestResults.xcresult
retention-days: 7
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# macOS
.DS_Store

# Xcode user state
xcuserdata/
*.xcuserstate
*.xcscmblueprint

# Build products
build/
DerivedData/
*.xcarchive
762 changes: 349 additions & 413 deletions FrameGen.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Binary file not shown.
15 changes: 14 additions & 1 deletion FrameGen.xcodeproj/xcshareddata/xcschemes/FrameGen.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "2710"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -28,6 +28,19 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
<Testables>
<TestableReference
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3D43AFCF71BAC5808E8553C9"
BuildableName = "FrameGenTests.xctest"
BlueprintName = "FrameGenTests"
ReferencedContainer = "container:FrameGen.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand Down

This file was deleted.

This file was deleted.

53 changes: 43 additions & 10 deletions FrameGen/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,22 +1,55 @@
//
// AppDelegate.swift
// generateFramework
// FrameGen
//
// Created by Рамиз Кичибеков on 08.04.2023.
// Copyright © 2023 Ramiz Kichibekov. All rights reserved.
//

import Cocoa
import AppKit

final class AppDelegate: NSObject, NSApplicationDelegate {

private var windowController: NSWindowController!

func applicationDidFinishLaunching(_ aNotification: Notification) {
windowController = MainWindowController()
windowController.showWindow(self)

// MARK: - Properties

private let workspace = Workspace()
private lazy var mainWindowController = MainWindowController(workspace: workspace)
private lazy var settingsWindowController = SettingsWindowController()

// MARK: - NSApplicationDelegate

func applicationWillFinishLaunching(_ notification: Notification) {
Preferences.registerDefaults()
}

func applicationDidFinishLaunching(_ notification: Notification) {
mainWindowController.showWindow(self)
}

func application(_ application: NSApplication, open urls: [URL]) {
guard let url = urls.first else { return }

mainWindowController.showWindow(self)
mainWindowController.openProject(at: url)
}


func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
true
}

func applicationShouldTerminate(_ sender: NSApplication) -> NSApplication.TerminateReply {
mainWindowController.confirmStoppingBuild(action: "Quit") ? .terminateNow : .terminateCancel
}

func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
return true
true
}

// MARK: - Actions

@objc
func showSettings(_ sender: Any?) {
settingsWindowController.showWindow(sender)
}

}
8 changes: 0 additions & 8 deletions FrameGen/Application/FrameGen.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.automation.apple-events</key>
<true/>
<key>com.apple.security.files.user-selected.executable</key>
<true/>
<key>com.apple.security.app-sandbox</key>
<false/>
<key>com.apple.security.files.downloads.read-write</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
</dict>
</plist>
30 changes: 21 additions & 9 deletions FrameGen/Application/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,27 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
<key>UISupportsDocumentBrowser</key>
<true/>
<key>NSDownloadsFolderUsageDescription</key>
<string>Access to the downloads is necessary to search for folders containing Xcode project files for generating frameworks.</string>
<key>NSDocumentsFolderUsageDescription</key>
<string>Access to the documents is necessary to search for folders containing Xcode project files for generating frameworks.</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>Xcode Project</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSHandlerRank</key>
<string>None</string>
<key>LSItemContentTypes</key>
<array>
<string>com.apple.xcode.project</string>
<string>public.folder</string>
</array>
</dict>
</array>
<key>NSDesktopFolderUsageDescription</key>
<string>Access to the desktop is necessary to search for folders containing Xcode project files for generating frameworks.</string>
<string>FrameGen reads Xcode projects and saves built XCFrameworks in the folders you choose.</string>
<key>NSDocumentsFolderUsageDescription</key>
<string>FrameGen reads Xcode projects and saves built XCFrameworks in the folders you choose.</string>
<key>NSDownloadsFolderUsageDescription</key>
<string>FrameGen reads Xcode projects and saves built XCFrameworks in the folders you choose.</string>
</dict>
</plist>
Loading
Loading