public abstract class GenerationTask
extends java.lang.Object
The class operates on the provided set of Protobuf files and enhances their JavaScript counterparts by generating additional code.
Modifier | Constructor and Description |
---|---|
protected |
GenerationTask(io.spine.code.fs.js.Directory generatedRoot) |
Modifier and Type | Method and Description |
---|---|
protected io.spine.code.proto.FileSet |
filter(io.spine.code.proto.FileSet fileSet)
Filters out files that should not processed by the task.
|
protected io.spine.code.fs.js.Directory |
generatedRoot()
Obtains the root of the generated Protobuf sources.
|
protected abstract void |
generateFor(io.spine.code.proto.FileSet fileSet)
Generates code for the Protobuf files.
|
void |
performFor(io.spine.code.proto.FileSet fileSet)
Generates code for the specified file set.
|
protected GenerationTask(io.spine.code.fs.js.Directory generatedRoot)
public final void performFor(io.spine.code.proto.FileSet fileSet)
fileSet
- the Protobuf files to generate code forprotected io.spine.code.proto.FileSet filter(io.spine.code.proto.FileSet fileSet)
The method filters out files that don't belong to the module.
A file is considered belonging to the module if it was compiled to JavaScript.
A .js
file is checked instead of an original .proto
file
since a module can expose Protobufs defined by other modules and these files
still should be handled.
fileSet
- the files to filterprotected abstract void generateFor(io.spine.code.proto.FileSet fileSet)
protected io.spine.code.fs.js.Directory generatedRoot()