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.
  3. Execute the wrapper 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

Only the project’s own Gradle wrapper is executed — never a system-wide gradle binary. This prevents supply-chain attacks via a rogue global installation.

Functions§

resolve_gradle_classpath
Resolve classpath for a Gradle project.