Skip to content

Add GremlinJar and GremlinBootstrap#48

Draft
jpenilla wants to merge 8 commits intomasterfrom
feat/gremlin-jar
Draft

Add GremlinJar and GremlinBootstrap#48
jpenilla wants to merge 8 commits intomasterfrom
feat/gremlin-jar

Conversation

@jpenilla
Copy link
Owner

@jpenilla jpenilla commented May 30, 2025

Simplifies using Gremlin for a standalone application.

  • Support nested jars only mode (no runtime downloads)

@jpenilla jpenilla force-pushed the feat/gremlin-jar branch from 01f4638 to a484d3b Compare May 30, 2025 00:23
@jpenilla jpenilla requested a review from Copilot May 30, 2025 00:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a standalone Gremlin bootstrap class to extract nested JARs, resolve dependencies, and launch the application, and extends the Gradle plugin with tasks to index and package those nested JARs into a single executable archive.

  • Introduce GremlinBootstrap for runtime unpacking, dependency resolution, and custom classloader launch.
  • Add IndexNestedJars and GremlinJar tasks to the Gradle plugin, plus a defaultGremlinRuntime configuration.
  • Wire new tasks into GremlinPlugin and adjust resource/output wiring for nested JAR packaging.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
runtime/src/main/java/xyz/jpenilla/gremlin/runtime/GremlinBootstrap.java Implements bootstrap logic to extract nested JARs, read dependencies, and spawn the main thread.
gradle-plugin/src/main/kotlin/xyz/jpenilla/gremlin/gradle/IndexNestedJars.kt Adds a task to generate index.txt listing nested JAR names.
gradle-plugin/src/main/kotlin/xyz/jpenilla/gremlin/gradle/GremlinPlugin.kt Registers defaultGremlinRuntime, indexNestedJars, and gremlinJar tasks; wires configurations.
gradle-plugin/src/main/kotlin/xyz/jpenilla/gremlin/gradle/GremlinJar.kt Defines GremlinJar task to assemble an executable JAR with nested JARs and custom manifest.

@jpenilla jpenilla requested a review from Copilot May 30, 2025 20:30
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a standalone Gremlin launcher and the accompanying Gradle plugin support for bundling nested JARs.

  • Introduces GremlinBootstrap to extract nested JARs, resolve dependencies, and launch the main application from a single JAR.
  • Adds Gradle tasks and utilities (PrepareNestedJars, BootstrapJar, and helper extensions) to package Gremlin runtime and nested JARs.
  • Updates plugin extension properties for controlling inclusion of the Gremlin runtime on compile/runtime classpaths.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
runtime/src/main/java/xyz/jpenilla/gremlin/runtime/GremlinBootstrap.java New bootstrap class to unpack nested JARs, resolve dependencies, and invoke the target main class.
gradle-plugin/src/main/kotlin/xyz/jpenilla/gremlin/gradle/utils.kt Added Path and zip-file helper extensions for URI and filesystem operations.
gradle-plugin/src/main/kotlin/xyz/jpenilla/gremlin/gradle/PrepareNestedJars.kt New Gradle task that copies specified JARs into an output dir and generates an index.
gradle-plugin/src/main/kotlin/xyz/jpenilla/gremlin/gradle/GremlinPlugin.kt Registers gremlinRuntime & nestedJars configurations and tasks (prepareNestedJars, bootstrapJar), and wires classpath extensions.
gradle-plugin/src/main/kotlin/xyz/jpenilla/gremlin/gradle/GremlinExtension.kt Replaced old runtime-dependency flag with separate compile/runtime flags and added a nestJars helper.
gradle-plugin/src/main/kotlin/xyz/jpenilla/gremlin/gradle/BootstrapJar.kt Defines a custom Jar task that unpacks runtime JARs, writes manifest entries, and nests additional JARs.
Comments suppressed due to low confidence (1)

runtime/src/main/java/xyz/jpenilla/gremlin/runtime/GremlinBootstrap.java:51

  • [nitpick] There are no unit tests covering GremlinBootstrap. Adding tests for nested-jar extraction, manifest parsing, and main invocation would help prevent regressions.
public static void main(final String[] args) {

@jpenilla jpenilla force-pushed the feat/gremlin-jar branch from a4c2f9e to c301df6 Compare May 30, 2025 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants