Dragos
Dragos

Reputation: 59

Appcelerator - multiple apps same codebase

I would like to create an iOS app using appcelerator, and from it create multiple forks, each fork having a few differences, like colors, logos, etc. A config file can sort out the differences, this and different results that could come from the API.

But can I have the same codebase for multiple apps? In native Android, you'd use Gradle and product flavours? What options are there in Appcelerator?

Down the line, these apps will need to be updated. Ideally, only the "core" app should be updated and all forks will pickup differences. But how could this be done?

Upvotes: 1

Views: 166

Answers (2)

rjcpereira
rjcpereira

Reputation: 953

You can have one app with multiple Alloy Themes, and set the theme that you want before you build a version of your app, to set the theme, you add the line "theme":"yourTheme3" at the "global" property of app/config.json

Your themes will be placed in e.g. app/themes/yourTheme7

Each theme also have a config.json to set specific properties, you can have specific assets, controllers, views, etc...

You can get the value of a property of the config.json like this:

Alloy.CFG.yourProperty

There are some things that you have to do manually:

Check out this page of the documentation for Alloy Themes: http://docs.appcelerator.com/platform/latest/#!/guide/Alloy_Styles_and_Themes

Upvotes: 3

miga
miga

Reputation: 4055

With "fork" you mean git forks? If so it just depends on your file structure. You could create a CommonJS file with the core and require it in your controllers. Then inside your forks you make your adjustments. After a while when you want to change something on your core you make another branch and merge it in all of your forks.

Upvotes: 1

Related Questions