public class Extension
extends io.spine.tools.gradle.GradleExtension
ProtoJsPlugin
which allows to obtain the generateJsonParsers
task to configure when it will be executed during the build lifecycle.Modifier and Type | Field and Description |
---|---|
java.lang.String |
mainDescriptorSetPath
The absolute path to the main Protobuf descriptor set file.
|
java.lang.String |
mainGenProtoDir
The absolute path to the main Protobufs compiled to JavaScript.
|
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
modules
Names of JavaScript modules and directories they provide.
|
java.lang.String |
testDescriptorSetPath
The absolute path to the test Protobuf descriptor set file.
|
java.lang.String |
testGenProtoDir
The absolute path to the test Protobufs compiled to JavaScript.
|
Constructor and Description |
---|
Extension() |
Modifier and Type | Method and Description |
---|---|
protected io.spine.code.fs.DefaultProject |
defaultProject(org.gradle.api.Project project) |
org.gradle.api.Task |
generateParsersTask()
Returns the
generateJsonParsers task configured by the ProtoJsPlugin . |
static java.io.File |
getMainDescriptorSet(org.gradle.api.Project project) |
static io.spine.code.fs.js.Directory |
getMainGenProto(org.gradle.api.Project project) |
static java.io.File |
getTestDescriptorSet(org.gradle.api.Project project) |
static io.spine.code.fs.js.Directory |
getTestGenProtoDir(org.gradle.api.Project project) |
static java.util.List<io.spine.tools.code.structure.ExternalModule> |
modules(org.gradle.api.Project project) |
public java.lang.String mainDescriptorSetPath
public java.lang.String testDescriptorSetPath
public java.lang.String mainGenProtoDir
public java.lang.String testGenProtoDir
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> modules
Information about modules is used to resolve imports in generated Protobuf files.
Additionally to modules specified via the property, the predefined Spine modules are used.
An example of the definition:
modules = [
// The module provides `company/client` directory (not including subdirectories).
// So, an import path like {@code ../company/client/file.js}
// becomes {@code client/company/client/file.js}.
'client' : ['company/client'],
// The module provides `company/server` directory (including subdirectories).
// So, an import path like {@code ../company/server/nested/file.js}
// becomes {@code server/company/server/nested/file.js}.
'server' : ['company/server/*'],
// The module provides 'proto/company` directory.
// So, an import pah like {@code ../company/file.js}
// becomes {@code common-types/proto/company/file.js}.
'common-types' : ['proto/company']
]
public static io.spine.code.fs.js.Directory getMainGenProto(org.gradle.api.Project project)
public static io.spine.code.fs.js.Directory getTestGenProtoDir(org.gradle.api.Project project)
public static java.io.File getMainDescriptorSet(org.gradle.api.Project project)
public static java.io.File getTestDescriptorSet(org.gradle.api.Project project)
public static java.util.List<io.spine.tools.code.structure.ExternalModule> modules(org.gradle.api.Project project)
public org.gradle.api.Task generateParsersTask()
generateJsonParsers
task configured by the ProtoJsPlugin
.protected io.spine.code.fs.DefaultProject defaultProject(org.gradle.api.Project project)
defaultProject
in class io.spine.tools.gradle.GradleExtension