Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26216] iOS CLI: Incremental build does not remove unencrypted JS files when switching deploy type from "development" to "test"

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2018-08-24T17:21:44.000+0000
Affected Version/sn/a
Fix Version/sRelease 7.5.0
ComponentsiOS
Labelsbuild, cli, ios
ReporterJoshua Quick
AssigneeHans Knöchel
Created2018-07-18T01:22:16.000+0000
Updated2018-09-20T15:14:22.000+0000

Description

*Summary:* There is an iOS incremental build issue where if you build for the iOS Simulator first, then an iOS device afterwards, the resulting iOS app bundle will contain both encrypted .js files an unencrypted plain text .js files. Builds for device (ie: deployment type "test" and "production") must encrypt all .js files. This is *+not+* an issue with production/release builds. This is only an issue with debug builds. *Steps to reproduce:*

On Mac, open a "Finder" window.

Go to an existing Titanium project directory.

Delete its "build" directory if it has one.

Open a "Terminal" window.

In the terminal, cd to the same project directory.

Run: appc run -p ios -D development --build-only

Wait for the build to finish.

Run: appc run -p ios -D test --build-only

Wait for the build to finish.

In "Finder", go to directory: ./build/iphone/build/Products/Debug-iphonesimulator

Right click on the app bundle file and select "Show Package Contents" from the popup menu.

*Result:* The app bundle for the "test" build contains plain text .js files such as "app.js" when it shouldn't. A "test" build must encrypt all .js files. *Notes:* * This is an incremental build issue. The app bundle includes both encrypted .js files and plain text .js files from the previous "development" build. * I'm not sure if the reverse is true. When doing a "test" build first and then doing a "development" build, the generated ApplicationRouting.m does not contain any assets.

Comments

  1. Chris Barber 2018-07-18

    The bug is simple. It has nothing to do with device or dist builds, debug vs release, the encryptJS flag, or going back and forth between sim and device builds. The this.forceCleanBuild check doesn't take into account the \-\-deploy\-type changing, which only changes if you explicitly set it via the command line for a sim or device build.
  2. Hans Knöchel 2018-07-19

    PR: https://github.com/appcelerator/titanium_mobile/pull/10187 Test-Case: See above (can also be done with ti build instead of appc run) [~cbarber] I placed it in the forceCleanBuild check so we get a fresh build directory and clean up all old (unencrypted) assets. If works fine locally, let me know your thoughts. Thanks!! *EDIT*: Can this also be a 7.4.0 or should we wait for 7.4.0?
  3. Samir Mohammed 2018-09-20

    *Closing ticket.* Verified fix in SDK version 7.5.0.v20180906093938. Incremental build now removes unencrypted JS files when switching deploy type from "development" to "test". *FR Passed (Test Steps)* Followed the instructions above in the description
       On Mac, open a "Finder" window.
       Go to an existing Titanium project directory.
       Delete its "build" directory if it has one.
       Open a "Terminal" window.
       In the terminal, cd to the same project directory.
       Run: appc run -p ios -D development --build-only
       Wait for the build to finish.
       Run: appc run -p ios -D test --build-only
       Wait for the build to finish.
       In "Finder", go to directory: ./build/iphone/build/Products/Debug-iphonesimulator
       Right click on the app bundle file and select "Show Package Contents" from the popup menu.
       
    Know longer able to see unencrypted JS files when switching deploy type from "development" to "test". *Test Environment*
       APPC Studio: 5.1.0.201808080937
       APPC CLI: 7.0.7-master.1
       Operating System Name: Mac OS High Sierra
       Operating System Version: 10.13.6
       Node.js Version: 8.9.1
       Xcode 10.0 GM
       

JSON Source