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:23:02 GMT
On Thu, Jun 5, 2014 at 1:02 PM, Michal Mocny <mmocny@chromium.org> wrote:

> Dumb questions from someone who knows nothing about this:
>
> (a) Is it possible to share the same directories and still get incremental
> builds so long as we guard for previous build being done via the same
> method?  aka, could build steps be:
>
> if (!exists_file(last_build_was_$TYPE))
>   clean();
> build();
> create_file(last_build_was_$TYPE)
>
> I don't know enough about the Eclipse build process to say whether this is
possible. (Also, Eclipse has the nasty habit of building continuously if
you have it running)

I was considering just leaving out the automatic clean step entirely, and
telling people "If you are using Eclipse as well as the command line tools,
then you may experience problems building. If you do, then run a clean
before you build after you switch environments."


> (b) Is it possible to leave the separate paths, but change the build steps
> to swap directory locations just for the duration of the offending AAPT
> steps?
>

I don't think we can reliably do this; there could be multiple libraries in
an arbitrary project, each with an bin|ant-build and gen|ant-gen directory,
and the build steps are complex. I think that the aapt steps (there are a
couple) may use the right directories, but theres a 'compute dependencies'
task which gets it wrong. (It's a legit bug, I think -- there's a big FIXME
in the code there).

I'm open to anyone trying it, though ;)


> -Michal
>
>
> On Thu, Jun 5, 2014 at 11: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.
> >
> > 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.
> >
> > 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.
> >
> > 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.
> >
> > Ian
> >
>

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