Skip to content

Automatic arch support #503

Description

@ia3andy

Hello Javet team,

In the Quarkus eco-system we have the https://github.com/quarkiverse/quarkus-web-bundler which allows to seamlessly bundle scripts and styles. It relies on esbuild-java and mvnpm that we created for this purpose.

We are working on improving our esbuild-java tooling to use javet. It previously used the native esbuild CLI but wasn't supporting plugins. Our POC is working and we will probably continue on this road.

The issue now is that we don't want to include all arch as dependencies because of the size.

Using arch based profiles with dependencies works using Maven, but it doesn't with Gradle.

It seems gradle provides it's own system using configurations and attributes, I've tried this but I am not very familiar with Gradle:

val linuxX86 = configurations.create("linuxX86_64") {
    isCanBeResolved = false
    isCanBeConsumed = true
    attributes {
        attribute(
            org.gradle.nativeplatform.OperatingSystemFamily.OPERATING_SYSTEM_ATTRIBUTE,
            objects.named("linux")
        )
        attribute(
            org.gradle.nativeplatform.MachineArchitecture.ARCHITECTURE_ATTRIBUTE,
            objects.named("x86_64")
        )
    }
}

val macosArm64 = configurations.create("macosArm64") {
    isCanBeResolved = false
    isCanBeConsumed = true
    attributes {
        attribute(
            org.gradle.nativeplatform.OperatingSystemFamily.OPERATING_SYSTEM_ATTRIBUTE,
            objects.named("macos")
        )
        attribute(
            org.gradle.nativeplatform.MachineArchitecture.ARCHITECTURE_ATTRIBUTE,
            objects.named("aarch64")
        )
    }
}

dependencies {
    add("linuxX86_64", "com.caoccao.javet:javet-node-linux-x86_64:4.1.3")
    add("macosArm64", "com.caoccao.javet:javet-node-macos-arm64:4.1.3")
}

Would you consider making something like this part of your implementation since you are using Gradle as build system? Or at least in a specific artifact such as com.caoccao.javet:javet-node-auto-arch or similar?

Thanks for your library.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions