Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
Add sparkle (fixes #19), plist bump, fix for amimono embedding framew…
Browse files Browse the repository at this point in the history
…orks in the main app
  • Loading branch information
jariz committed Dec 12, 2018
1 parent 49450d3 commit d4e86b2
Show file tree
Hide file tree
Showing 15 changed files with 117 additions and 60 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,4 @@ fastlane/test_output

node_modules/
.env
*.gem
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
osx_image: xcode10.1
language: objective-c
before_install: gem install cocoapods-amimono && pod install --project-directory=Akku/
script: xcodebuild clean build -verbose -workspace Akku/Akku.xcworkspace -scheme Akku CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | xcpretty
script: cd Akku && ./build.sh
6 changes: 5 additions & 1 deletion Akku/.release-it.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"buildCommand": "./build.sh",
"increment": "conventional:angular",
"buildCommand": "./build.sh > /dev/null",
"scripts": {
"afterBump": "/usr/libexec/PlistBuddy Akku/Info.plist -c \"Set :CFBundleShortVersionString string \\\"${version}\\\"\""
},
"src": {
"commit": "false",
"tag": true,
Expand Down
111 changes: 69 additions & 42 deletions Akku/Akku.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Akku/Akku/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ import ServiceManagement
import IOBluetooth
import Sentry
import SwiftyBeaver
import Sparkle
let log = SwiftyBeaver.self

@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate, AppProtocol {

// MARK: -
// MARK: Variables

private var currentHelperConnection: NSXPCConnection?
private var timeoutCheck: Timer?

Expand Down
4 changes: 2 additions & 2 deletions Akku/Akku/Base.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14313.18"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14460.31"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
Expand Down
4 changes: 3 additions & 1 deletion Akku/Akku/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>string 0.1-test</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSApplicationCategoryType</key>
Expand All @@ -37,5 +37,7 @@
<key>io.jari.AkkuHelper</key>
<string>anchor apple generic and identifier "io.jari.AkkuHelper" and (certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = JHKDY4UQ72)</string>
</dict>
<key>SUFeedURL</key>
<string>https://jariz-appcast.herokuapp.com/akku/appcast.xml</string>
</dict>
</plist>
16 changes: 12 additions & 4 deletions Akku/Akku/StatusMenuController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ import Foundation
import Cocoa
import IOBluetooth
import EMCLoginItem
import Sparkle

class StatusMenuController: NSObject {

// MARK: Private vars

private var updater = SUUpdater()
private var popover: NSPopover?;
private var menu: NSMenu?;
private var batteryInfo: [String: BatteryInfo] = [:]
Expand Down Expand Up @@ -268,11 +270,17 @@ class StatusMenuController: NSObject {

menu.addItem(NSMenuItem.separator());

// Check for updates item
let updateItem = NSMenuItem(title: "Check for updates", action: #selector(SUUpdater.checkForUpdates(_:)), keyEquivalent: "u")
updateItem.target = updater
updateItem.keyEquivalentModifierMask = .shift
menu.addItem(updateItem)

// Quit item
let item = NSMenuItem(title: "Quit", action: #selector(quit(sender:)), keyEquivalent: "q")
item.target = self
item.keyEquivalentModifierMask = .command
menu.addItem(item)
let quitItem = NSMenuItem(title: "Quit", action: #selector(quit(sender:)), keyEquivalent: "q")
quitItem.target = self
quitItem.keyEquivalentModifierMask = .command
menu.addItem(quitItem)
}

// MARK: -
Expand Down
2 changes: 1 addition & 1 deletion Akku/AkkuHelper/Helper-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<key>CFBundleName</key>
<string>AkkuHelper</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>0.1</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>SMAuthorizedClients</key>
Expand Down
3 changes: 3 additions & 0 deletions Akku/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
source 'https://github.com/CocoaPods/Specs.git'
plugin 'cocoapods-amimono'

amimono_ignore 'Pods-Akku'

target 'Akku' do

# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!

Expand Down
10 changes: 5 additions & 5 deletions Akku/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ PODS:
- Sentry (4.1.0):
- Sentry/Core (= 4.1.0)
- Sentry/Core (4.1.0)
- Sparkle (1.18.1)
- SwiftyBeaver (1.5.1)
- Sparkle (1.21.0)
- SwiftyBeaver (1.6.1)

DEPENDENCIES:
- EMCLoginItem
Expand All @@ -31,9 +31,9 @@ CHECKOUT OPTIONS:
SPEC CHECKSUMS:
EMCLoginItem: ac4a198cda3f4a8dc72797d2e89ad6c640624835
Sentry: 44b85e768f435ede4d12ea279af588ff275c3939
Sparkle: 06ea33170007c5937ee54da481b4481af98fac79
SwiftyBeaver: 4f74563624b2c1e821c522c54142b5dd5ebb0f30
Sparkle: 24f10673813bf7c32d73ffa8a775590adefc40df
SwiftyBeaver: ccfcdf85a04d429f1633f668650b0ce8020bda3a

PODFILE CHECKSUM: d7ed81b3176e3e7fa34befbafcedcf7ab3ee8a47
PODFILE CHECKSUM: 9c643e82085a5ae3711e6a71ff29b85baf043107

COCOAPODS: 1.5.3
5 changes: 5 additions & 0 deletions Akku/build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
echo "🔋 building a Akku release DMG... 🔋";
echo "(going to assume node.js is installed)"

./install_amimono_fork.sh

rm -R build/

pod install
npm install

xcodebuild -workspace Akku.xcworkspace -scheme Akku -configuration Release -derivedDataPath build | xcpretty
npx appdmg dmg-resources/release.json build/Akku.dmg
1 change: 1 addition & 0 deletions Akku/cocoapods-amimono
Submodule cocoapods-amimono added at 8e3225
7 changes: 7 additions & 0 deletions Akku/install_amimono_fork.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Akku runs a custom fork of cocoapods-amimono.
# The real plugin assumes you want all targets to have it's frameworks embedded, we don't want this for the main app, only the helper (which needs to be fully standalone)

cd cocoapods-amimono
gem build cocoapods-amimono.gemspec
gem install cocoapods-amimono-0.0.10.gem
cd ..
2 changes: 1 addition & 1 deletion Akku/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d4e86b2

Please sign in to comment.