Class PojoToProtoExtension
java.lang.Object
io.github.anupambasak.gradle.plugins.pojo2proto.PojoToProtoExtension
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract org.gradle.api.file.DirectoryPropertyabstract org.gradle.api.file.ConfigurableFileCollectionDirectories or files to skip.abstract org.gradle.api.provider.Property<String> Appended to the POJO's Java package to formoption java_package: the Java classes for POJOs incom.example.dtosare generated intocom.example.dtos.proto.abstract org.gradle.api.provider.Property<String> Appended to every generated top-level message and enum name and to its file name:Address -> message AddressProtoinAddressProto.proto.abstract org.gradle.api.provider.Property<String> Proto package (and, withgetJavaPackageSuffix(), Java package) shared by all generated files.abstract org.gradle.api.provider.Property<Boolean> abstract org.gradle.api.provider.Property<Boolean> abstract org.gradle.api.file.ConfigurableFileCollectionabstract org.gradle.api.provider.Property<Boolean> Whentrue, every .proto file gets the Java package of its POJO followed bygetJavaPackageSuffix()as its protopackageandjava_package, and is written to the matching sub-directory ofdestination(com.example.dtos.Address -> <destination>/com/example/dtos/proto/AddressProto.proto).
-
Constructor Details
-
PojoToProtoExtension
public PojoToProtoExtension()
-
-
Method Details
-
getSource
public abstract org.gradle.api.file.ConfigurableFileCollection getSource() -
getExclude
public abstract org.gradle.api.file.ConfigurableFileCollection getExclude()Directories or files to skip. Any .java file under an excluded directory (or equal to an excluded file) is ignored. -
getDestination
public abstract org.gradle.api.file.DirectoryProperty getDestination() -
getSingleFile
-
getPrefixEnumNames
-
getPackageName
Proto package (and, withgetJavaPackageSuffix(), Java package) shared by all generated files. Only used with the flat layout:usePojoPackages = false, whichsingleFileimplies. Ignored whengetUsePojoPackages()istrue, where each file takes its POJO's package. Defaults to the Gradle project's group. -
getUsePojoPackages
Whentrue, every .proto file gets the Java package of its POJO followed bygetJavaPackageSuffix()as its protopackageandjava_package, and is written to the matching sub-directory ofdestination(com.example.dtos.Address -> <destination>/com/example/dtos/proto/AddressProto.proto). Imports use these paths and references across packages are fully qualified. Cannot be combined withsingleFile.Defaults to
true, orfalsewhensingleFileis enabled. Whenfalse, all files are written flat intodestinationand sharegetPackageName()as their proto package. -
getNameSuffix
Appended to every generated top-level message and enum name and to its file name:Address -> message AddressProtoinAddressProto.proto. Defaults to"Proto"; set to""for none. -
getJavaPackageSuffix
Appended to the POJO's Java package to formoption java_package: the Java classes for POJOs incom.example.dtosare generated intocom.example.dtos.proto. WithgetUsePojoPackages()it is also part of the protopackageand directory, so they matchjava_package; with the flat layout it only applies tojava_package. Defaults to".proto"; set to""for none. -
getExcludeFields
-