Package dev.gmitch215.bytebox.gradle
Class ByteboxPlugin
java.lang.Object
dev.gmitch215.bytebox.gradle.ByteboxPlugin
- All Implemented Interfaces:
org.gradle.api.Plugin<org.gradle.api.Project>
Compiles a Java workspace into a Cloudflare Worker.
Applying this plugin registers the bytebox { } block and a pipeline that ends in a
deployable Worker:
generateNpmBindingswrites Java for the npm packages a project names, read from their TypeScript types.generateEntryPointwrites the class the module exports its handlers from, deriving which handlers from the interfaces the handler class implements.generateCodecswrites a JSON codec for every type annotated@JSONType.compileWasmruns the compiler, which is TeaVM's own task.packWasmputs the module where the Worker imports it, and enforces the size budget.generateWorkerScaffoldwrites the Wrangler configuration, the JavaScript entry point and the package manifest.buildWorkerdepends on all of it.
Everything up to and including buildWorker runs with no Cloudflare credentials. Only the
commands that reach the account need a login, and each says so.
- Since:
- 1.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMegabytes of linear memory the interop stages arrays through, which cannot be zero.static final StringThe source set the generated entry point and codecs are compiled in.static final StringThe task group every task this plugin registers belongs to.static final StringThe Java package generated npm bindings live in.static final StringWhere the generated Worker project is written, under the build directory. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
GROUP
The task group every task this plugin registers belongs to.- See Also:
-
WORKER_DIRECTORY
Where the generated Worker project is written, under the build directory.- See Also:
-
GENERATED_SOURCE_SET
The source set the generated entry point and codecs are compiled in.- See Also:
-
NPM_PACKAGE
The Java package generated npm bindings live in.- See Also:
-
BUFFER_HEAP_MEGABYTES
public static final int BUFFER_HEAP_MEGABYTESMegabytes of linear memory the interop stages arrays through, which cannot be zero.TeaVM's own default is two. One is enough for the staging buffer, which is four kilobytes, and the heap grows from there when a program needs more.
- See Also:
-
-
Constructor Details
-
ByteboxPlugin
public ByteboxPlugin()
-
-
Method Details
-
apply
public void apply(org.gradle.api.Project project) - Specified by:
applyin interfaceorg.gradle.api.Plugin<org.gradle.api.Project>
-