## Gcc Patch
/*.gcno
.DS_Store
+builds/
-swift_version = 5.3
+project_name := Map
+derived_data_path := ~/Library/Developer/Xcode/DerivedData
+sparkle_path := $(shell find $(derived_data_path) -type d -path '*artifacts/sparkle/Sparkle' -print -quit)
+build_directory := builds
+sparkle_account := tranquil.systems
+
+distribute: archive package generate_appcast
+
+package:
+ @scripts/package.sh "$(project_name)" "$(build_directory)"
+
+generate_appcast:
+ @$(sparkle_path)/bin/generate_appcast --account $(sparkle_account) $(build_directory)
+
+archive: prepare
+ xcodebuild -project $(project_name).xcodeproj -scheme $(project_name) -configuration Release -archivePath $(build_directory)/$(project_name).xcarchive archive && xcodebuild -exportArchive -archivePath $(build_directory)/$(project_name).xcarchive -exportPath $(build_directory) -exportOptionsPlist export_options.plist
+
+prepare:
+ mkdir -p $(build_directory)
format:
swift format -i -r .
lint:
swift format lint -r .
-.PHONY: format lint docker-build docker-push
+.PHONY: package prepare archive generate_appcast package distribute format lint
B5012E8A2C98235500AC4D68 /* MapCommands.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5012E892C98235300AC4D68 /* MapCommands.swift */; };
B5012E8C2C98244000AC4D68 /* ViewStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5012E8B2C98243E00AC4D68 /* ViewStyle.swift */; };
B5012E8E2C9828D000AC4D68 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5012E8D2C9828CE00AC4D68 /* Constants.swift */; };
+ B51A45F52C982FAE00870ED5 /* Sparkle in Frameworks */ = {isa = PBXBuildFile; productRef = B51A45F42C982FAE00870ED5 /* Sparkle */; };
+ B51A45F72C982FEA00870ED5 /* UpdateCommands.swift in Sources */ = {isa = PBXBuildFile; fileRef = B51A45F62C982FE700870ED5 /* UpdateCommands.swift */; };
B54587102C961E9C0067B788 /* MapApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = B545870F2C961E9C0067B788 /* MapApp.swift */; };
B54587122C961E9C0067B788 /* MapDocument.swift in Sources */ = {isa = PBXBuildFile; fileRef = B54587112C961E9C0067B788 /* MapDocument.swift */; };
B54587142C961E9C0067B788 /* MapEditor.swift in Sources */ = {isa = PBXBuildFile; fileRef = B54587132C961E9C0067B788 /* MapEditor.swift */; };
B5012E892C98235300AC4D68 /* MapCommands.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapCommands.swift; sourceTree = "<group>"; };
B5012E8B2C98243E00AC4D68 /* ViewStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewStyle.swift; sourceTree = "<group>"; };
B5012E8D2C9828CE00AC4D68 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
+ B51A45F62C982FE700870ED5 /* UpdateCommands.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpdateCommands.swift; sourceTree = "<group>"; };
B545870C2C961E9C0067B788 /* Map.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Map.app; sourceTree = BUILT_PRODUCTS_DIR; };
B545870F2C961E9C0067B788 /* MapApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapApp.swift; sourceTree = "<group>"; };
B54587112C961E9C0067B788 /* MapDocument.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapDocument.swift; sourceTree = "<group>"; };
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ B51A45F52C982FAE00870ED5 /* Sparkle in Frameworks */,
B5012E742C9625E200AC4D68 /* Patterns in Frameworks */,
B5012E7F2C97315800AC4D68 /* ConcaveHull in Frameworks */,
);
B5012E882C98234F00AC4D68 /* Commands */ = {
isa = PBXGroup;
children = (
+ B51A45F62C982FE700870ED5 /* UpdateCommands.swift */,
B5012E892C98235300AC4D68 /* MapCommands.swift */,
);
path = Commands;
packageProductDependencies = (
B5012E732C9625E200AC4D68 /* Patterns */,
B5012E7E2C97315800AC4D68 /* ConcaveHull */,
+ B51A45F42C982FAE00870ED5 /* Sparkle */,
);
productName = Map2;
productReference = B545870C2C961E9C0067B788 /* Map.app */;
packageReferences = (
B5012E722C9625E200AC4D68 /* XCRemoteSwiftPackageReference "patterns" */,
B5012E7D2C97315800AC4D68 /* XCRemoteSwiftPackageReference "ConcaveHull" */,
+ B51A45F32C982FAE00870ED5 /* XCRemoteSwiftPackageReference "Sparkle" */,
);
productRefGroup = B545870D2C961E9C0067B788 /* Products */;
projectDirPath = "";
B54587142C961E9C0067B788 /* MapEditor.swift in Sources */,
B5012E3F2C96232A00AC4D68 /* EvolutionPicker.swift in Sources */,
B5012E572C96249400AC4D68 /* NoteParserStrategy.swift in Sources */,
+ B51A45F72C982FEA00870ED5 /* UpdateCommands.swift in Sources */,
B5012E582C96249400AC4D68 /* BlockerParserStrategy.swift in Sources */,
B5012E592C96249400AC4D68 /* VertexParserStrategy.swift in Sources */,
B5012E5A2C96249400AC4D68 /* MapParser.swift in Sources */,
kind = branch;
};
};
+ B51A45F32C982FAE00870ED5 /* XCRemoteSwiftPackageReference "Sparkle" */ = {
+ isa = XCRemoteSwiftPackageReference;
+ repositoryURL = "https://github.com/sparkle-project/Sparkle";
+ requirement = {
+ kind = upToNextMajorVersion;
+ minimumVersion = 2.6.4;
+ };
+ };
/* End XCRemoteSwiftPackageReference section */
/* Begin XCSwiftPackageProductDependency section */
package = B5012E7D2C97315800AC4D68 /* XCRemoteSwiftPackageReference "ConcaveHull" */;
productName = ConcaveHull;
};
+ B51A45F42C982FAE00870ED5 /* Sparkle */ = {
+ isa = XCSwiftPackageProductDependency;
+ package = B51A45F32C982FAE00870ED5 /* XCRemoteSwiftPackageReference "Sparkle" */;
+ productName = Sparkle;
+ };
/* End XCSwiftPackageProductDependency section */
};
rootObject = B54587042C961E9C0067B788 /* Project object */;
{
- "originHash" : "02d7b701c0ab6f32b55ad490056b5cb87cdec5003f477a828ca9a07b09a2d7b3",
+ "originHash" : "761de39b705b9793661607e3e8ffa75397e9772bccc8dc4c303ed42c76e874de",
"pins" : [
{
"identity" : "concavehull",
"revision" : "ba4ee0edf2aba19ad73fa53cb01dd0fb9b527526",
"version" : "2.0.0"
}
+ },
+ {
+ "identity" : "sparkle",
+ "kind" : "remoteSourceControl",
+ "location" : "https://github.com/sparkle-project/Sparkle",
+ "state" : {
+ "revision" : "0ef1ee0220239b3776f433314515fd849025673f",
+ "version" : "2.6.4"
+ }
}
],
"version" : 3
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
+ <key>SUEnableInstallerLauncherService</key>
+ <true/>
+ <key>SUPublicEDKey</key>
+ <string>lacD9VFVjJO55y+hEy+ReU4S0xbrnbdhncui1qLsmfI=</string>
+ <key>SUFeedURL</key>
+ <string>https://map.tranquil.systems/appcast.xml</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<string>public.plain-text</string>
</array>
<key>UTTypeDescription</key>
- <string>Wardley Map written in Map's wmap syntax</string>
+ <string>Wardley Map written in Map's wmap syntax</string>
<key>UTTypeIcons</key>
<dict/>
<key>UTTypeIdentifier</key>
<!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.app-sandbox</key>
- <true/>
- <key>com.apple.security.files.user-selected.read-write</key>
- <true/>
+ <key>com.apple.security.app-sandbox</key>
+ <true/>
+ <key>com.apple.security.files.user-selected.read-write</key>
+ <true/>
+ <key>com.apple.security.network.client</key>
+ <true/>
+ <key>com.apple.security.temporary-exception.mach-lookup.global-name</key>
+ <array>
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)-spks</string>
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)-spki</string>
+ </array>
</dict>
</plist>
import SwiftUI
+import Sparkle
@main
struct MapApp: App {
+
+ private let updaterController: SPUStandardUpdaterController = SPUStandardUpdaterController(startingUpdater: true, updaterDelegate: nil, userDriverDelegate: nil)
+
var body: some Scene {
DocumentGroup(newDocument: MapDocument()) { file in
MapEditor(document: file.$document, url: file.fileURL)
}.commands {
MapCommands()
+ UpdateCommands(updaterController: updaterController)
}
}
}
--- /dev/null
+import SwiftUI
+import Sparkle
+
+struct UpdateCommands: Commands {
+ let updaterController: SPUStandardUpdaterController
+
+ var body: some Commands {
+ CommandGroup(after: .appInfo) {
+ CheckForUpdatesView(updater: updaterController.updater)
+ }
+ }
+}
+
+
+struct CheckForUpdatesView: View {
+ @ObservedObject private var checkForUpdatesViewModel: CheckForUpdatesViewModel
+ private let updater: SPUUpdater
+
+ init(updater: SPUUpdater) {
+ self.updater = updater
+
+ // Create our view model for our CheckForUpdatesView
+ self.checkForUpdatesViewModel = CheckForUpdatesViewModel(updater: updater)
+ }
+
+ var body: some View {
+ Button("Check for Updates…", action: updater.checkForUpdates)
+ .disabled(!checkForUpdatesViewModel.canCheckForUpdates)
+ }
+}
+
+final class CheckForUpdatesViewModel: ObservableObject {
+ @Published var canCheckForUpdates = false
+
+ init(updater: SPUUpdater) {
+ updater.publisher(for: \.canCheckForUpdates)
+ .assign(to: &$canCheckForUpdates)
+ }
+}
}
private func onDragVertex(vertex: Vertex, x: CGFloat, y: CGFloat) {
- print("Dragging: \(vertex), \(x), \(y)")
}
private func saveImage() {
### Notes
-You can add notes by using `[Note] (x,y) Text`. eg.
+You can add notes `[Note] (x, y) Text` where x and y are numbers, and Text is
+any text with spaces or `\n`.
-- `[Note] (10, 20.1) This is a note, it will wrap itself`
-- `[Note] (10, 20.1) This is a note,\nwith a forced wrap`
+- `[Note] (30, 45) Here we want to call out an explanation or context.`
+- `[Note] (90, 25) We're close to the edge \n so we can multiline it.`
[swift-format]: https://github.com/apple/swift-format.git
--- /dev/null
+<?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>method</key>
+ <string>developer-id</string>
+ <key>signingStyle</key>
+ <string>automatic</string>
+</dict>
+</plist>
--- /dev/null
+#!/usr/bin/env bash
+
+set -e
+
+
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 <project_name> <build_directory>"
+ exit 1
+fi
+
+project_name="$1"
+build_directory="$2"
+
+app_path="${build_directory}/${project_name}.app"
+app_version=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" ${app_path}/Contents/Info.plist)
+tmp_dir=$(mktemp -d)
+dmg_path="${build_directory}/${project_name}-${app_version}.dmg"
+cp -R "${app_path}" "${tmp_dir}"
+ln -s /Applications "${tmp_dir}/Applications"
+hdiutil create -volname "${project_name}" -srcfolder "${tmp_dir}" -ov -format UDZO "${dmg_path}"
+rm -rf "${tmp_dir}"