Giter Site home page Giter Site logo

update_plist_build_version's Introduction

UpdatePlistBuildVersion

XCodeプロジェクトに含まれるinfo.plist中のバージョン番号をインクリメントするスクリプト。

Installation

$ gem install update_plist_build_version

Usage

入力ファイル、出力ファイルのパスは環境変数とコマンドライン引数の両方から与えられます。 出力ファイルパスを指定しなかった場合は入力ファイルを上書きします。

パスを環境変数で与える場合

パスを環境変数で与える場合は環境変数 INFO_PLIST_PATH にパスを与えた上でスクリプトをコマンドライン引数なしで実行してください。

$ export INFO_PLIST_PATH=/path/to/info.plist
$ bundle exec update_plist_build_version

パスをコマンドライン引数で与える場合

読み込みファイルと書き出しファイルが同じ場合は読み込みファイルのみ指定すれば、そのファイルを上書きします。

$ bundle exec update_plist_build_version --src_file=/path/to/info.plist

読み込みファイルと書き出しファイルが別の場合はそれぞれ個別に指定します。

$ bundle exec update_plist_build_version --src_file=/path/to/info.plist --dst_file=/path/to/new_info.plist

既存のスクリプト内にimportしてライブラリとして使用する場合

既存のスクリプト内で使用する場合は下記のようにしてください。

require "update_plist_build_version"

updater = UpdatePlistBuildVersion::Runner.new(src_file:"/path/to/info.plist")
updater.run

"/path/to/info.plist" の部分は実際のファイルの相対パスまたは絶対パスを指定してください。 インクリメント処理はrunメソッドを実行した時点で行われます。

もしも読み込みファイルと書き出しファイルが異なる場合は以下のように書き出しファイルを指定してください。 最初の例のように書き出しファイルのパスを指定しなかった場合は元のファイルを上書きします。

require "update_plist_build_version"

updater = UpdatePlistBuildVersion::Runner.new(src_file:"/path/to/info.plist", dst_file:"/path/to/info2.plist")
updater.run

環境変数で指定した上で既存のスクリプト内で使用する場合は、上記のファイルパス指定の部分を環境変数からとってくるようにします。 例として環境変数 INFO_PLIST_PATHinfo.plist へのパスを指定する場合は、

スクリプト実行前に環境変数を設定

$ export INFO_PLIST_PATH=/path/to/info.plist

そして、下記のように実装し、実行します。

require "update_plist_build_version"

updater = UpdatePlistBuildVersion::Runner.new(src_file:ENV["INFO_PLIST_PATH"])
updater.run

Fastlaneと一緒に使う

platform :ios do

  lane :adhoc do
    UpdatePlistBuildVersion::Runner.new(src_file: "../YourProject/Info.plist").run
    sigh(adhoc: true)

    gym()
    deploygate()
    crashlytics()
  end

end

update_plist_build_version's People

Contributors

hiroeorz avatar yoneapp avatar

Stargazers

 avatar

Watchers

 avatar  avatar

update_plist_build_version's Issues

LaunchScreenの行が書き換わってしまう問題

以下のplistにて、以下のコマンドを実行すると表題の問題が発生します。
gemのversionは0.0.3です。

bundle exec update_plist_build_version --src_file=Info.plist

<?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>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>
    <key>CFBundleIdentifier</key>
    <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>$(PRODUCT_NAME)</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>1.2.3</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeRole</key>
            <string>Viewer</string>
            <key>CFBundleURLName</key>
            <string>jp.techinsight.japan</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>techinsight</string>
            </array>
        </dict>
    </array>
    <key>CFBundleVersion</key>
    <string>20160305.2</string>
    <key>Fabric</key>
    <dict>
        <key>APIKey</key>
        <string>5df71d85937682841e1c85914732920813326b7c</string>
        <key>Kits</key>
        <array>
            <dict>
                <key>KitInfo</key>
                <dict/>
                <key>KitName</key>
                <string>Crashlytics</string>
            </dict>
        </array>
    </dict>
    <key>LSApplicationQueriesSchemes</key>
    <array>
        <string>line</string>
    </array>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>
    <key>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <key>UIMainStoryboardFile</key>
    <string>Main</string>
    <key>UIRequiredDeviceCapabilities</key>
    <array>
        <string>armv7</string>
    </array>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
    </array>
</dict>
</plist>

2016-03-09 15 50 50

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.