Skip to main content

Module gradle

Module gradle 

Source
Expand description

Gradle classpath resolver.

Extracts classpath JARs from Gradle projects by writing a temporary init script and executing gradlew --init-script <script> sqryListClasspath. Parses the structured output lines to build ResolvedClasspath entries per module.

§Strategy

  1. Write a temporary init script that adds a sqryListClasspath task to all projects.
  2. Locate gradlew (or gradlew.bat on Windows) in the project root, or fall back to installed gradle.
  3. Execute the selected Gradle command with the init script. Timeout defaults to 60 seconds.
  4. Parse SQRY_CP:<module>:<group>:<name>:<version>:<path> lines.
  5. On failure or timeout, fall back to a cached resolved-classpath.json.

§Security

Prefer the project’s own Gradle wrapper. If the wrapper is absent, sqry can fall back to installed gradle; that path should be treated as less reproducible and is logged explicitly.

Functions§

resolve_gradle_classpath
Resolve classpath for a Gradle project.