cbeust / kobalt

A Kotlin-based build system for the JVM.
Apache License 2.0
433 stars 60 forks source link

some dependencies not shown with --projectInfo #315

Open pabl0rg opened 7 years ago

pabl0rg commented 7 years ago

running ./kobaltw --projectInfo > projectInfo.txt on https://github.com/pabl0rg/kobalt-mixed-example

produces this: projectInfo.txt which makes no mention of android.

However in it's pom, the dependency com.squareup.retrofit2:retrofit:2.1.0 has an optional dependency on android

    <dependency>
      <groupId>com.google.android</groupId>
      <artifactId>android</artifactId>
      <optional>true</optional>
    </dependency>

which can be seen using maven's dependency:tree

[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ retrofit ---
[INFO] com.squareup.retrofit2:retrofit:jar:2.1.0
[INFO] +- com.squareup.okhttp3:okhttp:jar:3.3.0:compile
[INFO] |  \- com.squareup.okio:okio:jar:1.8.0:compile
[INFO] +- com.google.android:android:jar:4.1.1.4:compile
[INFO] |  +- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] |  +- org.apache.httpcomponents:httpclient:jar:4.0.1:compile
[INFO] |  |  +- org.apache.httpcomponents:httpcore:jar:4.0.1:compile
[INFO] |  |  \- commons-codec:commons-codec:jar:1.3:compile
[INFO] |  +- org.khronos:opengl-api:jar:gl1.1-android-2.1_r1:compile
[INFO] |  +- xerces:xmlParserAPIs:jar:2.6.2:compile
[INFO] |  +- xpp3:xpp3:jar:1.1.4c:compile
[INFO] |  \- org.json:json:jar:20080701:compile
[INFO] +- org.codehaus.mojo:animal-sniffer-annotations:jar:1.14:compile
[INFO] +- junit:junit:jar:4.12:test
[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.assertj:assertj-core:jar:1.7.0:test
[INFO] +- org.mockito:mockito-core:jar:1.9.5:test
[INFO] |  \- org.objenesis:objenesis:jar:1.0:test
[INFO] +- com.google.guava:guava:jar:19.0:test
[INFO] +- com.squareup.okhttp3:mockwebserver:jar:3.3.0:test
[INFO] |  +- com.squareup.okhttp3:okhttp-ws:jar:3.3.0:test
[INFO] |  \- org.bouncycastle:bcprov-jdk15on:jar:1.50:test
[INFO] \- org.robolectric:robolectric:jar:3.0:test
[INFO]    +- org.robolectric:robolectric-annotations:jar:3.0:test
[INFO]    +- org.robolectric:robolectric-resources:jar:3.0:test
[INFO]    +- org.robolectric:robolectric-utils:jar:3.0:test
[INFO]    |  \- com.google.android.apps.common.testing.accessibility.framework:accessibility-test-framework:jar:1.0:test
[INFO]    +- org.robolectric:shadows-core:jar:3.0:test
[INFO]    |  +- com.ibm.icu:icu4j:jar:53.1:test
[INFO]    |  \- com.almworks.sqlite4java:sqlite4java:jar:0.282:test
[INFO]    +- org.bouncycastle:bcprov-jdk16:jar:1.46:test
[INFO]    +- org.ow2.asm:asm:jar:5.0.1:test
[INFO]    +- org.ow2.asm:asm-commons:jar:5.0.1:test
[INFO]    |  \- org.ow2.asm:asm-tree:jar:5.0.1:test
[INFO]    +- org.ow2.asm:asm-util:jar:5.0.1:test
[INFO]    +- org.ow2.asm:asm-analysis:jar:5.0.1:test
[INFO]    +- com.ximpleware:vtd-xml:jar:2.11:test
[INFO]    +- org.apache.maven:maven-ant-tasks:jar:2.1.3:test
[INFO]    \- org.apache.ant:ant:jar:1.8.0:test
[INFO]       \- org.apache.ant:ant-launcher:jar:1.8.0:test

Maven's dependency tree is complete, but does not indicate which dependencies are optional. It might be a "plus" if Kobalt could display all dependencies and indicate which ones are optional.

cbeust commented 7 years ago

I've been looking into this. Fixing --projectInfo is easy but there is still the issue that the fat jar contains optional dependencies. Fixing this has proved more challenging because my understanding of how Aether works is still limited, so I need to spend more time understanding it.

cbeust commented 7 years ago

Filed https://github.com/cbeust/kobalt/issues/316.