Inside Scaloid

Sung-Ho Lee edited this page Apr 18, 2015 · 16 revisions

This section provides basic knowledge for contributors.

Building Scaloid

Prerequisities

  • sbt 0.13.5 or later
  • Android SDK Level 16
  • Android Support Repository
  • Environment variable ANDROID_HOME

Task scaloid:generate

A large part of the Scaloid source code is generated by a template engine. One of the biggest reasons to use template based code generation is for the properties helper. For example, Scaloid contains the following wrapper code for a property displayedChild.

  @inline def displayedChild = basis.getDisplayedChild
  @inline def displayedChild  (p: Int) =            displayedChild_=  (p)
  @inline def displayedChild_=(p: Int) = { basis.setDisplayedChild    (p); basis }

It is simply impossible to manually write and maintain these helpers for every property in the Android library, so we generate them automatically with an sbt task. Use sbt scaloid:generate to generate the source code. Then all of the files in src/main/st folder are processed with the template engine and saved (overwritten) into the src/main/scala folder.

  • Scaloid can be built with Android API level 16 or higher and Scala version 2.11.0 or higher.

Pull Requests

  • Create topic branches. Don't ask us to pull from your master branch.

  • One pull request per feature. If you want to do more than one thing, send multiple pull requests.

  • Document any change in behavior. Make sure the README and any other relevant documentation are kept up-to-date.

  • Send coherent history. Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before sending them to us.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.