cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Clelland <iclell...@chromium.org>
Subject Re: Ant/Crosswalk woes
Date Thu, 05 Jun 2014 17:37:18 GMT
On Thu, Jun 5, 2014 at 1:19 PM, Joe Bowser <bowserj@gmail.com> wrote:

> On Thu, Jun 5, 2014 at 8:51 AM, Ian Clelland <iclelland@chromium.org>
> wrote:
> > tl;dr: I'm running into an issue with the Crosswalk webview project
> that, I
> > think, means we have to abandon our custom ant-build and ant-gen
> > directories.
> >
>
> I'm totally cool with this.
>
>
> > Some time ago, we put in some override rules into cordova-android's Ant
> > build config. This was done because the defaults, "bin" and "gen", are
> also
> > used by Eclipse, and if you ran Eclipse and the command line tools on the
> > same project, they would step all over each others' build artifacts. The
> > only solution at the time was to do a full clean before each build,
> making
> > incremental (fast) builds impossible.
> >
>
> So, this feature existed because people want Eclipse to auto-build?
> I've turned off that "feature" in Eclipse years ago, and I've never
> been happier.  Sure, it means that I have to actually decide when I
> want to build in Eclipse to see my errors, but I actually LIKE that,
> because it's useless to see that I broke things when a change is not
> even halfway written.
>

Auto builds aren't the root of the problem, but they certainly don't help :)

I think that the problem was that ant writes its output to bin/ and gen/,
and Eclipse does the same (whether it's an auto build or not), and if
there's something in those directories, they'll do an incremental build,
which will be broken. When you switch tools, you have to do a clean before
you build.


>
> > There's a problem, though -- it turns out that when the Android AAPT
> > packager tool collects all of the resources from the /res/ directories,
> it
> > is *hard coded* to put its artifacts in /bin/.
> >
> > (Here's a fun line of code:
> >
> https://android.googlesource.com/platform/tools/base/+/master/legacy/ant-tasks/src/main/java/com/android/ant/ComputeDependencyTask.java#203
> > )
> >
> > The result of this is that the project compiles, but without all of the
> > resources needed for a XWalk WebView. The app runs, but fails at run-time
> > to construct the view, and falls back to the system WebView.
> >
> > This would also be a problem for any other library projects that use
> /res/
> > folders.
> >
>
> So, pretty much any modern Android project.
>
> > Turning off our custom build rules fixes this, but now we're back to the
> > old situation. I don't see another way to handle this, though.
> >
> > I think I'm going to have to revert the commit that changed the build
> > directories, on the 4.0.x branch at least. I'll add an issue for
> supporting
> > Gradle as well; it shouldn't have this particular issue; and then at some
> > point in the future we can go back to supporting fast builds again.
> >
>
> 1. Can't you can do incremental builds in bin and gen by unchecking
> "Build Automatically",

Nope (I don't think so, at least)

or by not using Eclipse and only using Ant?
>
Yes. Or vice versa.


> 2. We may want to move to Gradle
>
Yes. Looks like you filed CB-3445 back when 2.8.0 was the new thing :) I
think we still want to do it.

3. Ant vs Gradle is an either/or thing, and I'm not looking forward to
> the move, but I feel like it's closer than we think.
>
Agreed.

Hopefully we can make it mostly transparent to users, and "cordova build
android" can hide most of the changes.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message