
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
avk-tiapp-composer
Advanced tools
A Titanium plugin that enables the definition of a template file for the tiapp.xml
of your project. It now supports the app/config.json
file too!
NOTE: this script works only as a global plugin, since it has to modify tiapp.xml
and config.json
before the Titanium CLI parses them.
npm i -g tiapp-composer
Done!
The plugin will search for a config (tiapp-cfg.json
) and a template file (tiapp.tpl
) in your current working directory whenever you launch the titanium build
and titanium clean
commands.
If it doesn't find the config file, it will give a warning and skip to the rest of the command. Once you define the config, however, you have to write a template, or the plugin will simply write an empty tiapp.xml
.
The tiapp.tpl
is an exact copy of a tiapp.xml
. The only difference is that it will be treated as an ES6 template literal, so you can define custom variables:
<?xml version="1.0" encoding="UTF-8"?><ti:app xmlns:ti="http://ti.appcelerator.org">
<id>${app.id}</id>
<name>Tiapp Composer Test</name>
<version>{$app.version}</version>
<publisher>not specified</publisher>
<url>caffeina.com</url>
[...]
<ios>
<enable-launch-screen-storyboard>true</enable-launch-screen-storyboard>
<use-app-thinning>true</use-app-thinning>
<plist>
<dict>
[...]
<key>LSApplicationQueriesSchemes</key>
<array>
${app.ios.querySchemes}
</array>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<${app.ios.allowArbitraryLoads}/>
[...]
</dict>
</plist>
</ios>
<android xmlns:android="http://schemas.android.com/apk/res/android">
</android>
[...]
<sdk-version>${app.sdkVersion}</sdk-version>
<plugins><plugin version="1.0">ti.alloy</plugin>
</plugins>
</ti:app>
and the corresponding tiapp-cfg.json
would be:
{
"development": {
"app": {
"id": "com.myapp.title.test",
"version": "6.6.6",
"sdkVersion": "7.0.0.CUSTOMBUILD",
"ios": {
"querySchemes": "
<string>testscheme</string>
",
"allowArbitraryLoads": "true"
}
}
},
"production": {
"app": {
"id": "com.myapp.title",
"version": "6.6.0",
"sdkVersion": "7.0.0.GA",
"ios": {
"querySchemes": "
<string>twitter</string>
<string>fb</string>
",
"allowArbitraryLoads": "false"
}
}
}
}
As you can see, you can replace entire sections of the tiapp with a custom string. Hell, you could even put the whole tiapp.xml
in the config as an attribute. I'm not judging you.
You can write a template and configuration for your config.json
file too, in the same manner as above.
Check out an example template and configuration
You can use the --tiappenv
flag in your titanium build
or titanium clean
command, with one of the top-level attribute names you defined:
ti build --platform android --target device --device-id all --tiappenv development
Running tiapp-composer...
[INFO] tiapp-composer: Successfully wrote tiapp.xml
If you use a name you haven't defined in your config, the plugin will not write the tiapp.xml
file:
ti build --platform android --target device --device-id all --tiappenv ayylmao
Running tiapp-composer...
[WARN] tiapp-composer: Couldn't find the environment "ayylmao" in the tiapp-cfg.json file.
[WARN] tiapp-composer Skipping tiapp.xml composing.
If you don't add the --tiappenv
flag to your command, the plugin will default to the name development
:
ti build --platform android --target device --device-id all
Running tiapp-composer...
[WARN] tiapp-composer: --tiappenv flag not set, defaulting to "development"
[INFO] tiapp-composer: Successfully wrote tiapp.xml
tn.json
file and add some recipes with different --tiappenv
flags:tn project save testdroid --platform android --target device --device-id all --tiappenv mytestenv
tn project save proddroid --platform android --target device --device-id all --tiappenv myprodenv
/tiapp.xml
to your .gitignore
file, since it will be overwritten at each build command. The plugin will even give you a warning if you don't do so.The reason behind this contraption is that I had to switch between different tiapp settings in one of my projects, depending on the type of build i had deploy (test, enterprise, production...). Initially I would keep several branches with different tiapp files, but that approach was time and space consuming, and prone to errors. After trying other solutions, and with the pressing need to adopt CI in my projects, I decided to write my own plugin.
FAQs
Define dynamic tiapp.xml files with the power of template strings
We found that avk-tiapp-composer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.