dt

dev.tiapp

hook ti cli config from tiapp.xml

Showing:

Popularity

Downloads/wk

0

GitHub Stars

21

Maintenance

Last Commit

7yrs ago

Contributors

3

Package

Dependencies

2

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

dev.tiapp

A titanium cli plugin to set a dfferent value of tiapp.xml base on deploy type or cli option. dev.tiapp is inspired by dbankier/ticonfig. Thanks @dbankier!

Installation

$ [sudo] npm install -g dev.tiapp --unsafe-perm

--unsafe-perm flag is required for hook installation.

Usage

Change tag value

<id>com.licky.www</id>
<dev.id>dev.co.licky.www</dev.id>

When development deploy(e.g. simulator), Your app id will be replace by value of dev.id.

<property name="server_url">http://www.myserver</property>
<property name="dev.server_url">http://192.168.0.10:8080</property>

<property name="ti.facebook.appid">12345xxxxxxxxx</property>
<property name="dev.ti.facebook.appid">xxxxxxx56789</property>

When development deploy(e.g. simulator), Ti.App.Properties.getString('server_url') will return http://http://192.168.0.10:8080.

Local IP Placseholder

__LOCAL_IP__ in value will be replaced by your local ip address. local ip address detected by ipselector.

<property name="dev.server_url">http://__LOCAL_IP__:8080</property>

If you want to set ip of specific network interface, make a config file in your home path. ~/.dev.tiapp.json

{
    "networkInterface": "en0"
}

Custom Prefix

Custom prefix is not associated with dev/test/prod.
Use '--dev.tiapp' option with Titanium CLI. You can use prefix whatever you want instead of 'dev'.

ti build -p ios --tall --retina --dev.tiapp __dev__

in tiapp.xml

<id>test.tiapp</id>
<__dev__.id>__dev__.test.tiapp</__dev__.id>

<property name="server_url">http://www.myserver</property>
<property name="__dev__.server_url">http://this.is.custom.prefix</property>

Known Issue

  • #2. : If cli.failOnWrongSDK is true and SDK version of project doesn't match Titanium CLI defautl version, Titanium CLI change a command. This make unofficial options to be deleted. Set cli.failOnWrongSDK is true. If you want to build anoter version, user --sdk option.

    `ti build -p ios --sdk 3.4.0.GA`
    

Why did I make this?

Somebody said that why should I use this instead of Conditional Code such as ENV_DEV condition of Alloy. Because some properties have to be set before build. (e.g. facebook app id on iOS)

Change Log

v0.0.3

  • Custom Prefix

Note

  • You will need to understand what can be changed at the build.pre.contruct phase.
  • Don't forget close tag with dev. prefix. :)
  • If you have a problem or idea, please make a issue.

Licence MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial