Skip to content

Conversation

y9vad9
Copy link

@y9vad9 y9vad9 commented Jul 4, 2025

Summary of Changes

This update introduces several structural improvements and feature additions to the Elide Gradle plugin, focusing on better integration, cleaner dependency management, and a more extensible CLI interface.

1. Removal of Version Catalog Module

  • Removed the separate module used for managing Gradle Version Catalogs.
  • Plugin now supports automated Elide CLI downloads based on a configured version (elide.settings.binary.version).
  • Dependencies should now align with the Elide version specified via the plugin extension.

2. Javadoc Tooling via Elide

  • Introduced support for invoking Elide's javadoc implementation.
  • Uses the CLI through a platform-specific shim script.
  • Configurable via elide.settings.features.javadocStrategy.

3. Javac Integration via JavaExec

  • The previously used shim script for javac has been removed.
  • Java compilation now uses JavaCompile.options.forkOptions.executable to invoke the Elide CLI directly.
  • This approach is more robust and integrates better with Gradle’s compilation system.

4. elide.exec: Custom CLI Invocation Support

Added support for defining custom tasks that invoke the Elide CLI using the new elide.exec DSL.

Example: Custom Task Using elide.exec

val elideInfo = elide.exec(taskName = "elideInfo") {
    args("info")

    useInvocation { invocation ->
        invocation
            .withCapturedStdout()
            .consumeStderr { stream -> stream.forEach(logger::error) }
            .onException { e -> throw IllegalStateException("Failed to run `elide info`", e) }
            .onNonSuccessExitCode { exitCode -> error("Returned non-success exit code: $exitCode") }
            .onSuccess(logger::lifecycle)
    }

    debug = false
}

val elideVersion = elide.exec(taskName = "elideVersion") {
    args("--version")
}
  • CLI verbosity (--debug, --verbose) is automatically inferred from plugin settings or Gradle log level.
  • Captures and logs output and error streams.
  • Optionally creates a marker file to support incremental builds.

5. Updated Elide Plugin Extension Configuration

The plugin extension (elide.settings) has been enhanced to support the following:

elide.settings {
    binary {
        silentMode = true
        strictVersionCheck = false

        useProjectBinary(
            version = "1.0.0-Beta07",
            downloadPath = layout.projectDirectory.dir(".elide").dir("bin"),
        )
    }

    features {
        enableElideInstall = true
        javacStrategy = ElideIntegrationStrategy.ELIDE_STRICT
        javadocStrategy = ElideIntegrationStrategy.NO_ELIDE
        enableTelemetry = false
    }

    diagnostics {
        debug = true
        verbose = false
    }
}

6. Dependency Resolution via Extension

Instead of using a centralized version catalog, dependencies are now accessible through the plugin-provided API:

dependencies {
    implementation(elide.runtime.core)
}

This ensures all dependencies are aligned with the configured Elide version and simplifies project setup.

@y9vad9
Copy link
Author

y9vad9 commented Jul 4, 2025

Kotlin support was dropped due to inability to support it in a stable way. The usage of compiler internals make it very hard to be implemented. Requires more time to play around.

@y9vad9
Copy link
Author

y9vad9 commented Jul 4, 2025

I still need to clean it up a little bit a test a little more, but for now I would love to receive initial feedback

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.

1 participant