Skip to content

Android code generation using Mustache templates - #26

Merged
ben-efiz merged 6 commits into
sinnerschrader-mobile:feature/refactorfrom
S2MBO:feature/refactor
Mar 18, 2015
Merged

ben-efiz merged 6 commits into
sinnerschrader-mobile:feature/refactorfrom
S2MBO:feature/refactor

Conversation

@S2MBO

@S2MBO S2MBO commented Mar 12, 2015

Copy link
Copy Markdown

No description provided.

@S2MBO
S2MBO force-pushed the feature/refactor branch from 105ea9d to b587191 Compare March 12, 2015 15:49
Comment thread metajson/readJSON.py

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't get what's package name, except it is specific to Java, right?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes, it's important for Java but may also apply to other languages like Python. For Example: https://github.com/S2MBO/metaJSON/blob/feature/refactor/metajson/templates/Android/_CLASSNAME_.java.mustache#L8

@netbe

netbe commented Mar 12, 2015

Copy link
Copy Markdown
Contributor

@S2MBO find someone with Android knowledge to review your template, maybe @ben-efiz ?

@ben-efiz

Copy link
Copy Markdown
Contributor

When executing metaJSON with the following code:

python metajson-runner.py -p S2M -o com/example/project/model/ --template=metajson/templates/Android/ --package=com.example.project.model -i samples/product.json

it uses the default suffix "JSONObject". The files are called correspondingly but the class names don't contain "JSONObject" at the end.

Calling it with suffix parameter, e.g. -s false it works and the java code looks ok. Some improvements would one more line break after each line and putting attributes and methods in the correct order (attributes first, then methods) but i can imagine that is not that easy during parsing.

@S2MBO

S2MBO commented Mar 16, 2015

Copy link
Copy Markdown
Author

@ben-efiz I fixed the suffix issue and implemented your suggested improvements. Please reconsider.

ben-efiz pushed a commit that referenced this pull request Mar 18, 2015
Android code generation using Mustache templates
@ben-efiz
ben-efiz merged commit e1b249f into sinnerschrader-mobile:feature/refactor Mar 18, 2015
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.

3 participants