Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-18044] Android: tiapp.xml of module has two 'modules' tags #5961

Merged
merged 1 commit into from Dec 5, 2014

Conversation

yomybaby
Copy link
Contributor

see TC-4550

@ingo ingo changed the title TC-4550: tiapp.xml of module has two 'modules' tags. [TIMOB-18044] tiapp.xml of module has two 'modules' tags. Nov 17, 2014
@ingo ingo changed the title [TIMOB-18044] tiapp.xml of module has two 'modules' tags. [TIMOB-18044] tiapp.xml of module has two 'modules' tags Nov 17, 2014
@@ -117,7 +117,7 @@ def stage(platform, project_dir, manifest, callback):
xml = open(tiapp).read()
tiappf = open(tiapp,'w')
xml = xml.replace('<guid/>', '<guid></guid>')
xml = xml.replace('</guid>', '</guid>\n<modules>\n<module version="%s">%s</module>\n</modules>\n' % (version, moduleid))
xml = xml.replace('</modules>', '\t<module version="%s">%s</module>\n\t</modules>\n' % (version, moduleid))
# generate a guid since this is currently done by developer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes looks good. However, I'm concerned with a case where the modules section is missing in tiapp (either removed accidentally by user, or we didn't generate during creation). In that case, we might not end up adding the modules section. I would prefer to find the modules tag and if it is not found, then we add the modules section after guid section, otherwise, just replace the existing modules section. The code can be on similar lines (just a prototype)

moduleid = xml.find('</modules>') if moduleid: xml = xml.replace('</modules>', '\t<module version="%s">%s</module>\n\t</modules>\n' % (version, moduleid)) elif xml = xml.replace('</guid>', '</guid>\n<modules>\n<module version="%s">%s</module>\n</modules>\n' % (version, moduleid))

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though the modules tag is missing, it is still able to add the modules section to tiapp. So there is no need to add a check for missing modules section.

@ingo ingo changed the title [TIMOB-18044] tiapp.xml of module has two 'modules' tags [TIMOB-18044] Android: tiapp.xml of module has two 'modules' tags Nov 18, 2014
pinnamur pushed a commit that referenced this pull request Dec 5, 2014
[TIMOB-18044] Android: tiapp.xml of module has two 'modules' tags
@pinnamur pinnamur merged commit e197a2a into tidev:master Dec 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants