Open ktoso opened 2 weeks ago
For reference, here's output for fetching gradle-api:
This showcases mostly how quickly very large those dependency trees can become. And basically we can take that classpath and feed it into our other tool invocations as additional path - getting us out of jar-hell 👍
FETCH DEPENDENCIES FOR: [dev.gradleplugins:gradle-api:8.10.1]
RESOLVED CLASSPATH: /private/var/folders/hn/c22y4jsn4j74mw23_kpgn88w0000gn/T/java-swift-dependencies4361964387107219063/build/classes/java/main:/private/var/folders/hn/c22y4jsn4j74mw23_kpgn88w0000gn/T/java-swift-dependencies4361964387107219063/build/resources/main:/Users/ktoso/.gradle/caches/modules-2/files-2.1/dev.gradleplugins/gradle-api/8.10.1/a236c4ed58ea4234cef8217bf8dc0793a02d80be/gradle-api-8.10.1.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-all/3.0.22/eef9a93f08c895cba735c6aed28e9ce32b762229/groovy-all-3.0.22.pom:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.9.24/9928532f12c66ad816a625b3f9984f8368ca6d2b/kotlin-stdlib-1.9.24.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-ant/3.0.22/b90ebe5f97170162105fa87b3e69f8a51f2ef6ea/groovy-ant-3.0.22.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-astbuilder/3.0.22/ad926cd4b93271af8181899c360d93b380d5a9e/groovy-astbuilder-3.0.22.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-cli-picocli/3.0.22/94f33323a1779cb89b1faea54beea4670bd42c40/groovy-cli-picocli-3.0.22.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-groovysh/3.0.22/70f050713a499e0ecd79b3c49b80b9d4d35041f1/groovy-groovysh-3.0.22.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-console/3.0.22/14875d49eb557088303c04b7c91ce66589608c44/groovy-console-3.0.22.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-datetime/3.0.22/bae704f1f7a2b80b9b9b00071e0cedb480688149/groovy-datetime-3.0.22.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-groovydoc/3.0.22/6cebde157f06db0629b67545f87775232462ced1/groovy-groovydoc-3.0.22.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-docgenerator/3.0.22/e52b0f06a811ba503c19cb0c6a269498baf6830f/groovy-docgenerator-3.0.22.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-jmx/3.0.22/caa285ee1a15b08a5f113ca3183fc91622072fda/groovy-jmx-3.0.22.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-json/3.0.22/28e337f52b31cc890ad4eb51e738a2bce47a3f1c/groovy-json-3.0.22.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-jsr223/3.0.22/60ea08d95ac160f06d7065cbd37d6548ca665eb/groovy-jsr223-3.0.22.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-macro/3.0.22/a66f5cf47799eceae07ab7431ad0aaf3e1b7ed3f/groovy-macro-3.0.22.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-nio/3.0.22/7b3f5ac7421efec8efd1b0c7064bcb4b68379e4c/groovy-nio-3.0.22.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-servlet/3.0.22/71bb16ddcc8155de17bc343174f2b5348dda101c/groovy-servlet-3.0.22.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-sql/3.0.22/8a208e8eb1156f4f27aa5dfa102f25420560ce83/groovy-sql-3.0.22.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-swing/3.0.22/a96b8203c71923c1b6343d4bbdc36ba973307d74/groovy-swing-3.0.22.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-templates/3.0.22/c8cf8e0bb82d7e112e87c6492b17f62da267b8ec/groovy-templates-3.0.22.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-test/3.0.22/cc61e98fe6eba4f29aed40a1ed1fda601a0e84eb/groovy-test-3.0.22.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-test-junit5/3.0.22/663cbadeb7c42bf1e11d7f9a01e3d8ddb0d5eb77/groovy-test-junit5-3.0.22.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-testng/3.0.22/2964eb7933377694db6cfa321ca7a2d16f29fc81/groovy-testng-3.0.22.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-xml/3.0.22/de0dd2f84c3befb280132866d0a6bf3ae031f55a/groovy-xml-3.0.22.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy/3.0.22/8403cbf38ed86f9fde3abbf0d2548642ddfebd00/groovy-3.0.22.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.apache.ant/ant-junit/1.10.14/e5f7b5a367cb03a73879018331c7065a2a479954/ant-junit-1.10.14.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.apache.ant/ant/1.10.14/1edce9bbfa60dfd51f010879c78f4421dafae7a7/ant-1.10.14.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.apache.ant/ant-launcher/1.10.14/8d2268288496b0541a2640f2ee07fe3de1a02301/ant-launcher-1.10.14.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.apache.ant/ant-antlr/1.10.14/1f19602f622fa9fa04f9aa8807f935b571ca05ca/ant-antlr-1.10.14.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/info.picocli/picocli/4.6.3/18177f4c3d65cc94e6d4039775ec5aed8089f8d0/picocli-4.6.3.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/com.thoughtworks.qdox/qdox/1.12.1/f7122f6ab1f64bdf9f5970b0e89bfb355e036897/qdox-1.12.1.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/com.github.javaparser/javaparser-core/3.25.6/5e058bea33f92e5dd6f41f86066009cd56250452/javaparser-core-3.25.6.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/jline/jline/2.14.6/c3aeac59c022bdc497c8c48ed86fa50450e4896a/jline-2.14.6.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/junit/junit/4.13.2/8ac9e16d933b6fb43bc7f576336b8f4d7eb5ba12/junit-4.13.2.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.junit.platform/junit-platform-launcher/1.9.2/38e0bfad8c57d4cd1a8f27926c25ffe9543068d6/junit-platform-launcher-1.9.2.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.junit.platform/junit-platform-engine/1.9.2/40aeef2be7b04f96bb91e8b054affc28b7c7c935/junit-platform-engine-1.9.2.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.junit.platform/junit-platform-commons/1.9.2/6f9f8621d8230cd38aa42e58ccbc0c00569131ce/junit-platform-commons-1.9.2.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.junit.jupiter/junit-jupiter-engine/5.9.2/572f7a553b53f83ee59cc045ce1c3772864ab76c/junit-jupiter-engine-5.9.2.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.junit.jupiter/junit-jupiter-api/5.9.2/fed843581520eac594bc36bb4b0f55e7b947dda9/junit-jupiter-api-5.9.2.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.testng/testng/7.5/1416a607fae667c14e390b484e8d02b5824c0674/testng-7.5.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.3/42a25dc3219429f0e5d060061f71acb49bf010a0/hamcrest-core-1.3.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.opentest4j/opentest4j/1.2.0/28c11eb91f9b6d8e200631d46e20a7f407f2a046/opentest4j-1.2.0.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.7.32/cdcff33940d9f2de763bc41ea05a0be5941176c3/slf4j-api-1.7.32.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/com.beust/jcommander/1.78/a3927de9bd6f351429bcf763712c9890629d8f51/jcommander-1.78.jar:/Users/ktoso/.gradle/caches/modules-2/files-2.1/org.webjars/jquery/3.5.1/2392938e374f561c27c53872bdc9b6b351b6ba34/jquery-3.5.1.jar
PoC of the necessary infra for https://github.com/swiftlang/swift-java/issues/135
Brought the PoC to a place where I can leave it for a moment before I get back to it.
This allows us to: use gradle as an API to resolve and fetch dependencies, and return a classpath containing them.
Usage like this:
Problems to solve: