Git Product home page Git Product logo

Comments (8)

madisp avatar madisp commented on June 20, 2024 2

I can make a PR for this later in the evening today

from gr8.

madisp avatar madisp commented on June 20, 2024 1

I forked the task (only needed a handy R8 invoke task :)), that's exactly what I'm doing (invoking on Gradle the JVM Gradle is running on) while runtime jars are passed in from the launcher. I guess it would make sense to name it differently or actually use it for launching?

For invoking afaik the Worker APIs had nice facilities to create isolated tasks that run on a different JVM.

from gr8.

martinbonnin avatar martinbonnin commented on June 20, 2024

Good callout 👍 . Any idea what options to expose override this? I guess it should take a path?

gr8 {
  javaHome.set("path/to/java/home")
}

from gr8.

madisp avatar madisp commented on June 20, 2024

ideally should expose setting the toolchain launcher itself, while defaulting to the toolchain provided by the Java extension by default, check the section "Toolchains for JVM projects" here:

https://docs.gradle.org/current/userguide/toolchains.html#sec:plugins

that way if someone does something like

java {
  sourceCompatibility = JavaVersion.VERSION_11
  targetCompatibility = JavaVersion.VERSION_11

  toolchain {
    languageVersion.set(JavaLanguageVersion.of(11))
    vendor.set(JvmVendorSpec.AZUL)
  }
}

you can get that toolchain picked up automatically.

If you have a Property<JavaLauncher> you can turn it into a java.home File with something like:

val javaHome = launcher.get().executablePath.asFile.parentFile.parentFile

from gr8.

martinbonnin avatar martinbonnin commented on June 20, 2024

Property<JavaLauncher>

Thanks that sounds perfect 👍

Do we want to be able to run R8 using e.g. Java 20 while still passing it Java 11 runtime jars? That'd save launching a new JVM if your main build is using 20. But maybe it's not worth it?

from gr8.

martinbonnin avatar martinbonnin commented on June 20, 2024

invoking on Gradle the JVM Gradle is running on while runtime jars are passed in from the launcher

Nice. I think that's a good default, no need to downgrade the JVM just to get the runtime jars.

from gr8.

martinbonnin avatar martinbonnin commented on June 20, 2024

Awesome, thanks!

from gr8.

martinbonnin avatar martinbonnin commented on June 20, 2024

Closed with #16

from gr8.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.