gradle-plugin

Gradle plugin for Kraal: Kraal enables the use of Kotlin coroutines and GraalVM native-image together

Лицензия

Лицензия

MIT
Категории

Категории

Gradle Компиляция и сборка
Группа

Группа

com.hpe.kraal
Идентификатор

Идентификатор

gradle-plugin
Последняя версия

Последняя версия

0.0.15
Дата

Дата

Тип

Тип

jar
Описание

Описание

gradle-plugin
Gradle plugin for Kraal: Kraal enables the use of Kotlin coroutines and GraalVM native-image together
Ссылка на сайт

Ссылка на сайт

https://github.com/HewlettPackard/kraal
Система контроля версий

Система контроля версий

https://github.com/HewlettPackard/kraal

Скачать gradle-plugin

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.hpe.kraal/gradle-plugin/ -->
<dependency>
    <groupId>com.hpe.kraal</groupId>
    <artifactId>gradle-plugin</artifactId>
    <version>0.0.15</version>
</dependency>
// https://jarcasting.com/artifacts/com.hpe.kraal/gradle-plugin/
implementation 'com.hpe.kraal:gradle-plugin:0.0.15'
// https://jarcasting.com/artifacts/com.hpe.kraal/gradle-plugin/
implementation ("com.hpe.kraal:gradle-plugin:0.0.15")
'com.hpe.kraal:gradle-plugin:jar:0.0.15'
<dependency org="com.hpe.kraal" name="gradle-plugin" rev="0.0.15">
  <artifact name="gradle-plugin" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.hpe.kraal', module='gradle-plugin', version='0.0.15')
)
libraryDependencies += "com.hpe.kraal" % "gradle-plugin" % "0.0.15"
[com.hpe.kraal/gradle-plugin "0.0.15"]

Зависимости

runtime (2)

Идентификатор библиотеки Тип Версия
org.jetbrains.kotlin : kotlin-stdlib-jdk8 jar 1.3.21
com.hpe.kraal : kraal jar 0.0.15

Модули Проекта

Данный проект не имеет модулей.

Kraal

Download Build Status

Attempting to use GraalVM and Kotlin coroutines together fails due to a limitation of GraalVM - it cannot handle some perfectly valid bytecode produced by the Kotlin compiler.

Kraal performs "node splitting" on Java bytecode in order to eliminate the irreducible loops produced by the Kotlin compiler that GraalVM doesn't handle. The result is a functionally-equivalent bytecode which can be successfully processed with GraalVM.

Eventually, GraalVM may support irreducible loops, or the Kotlin compiler may add a flag to produce bytecode without them. Until then, Kraal allows the usage of these two technologies together.

Usage

Gradle

Using the Kotlin DSL:

plugins {
    id("com.hpe.kraal") version "0.0.15"
}

The Kraal Gradle plugin by default takes all jars produced by the build and their runtime dependencies, processes them to remove irreducible loops, and leaves processed copies of the jars under build/kraal.

The kraal extension is provided for convenient configuration of the default execution of KraalTask:

kraal {
    input = files(...) // *replace* set of input files
    from(...)          // or, *add* to set of input files

    outputDirectory = file(...)
}

The task and extension expose properties that create a Provider of a zipTree of the processed versions of all of the files. This can be used as a convenient way to create a "fat jar" of the processed classes:

val fatjar by tasks.creating(Jar::class) {
    from(kraal.outputZipTrees) {
        exclude("META-INF/*.SF")
        exclude("META-INF/*.DSA")
        exclude("META-INF/*.RSA")
    }
}

See the example directory for a complete working example with Ktor and GraalVM.

Maven

Use the exec-maven-plugin to execute the Kraal driver application com.hpe.kraal.MainKt:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.6.0</version>
    <dependencies>
        <dependency>
            <groupId>com.hpe.kraal</groupId>
            <artifactId>kraal</artifactId>
            <version>0.0.15</version>
        </dependency>
    </dependencies>
    <executions>
        <execution>
            <goals>
                <goal>java</goal>
            </goals>
            <phase>package</phase>
            <configuration>
                <mainClass>com.hpe.kraal.MainKt</mainClass>
                <arguments>
                    <argument>${project.build.directory}/${project.build.finalName}.${project.packaging}</argument>
                </arguments>
                <includePluginDependencies>true</includePluginDependencies>
            </configuration>
        </execution>
    </executions>
</plugin>

See the maven-example directory for a complete working example with Ktor and GraalVM.

com.hpe.kraal

Hewlett Packard Enterprise

Hewlett Packard Enterprise on github; please contact github@hpe.com for access

Версии библиотеки

Версия
0.0.15
0.0.14
0.0.13
0.0.12
0.0.10