cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Bowser <bows...@gmail.com>
Subject Re: Ant/Crosswalk woes
Date Thu, 05 Jun 2014 17:19:47 GMT
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.

> 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", or by not using Eclipse and only using Ant?
2. We may want to move to Gradle
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.

Mime
View raw message