Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2209] Android: Re-enable incremental build

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2013-10-19T01:08:16.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 21, 2013 Sprint 21 Core, Release 3.2.0
ComponentsAndroid, Tooling
Labelsandroid, androidbuild, ay-verified, cb-verified, defect, tooling
ReporterMarshall Culpepper
AssigneeChris Barber
Created2011-04-15T03:13:36.000+0000
Updated2013-11-11T19:24:07.000+0000

Description

Before all of our new changes for stylesheet and RA.java code generation we knew when new Java code was generated so we could skip the javac and dex parts of the APK building process. We need to go back through and make sure to only dex/javac when necessary.

Comments

  1. Matthew Lieder 2011-04-15

    IMHO this should be a blocker for the 1.5.0 release, since I imagine this problem is going to give a very poor experience for Android developers. I have a 2009-era Mac Mini and even if I just make a one-line change in a javascript file I have to wait 5-10min for Titanium to rebuild and show me my change in the emulator :(. It's a big enough problem for me that I'm having to stop Android development and shift my time over to hacking up a fix for this.

  2. Robby 2011-04-15

    +1 ...would be thrilled to reduce the multi-minute build times whenever I make a code change on Android (even if it's not as good as it is with the iPhone, where you can just make a change in a source file and it will be reflected the next time that file is iterated, rebuild or not)

  3. Matthew Lieder 2011-04-15

    Here's a workaround until they fix it; brings my re-build times down to 5 seconds :)

    Open android/builder.py and change

    self.build_generated_classes()
    generated_classes_built = True

    to (making sure you have the whitespace correct)

    generated_classes_built = False
    if manifest_changed or self.tiapp_changed or self.deploy_type == "production":
    self.build_generated_classes() generated_classes_built = True else:
    info("Manifest unchanged, skipping Java build")

  4. Matthew Lieder 2011-04-15

    With proper formatting (I hope):

       self.build_generated_classes() 
       generated_classes_built = True
       
       generated_classes_built = False 
       if manifest_changed or self.tiapp_changed or self.deploy_type == "production": 
         self.build_generated_classes() 
         generated_classes_built = True 
       else: 
         info("Manifest unchanged, skipping Java build")
       
  5. Matthew Lieder 2011-04-15

    More changes needed now:

    In builder.py within build_and_run, change

       if self.install: self.wait_for_device('e')
       else: self.wait_for_device('d')
       
    to
       if self.install: self.wait_for_device('d')
       else: self.wait_for_device('e')
       

    And in builder.py within package_and_deploy, change

       for jar in self.module_jars:
         apk_build_cmd += ['-rj', jar]
       
    to
       #for jar in self.module_jars:
         #apk_build_cmd += ['-rj', jar]
       
    (may need to be conditionally skipped based on if a full build is being done or not; haven't confirmed yet)
  6. Matthew Lieder 2011-04-15

    Any updates on this? I'm getting back into Android development and very sad to find it still broken in 1.6.1 :(

  7. Allen Yeung 2013-10-19

    PR: https://github.com/appcelerator/titanium_mobile/pull/4781
  8. Samuel Dowse 2013-11-11

    Verified fixed on: Mac OSX 10.9 Mavericks Titanium Studio, build: 3.2.0.201311100540 Titanium SDK, build: 3.2.0.v20131110134044 CLI: 3.2.0 Alloy: 1.3.0 Successfully built android project for emulator 2.3.3 incrementally. Closing

JSON Source