Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-27574

Android: Replace SDK "build.properties" with gradle generated "BuildConfig" class

    Details

    • Story Points:
      5
    • Sprint:
      2020 Sprint 7

      Description

      Summary:
      When building the Titanium SDK, we generate a "build.properties" file (similar to an INI file) providing the Titanium library's version and build time information. This file is stored under APK "assets" and is read on app startup via the Java method below.
      TiApplication.loadBuildProperties()

      By default, gradle generates a BuildConfig Java class for all libraries and apps. We should use this feature instead of generating our own "build.properties" file. It will simplify our build process... and access to this info at runtime will be faster.
      https://developer.android.com/studio/build/gradle-tips#share-custom-fields-and-resource-values-with-your-app-code

      Example:

      // The "build.gradle" file.
      android {
      	defaultConfig {
      		buildConfigField('String', 'BUILD_VERSION', '"9.x.x"')
      		buildConfigField('String', 'BUILD_TIMESTAMP', '"YYYY/MM/DD HH:MM"')
      		buildConfigField('String', 'BUILD_GIT_HASH', '"HEAD"')
      	}
      }
      

      Note:
      This information is logged on app startup as...

      <AppName> <AppVersion> (Powered by Titanium <Version>.<GitHash>)
      

      The above message gets logged in the code below...
      ti.main.js#L15

        Attachments

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              jquick Joshua Quick
              Reviewer:
              Gary Mathews
              Tester:
              Lokesh Choudhary
            • Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration