Skip to content

Instantly share code, notes, and snippets.

@masaibar
Created May 8, 2016 10:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masaibar/2e05653a30234dfb4f5544c280e9d871 to your computer and use it in GitHub Desktop.
Save masaibar/2e05653a30234dfb4f5544c280e9d871 to your computer and use it in GitHub Desktop.
AndroidManifest.xmlにAPIキーを書いたコードをGitHubにコミットしないために ref: http://qiita.com/masaibar/items/38735c99da6f1d439f0a
<activity
android:name=".MainActivity"
android:label="${label}"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
buildTypes {
debug {
minifyEnabled false
signingConfig signingConfigs.debug
//manifestPlaceholders = [label: "testlabel"] #ベタ書きの例、これでも動くが...
manifestPlaceholders = [label: System.getenv("LABEL")]
}
}
#LABELという環境変数に"testlabel"を設定する
$ launchctl setenv LABEL testlabel
#設定されていることを確認する
$ launchctl getenv LABEL
testlabel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment