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

Android: Incremental build duplicates "bootstrap.json" entries as of 8.1.0

    Details

    • Story Points:
      3

      Description

      Summary:
      If a project contains a JS file ending with *.bootstrap.js, then every Android incremental build performed will duplicate its entry within our ti.internal/bootstrap.json file. This causes the bootstrap JS file to be executed multiple times on startup.

      This regression was introduced in Titanium 8.1.0.

      Note:
      This only negatively impacts bootstraps that have an execute() function such as ti.playservices, because that function will end up being invoked multiple times.

      Steps to reproduce:

      1. Create a Titanium app project.
      2. Copy the below test.bootstrap.js to the Resources directory.
      3. Build and run on Android.
      4. Notice a bootstrap dialog appears once. (This is good.)
      5. Build and run on Android again.
      6. Notice two bootstrap dialogs appear on startup. (This is bad.)
      7. Build and run on Android again.
      8. Notice three bootstrap dialogs appear on startup. (This is bad.)


      ./Resources/test.bootstrap.js

      Ti.API.info("### Bootstrap was required-in.");
       
      var wasExecuted = false;
      exports.execute = function(finished) {
      	Ti.API.info("### Bootstrap execute() method was called.");
      	var message = "This is the bootstrap dialog.";
      	if (wasExecuted) {
      		message = "Uh-oh!!! Bootstrap was wrongly executed again.";
      	}
      	var dialog = Ti.UI.createAlertDialog({
      		message: message,
      		buttonNames: ['OK'],
      		cancel: 0,
      		persistent: true,
      	});
      	dialog.addEventListener('click', finished);
      	dialog.addEventListener('cancel', finished);
      	dialog.show();
      	wasExecuted = true;
      };
      

      Cause:
      The incremental build changes made in Titanium 8.1.0 by TIMOB-27043 moved bootstrap script finding code to our core process-js-task.js file. The iOS _build.js was changed to not fetch bootstrap scripts itself anymore... but the same as not done in Android's _build.js which is why the entries are being duplicated.

        Attachments

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              jquick Joshua Quick
              Reviewer:
              Jan Vennemann
              Tester:
              Satyam Sekhri
            • 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