Produce a warning for aar projects with apklib dependencies

This is a basic fix for an issue #337 with APK or AAR project having a dependency of AAR type, which in turn explicitly or implicitly depends on APKLIB artifact. When putting together the list of all transitive dependencies for current project, code looks up all AAR artifacts, and checks for any APKLIB dependencies for each of them. For each located "deprecated" dependency combination, a warning message is produced if corresponding Mojo parameter is set.

TODO: Think about a proper wording for both warning messages (first one for AAR project with APKLIB libraries, second one for any project with AAR dependencies, which explicitly refer to APKLIB libraries).

Random thoughts about the future:

1) What would happen to the JAR library in APK > AAR > APKLIB > JAR case, once we decide to start removing (ignoring) APKLIB dependencies for AAR projects? Should it be removed (i.e. not included in a list of transitive dependencies) as well?

2) For complex Android projects with dependency graph like "project > AAR > AAR > APKLIB", warning message is displayed twice. Once for each AAR artifact with APKLIB transitive dependency, although technically speaking it is the same error. IMHO this can be safely ignored - better be warned twice than get a broken Android app, right?
Yep. Sounds like a warning to me :-)


On Sat, Aug 30, 2014 at 3:30 AM, Benoit Billington <notifications@github.com
> wrote:

> In
> src/main/java/com/jayway/maven/plugins/android/phase01generatesources/GenerateSourcesMojo.java:
>
> > +                        .getLibraryDependenciesFor( session, repositorySystem, artifact );
> > +                for ( Artifact dependency : dependencies )
> > +                {
> > +                    if ( dependency.getType().equals( APKLIB ) )
> > +                    {
> > +                        getLog().warn( "Detected " + artifact.getId() + " that depends on APKLIB: "
> > +                                + dependency.getId() );
> > +                        found = true;
> > +                    }
> > +                }
> > +            }
> > +        }
> > +
> > +        if ( found )
> > +        {
> > +            getLog().info( "AAR libraries should not depend or include APKLIB artifacts, as APKLIBs have "
>
> warn instead of info?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/jayway/maven-android-plugin/pull/429/files#r16910130>.
>