Add build script

This commit is contained in:
Sindre Sorhus 2017-03-28 01:01:09 +07:00
parent 2122ea0a20
commit cf4b786a01
4 changed files with 40 additions and 0 deletions

1
.gitignore vendored
View file

@ -2,3 +2,4 @@ xcuserdata
project.xcworkspace project.xcworkspace
Carthage/Checkouts Carthage/Checkouts
Carthage/Build Carthage/Build
Release

22
build Executable file
View file

@ -0,0 +1,22 @@
#!/bin/bash
NAME='Touch Bar Simulator'
rm -r Release 2>/dev/null
xcodebuild archive \
-scheme "$NAME" \
-archivePath Release/App.xcarchive
xcodebuild \
-exportArchive \
-archivePath Release/App.xcarchive \
-exportOptionsPlist export-options.plist \
-exportPath Release
cd Release
rm -r App.xcarchive
# Prerequisite: npm i -g create-dmg
create-dmg "${NAME}.app"

10
export-options.plist Normal file
View file

@ -0,0 +1,10 @@
<?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>teamID</key>
<string>YG56YK5RN5</string>
<key>method</key>
<string>developer-id</string>
</dict>
</plist>

View file

@ -49,6 +49,13 @@ Apple would never allow it as it uses private APIs.
In short, it exposes the Touch Bar simulator from inside Xcode as a standalone app with added features. I [class-dumped](https://github.com/nygard/class-dump) a private Xcode framework and used that to expose a private class to get a reference to the Touch Bar window controller. I then launch that window and add a screenshot button to it. I've bundled the required private frameworks to make it work without Xcode. That's why the binary is so big. In short, it exposes the Touch Bar simulator from inside Xcode as a standalone app with added features. I [class-dumped](https://github.com/nygard/class-dump) a private Xcode framework and used that to expose a private class to get a reference to the Touch Bar window controller. I then launch that window and add a screenshot button to it. I've bundled the required private frameworks to make it work without Xcode. That's why the binary is so big.
## Build
```
./build
```
## License ## License
MIT © [Sindre Sorhus](https://sindresorhus.com) MIT © [Sindre Sorhus](https://sindresorhus.com)