Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(443)

Issue 328893003: Make javac and jar a single build action (Closed)

Created:
6 years, 6 months ago by cjhopman
Modified:
6 years, 6 months ago
Reviewers:
newt (away)
CC:
chromium-reviews, klundberg+watch_chromium.org, bulach+watch_chromium.org, yfriedman+watch_chromium.org, ilevy-cc_chromium.org
Visibility:
Public.

Description

Make javac and jar a single build action This allows us to more accurately specify the outputs of each action (we can't specify the .class file outputs easily because determing them essentially requires compiling the .java files). The lint action still operates directly on the .class files, so we continue to support specifying a directory for the .class files (but in a very simple to remove way). BUG=359249 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=279152

Patch Set 1 : #

Total comments: 4

Patch Set 2 : #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+102 lines, -97 lines) Patch
M build/android/gyp/jar.py View 2 chunks +19 lines, -13 lines 0 comments Download
M build/android/gyp/javac.py View 6 chunks +59 lines, -29 lines 0 comments Download
M build/android/gyp/util/build_utils.py View 1 1 chunk +4 lines, -1 line 0 comments Download
M build/java.gypi View 1 2 chunks +4 lines, -20 lines 0 comments Download
M build/java_apk.gypi View 1 5 chunks +16 lines, -34 lines 1 comment Download

Messages

Total messages: 12 (0 generated)
cjhopman
newt: *
6 years, 6 months ago (2014-06-13 21:33:44 UTC) #1
newt (away)
https://codereview.chromium.org/328893003/diff/40001/build/android/gyp/jar.py File build/android/gyp/jar.py (right): https://codereview.chromium.org/328893003/diff/40001/build/android/gyp/jar.py#newcode1 build/android/gyp/jar.py:1: #!/usr/bin/env python do we still use jar.py's main function ...
6 years, 6 months ago (2014-06-16 18:48:47 UTC) #2
cjhopman
https://codereview.chromium.org/328893003/diff/40001/build/java.gypi File build/java.gypi (right): https://codereview.chromium.org/328893003/diff/40001/build/java.gypi#newcode72 build/java.gypi:72: 'classes_dir': '<(intermediate_dir)/classes/1/', On 2014/06/16 18:48:46, newt wrote: > why ...
6 years, 6 months ago (2014-06-23 14:48:43 UTC) #3
newt (away)
lgtm
6 years, 6 months ago (2014-06-23 15:41:56 UTC) #4
cjhopman
The CQ bit was checked by cjhopman@chromium.org
6 years, 6 months ago (2014-06-23 15:44:44 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cjhopman@chromium.org/328893003/60001
6 years, 6 months ago (2014-06-23 15:45:43 UTC) #6
cjhopman
https://codereview.chromium.org/328893003/diff/40001/build/android/gyp/jar.py File build/android/gyp/jar.py (right): https://codereview.chromium.org/328893003/diff/40001/build/android/gyp/jar.py#newcode1 build/android/gyp/jar.py:1: #!/usr/bin/env python On 2014/06/16 18:48:46, newt wrote: > do ...
6 years, 6 months ago (2014-06-23 16:08:51 UTC) #7
commit-bot: I haz the power
Change committed as 279152
6 years, 6 months ago (2014-06-23 18:42:18 UTC) #8
Nico
All my android try results (e.g. http://build.chromium.org/p/tryserver.chromium/builders/android_dbg/builds/199268/steps/compile/logs/stdio ) come back with stacks like FAILED: cd ...
6 years, 6 months ago (2014-06-23 21:31:46 UTC) #9
cjhopman
On 2014/06/23 21:31:46, Nico (away) wrote: > All my android try results (e.g. > http://build.chromium.org/p/tryserver.chromium/builders/android_dbg/builds/199268/steps/compile/logs/stdio ...
6 years, 6 months ago (2014-06-23 21:38:08 UTC) #10
cjhopman
On 2014/06/23 21:38:08, cjhopman wrote: > On 2014/06/23 21:31:46, Nico (away) wrote: > > All ...
6 years, 6 months ago (2014-06-23 22:12:10 UTC) #11
cjhopman
6 years, 6 months ago (2014-06-23 22:36:49 UTC) #12
Message was sent while issue was closed.
I didn't reproduce this, but it is definitely due to this change. Syncing past
this and then back behind it can definitely cause that failure.

https://codereview.chromium.org/328893003/diff/60001/build/java_apk.gypi
File build/java_apk.gypi (right):

https://codereview.chromium.org/328893003/diff/60001/build/java_apk.gypi#newc...
build/java_apk.gypi:97: 'classes_dir': '<(intermediate_dir)/classes/2',
This is the bad line. We generate java files into /2. This means that during
this build we will delete everything in classes/2/ but not in classes/. So now,
classes/ contains duplicates of all the class files.

Then, when syncing back the other way, if no .java files change, we won't delete
this directory, but we will jar it. This happily grabs both copies of the .class
files and then fails dexing.

This is one of the problems with the previous way that we did javac+jar (we
leave random .class files all over the place that we have to be careful with
cleaning/moving). The new way (that this change does most of the work for) does
not have that problem. The .class files are generated in a temporary directory
and the output is a .jar of just the .class files from this build.

Powered by Google App Engine
This is Rietveld 408576698