Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
JARMourato committed Feb 13, 2016
0 parents commit ca0bf31
Show file tree
Hide file tree
Showing 8 changed files with 177 additions and 0 deletions.
19 changes: 19 additions & 0 deletions EasyAbout.podspec
@@ -0,0 +1,19 @@

Pod::Spec.new do |s|

s.name = "EasyAbout"
s.version = "1.0.0"
s.summary = "A way to easily add Cocoapod licenses and App Version to your iOS App using the Settings Bundle"
s.homepage = "https://github.com/JARMourato/EasyAbout"
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { "João Mourato" => "joao.armourato@gmail.com" }
s.platform = :ios
s.source = { :git => "https://github.com/JARMourato/EasyAbout.git", :tag => s.version.to_s }
s.preserve_paths = 'README.md', 'settings-script.sh'
s.source_files = 'Placeholder.h'
s.requires_arc = true
s.resource_bundle = { 'Settings' => ['*.plist', '../Pods-acknowledgements.plist'] }
s.prepare_command = 'chmod u+x $(pwd)/settings-script.sh'

end

19 changes: 19 additions & 0 deletions LICENSE
@@ -0,0 +1,19 @@
Copyright (c) 2016 JARMourato <joao.armourato@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
5 changes: 5 additions & 0 deletions Placeholder.h
@@ -0,0 +1,5 @@
//
// Placeholder.h
//
// Dummy file to pass CocoaPods validation.
//
1 change: 1 addition & 0 deletions Pods-acknowledgements.plist
27 changes: 27 additions & 0 deletions README.md
@@ -0,0 +1,27 @@
EasyAbout
======================

## Install

Add to podfile :

```ruby
platform :ios

pod 'EasyAbout'

```

Add a new run script:

```ruby
"${SRCROOT}/Pods/EasyAbout/settings-script.sh"
```



## License

**EasyAbout** is available under the MIT license. See the [LICENSE](https://github.com/JARMourato/AcknowledgementsBundle/blob/master/LICENSE) file for more info.


33 changes: 33 additions & 0 deletions Root.plist
@@ -0,0 +1,33 @@
<?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>StringsTable</key>
<string>Root</string>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>Type</key>
<string>PSGroupSpecifier</string>
<key>Title</key>
<string>About</string>
</dict>
<dict>
<key>Type</key>
<string>PSChildPaneSpecifier</string>
<key>Title</key>
<string>Version</string>
<key>File</key>
<string>Version</string>
</dict>
<dict>
<key>Type</key>
<string>PSChildPaneSpecifier</string>
<key>Title</key>
<string>Licenses</string>
<key>File</key>
<string>Pods-acknowledgements</string>
</dict>
</array>
</dict>
</plist>
49 changes: 49 additions & 0 deletions Version.plist
@@ -0,0 +1,49 @@
<?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>Title</key>
<string>Version</string>
<key>StringsTable</key>
<string>Version</string>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>Type</key>
<string>PSGroupSpecifier</string>
<key>Title</key>
<string>Info</string>
</dict>
<dict>
<key>Type</key>
<string>PSTitleValueSpecifier</string>
<key>Title</key>
<string>Version</string>
<key>Key</key>
<string>CFBundleShortVersionString</string>
<key>DefaultValue</key>
<string>-</string>
</dict>
<dict>
<key>Type</key>
<string>PSTitleValueSpecifier</string>
<key>Title</key>
<string>Build</string>
<key>Key</key>
<string>CFBundleVersion</string>
<key>DefaultValue</key>
<string>-</string>
</dict>
<dict>
<key>Type</key>
<string>PSTitleValueSpecifier</string>
<key>Title</key>
<string>Hash</string>
<key>Key</key>
<string>CFBundleHash</string>
<key>DefaultValue</key>
<string>-</string>
</dict>
</array>
</dict>
</plist>
24 changes: 24 additions & 0 deletions settings-script.sh
@@ -0,0 +1,24 @@
#!/bin/sh

INFOPLISTPATH="${TARGET_BUILD_DIR}/${EXECUTABLE_NAME}.app/Info.plist"
VERSION_LIST_PATH="${TARGET_BUILD_DIR}/${EXECUTABLE_NAME}.app/Settings.bundle/Version.plist"

# Location of PlistBuddy
PLISTBUDDY="/usr/libexec/PlistBuddy"

BUILD_VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" $INFOPLISTPATH)
BUILD_NUMBER=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" $INFOPLISTPATH)
# Get the current git commmit hash (first 7 characters of the SHA)
GITREVSHA=$(git --git-dir="${PROJECT_DIR}/.git" --work-tree="${PROJECT_DIR}" rev-parse --short HEAD)

echo "INFOPLISTPATH = ${INFOPLISTPATH}"
echo "VERSION_LIST_PATH = ${VERSION_LIST_PATH}"
echo "BUILD_VERSION = ${BUILD_VERSION}"
echo "BUILD_NUMBER = ${BUILD_NUMBER}"
echo "GIT SHA = ${GITREVSHA}"


# Set the Git hash in the info plist for reference
$PLISTBUDDY -c "Set :PreferenceSpecifiers:1:DefaultValue $BUILD_VERSION" "${VERSION_LIST_PATH}"
$PLISTBUDDY -c "Set :PreferenceSpecifiers:2:DefaultValue $BUILD_NUMBER" "${VERSION_LIST_PATH}"
$PLISTBUDDY -c "Set :PreferenceSpecifiers:3:DefaultValue $GITREVSHA" "${VERSION_LIST_PATH}"

0 comments on commit ca0bf31

Please sign in to comment.