Coder Social home page Coder Social logo

ti.multiconfiguration's Introduction

Titanium multiconfiguration plugin

This plugin helps configuring different profiles for Appcelerator Titanium projects. Each profile can use it’s own application id, name, tiapp properties and skin.

Installation

To always load the plugin, you need to add the `commands` and `hooks` directories to the Titanium CLI’s paths configuration:

ti config -a paths.commands /path/to/plugin/commands
ti config -a paths.hooks /path/to/plugin/hooks

Alternatively, you may extract the plugin to the global Titanium installation folder or project directory, then enable it in the `tiapp.xml`:

<?xml version="1.0" encoding="UTF-8"?>
<ti:app xmlns:ti="http://ti.appcelerator.org">
	<plugins>
		<plugin version="1.0">ti.multiconfiguration</plugin>
	</plugins>
</ti:app>

Your $PATH should contain rsync command.

Using

Configuration file

You can specify path to the configuration file with --build-config option. By default it’s <PROJECT_DIR>/config.json. Configuration file contains a list of profiles.

Example:

{
  "PROFILES": {
    "profile1": {
      "properties": {
        "aaa.bbb": 42
        "data.url": "https://foo.com"
      },
      "id": "com.foo",
      "name": "Foo",
      "theme": "foo",
    },
    "profile2": {
      "properties": {
        "aaa.bbb": 100
        "data.url": "https://bar.com"
      },
      "id": "com.bar",
      "name": "Bar",
      "theme": "bar",
      "android-theme": "simple"
    },
    "profile3": {
      "properties": {
        "aaa.bbb": 200
        "data.url": "https://baz.com"
      },
      "id": "com.baz",
      "name": "Baz",
      "theme": "baz",
      "android-theme": null
    }
  }
}

Each profile should contain an application id and name. You also can specify theme id for profile. If android-theme property specified in profile Android theme @style/Theme.Multiconfiguration.<android-theme> will be used for application. If android-theme property is null Android theme won’t be customized. When theme is present plugin will inject specified theme as if it was set with --theme= CLI argument.

Building project

You need to specify profile name with a --build-profile argument.

Example:

ti build -p iphone --build-profile profile2 --build-config profiles.json

Packaging for Distribution

To package the plugin, run:

node build.js

ti.multiconfiguration's People

Contributors

drauggres avatar prop avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ti.multiconfiguration's Issues

Custom <modules> section

Would it be possible to change the modules section too?

modules: [{name: "name", "version": "1.0.0", "platform": "android"}]

and output

<modules>
  <module version="1.0.0" platform="android">name</module>
<modules>

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.