{ "id": "174390", "key": "TIMOB-27574", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "20949", "name": "Release 9.0.1", "archived": false, "released": true, "releaseDate": "2020-04-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2020-04-10T21:54:49.000+0000", "created": "2019-11-13T01:35:09.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "build", "gradle", "properties", "sdk" ], "versions": [], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-04-10T21:54:49.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "*Summary:*\r\nWhen 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.\r\n[TiApplication.loadBuildProperties()|https://github.com/appcelerator/titanium_mobile/blob/5fbe78276e04049874e13bcc0a3874593f27254e/android/titanium/src/java/org/appcelerator/titanium/TiApplication.java#L300]\r\n\r\nBy 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.\r\nhttps://developer.android.com/studio/build/gradle-tips#share-custom-fields-and-resource-values-with-your-app-code\r\n\r\n*Example:*\r\n{code:groovy}\r\n// The \"build.gradle\" file.\r\nandroid {\r\n\tdefaultConfig {\r\n\t\tbuildConfigField('String', 'BUILD_VERSION', '\"9.x.x\"')\r\n\t\tbuildConfigField('String', 'BUILD_TIMESTAMP', '\"YYYY/MM/DD HH:MM\"')\r\n\t\tbuildConfigField('String', 'BUILD_GIT_HASH', '\"HEAD\"')\r\n\t}\r\n}\r\n{code}\r\n\r\n*Note:*\r\nThis information is logged on app startup as...\r\n{code}\r\n (Powered by Titanium .)\r\n{code}\r\n\r\nThe above message gets logged in the code below...\r\n[ti.main.js#L15|https://github.com/appcelerator/titanium_mobile/blob/5fbe78276e04049874e13bcc0a3874593f27254e/common/Resources/ti.main.js#L15]\r\n", "attachment": [], "flagged": false, "summary": "Android: Replace SDK \"build.properties\" with gradle generated \"BuildConfig\" class", "creator": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 1190, "state": "closed", "name": "2020 Sprint 7", "startDate": "2020-03-27T16:30:21.583Z", "endDate": "2020-04-10T16:30:00.000Z", "completeDate": "2020-04-10T17:43:27.544Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "455016", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "After upgrading gradle via [TIMOB-27778], the current \"master\" and \"9_0_X\" branches are no longer picking up the generated \"build.properties\" file on the initial build. This means that Jenkins built SDKs for Android will return version \"1.0.0\". This can be seen in app builds, such as via Jenkin's mocha unit test output.\r\nThis issue can be corrected with this ticket's proposed changes.\r\n\r\nThis issue was caught before release.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-08T02:57:38.000+0000", "updated": "2020-04-08T02:57:38.000+0000" }, { "id": "455027", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/11605\r\nPR (9.0.x): https://github.com/appcelerator/titanium_mobile/pull/11606\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-08T19:18:11.000+0000", "updated": "2020-04-08T19:18:11.000+0000" }, { "id": "455031", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed.\r\nPR's Merged.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-08T21:45:54.000+0000", "updated": "2020-04-08T21:45:54.000+0000" }, { "id": "455088", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified on:\r\nMac OS: 10.15.4\r\nSDK: 9.0.1.v20200409100807, 9.1.0.v20200409073825\r\nAppc CLI: 8.0.0\r\nJDK: 11.0.4\r\nNode: 10.17.0\r\nStudio: 6.0.0.202003132109\r\nDevice: Pixel3(v10.0) emulator, ", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-10T21:54:49.000+0000", "updated": "2020-04-10T21:54:49.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }