Package de.jjohannes.maven.gmm
Class GradleModuleMetadataWriter
java.lang.Object
de.jjohannes.maven.gmm.GradleModuleMetadataWriter
The Gradle module metadata file generator is responsible for generating a JSON file describing module metadata.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncomponentAttributes
(org.apache.maven.project.MavenProject project) static void
generateTo
(org.apache.maven.project.MavenProject project, String mavenVersion, List<org.apache.maven.model.Dependency> platformDependencies, List<Capability> capabilities, Writer writer) private static boolean
private static boolean
isNullOrEmpty
(List<?> l) private static boolean
isSnapshot
(org.apache.maven.project.MavenProject project) private static void
writeArtifact
(File artifact, com.google.gson.stream.JsonWriter jsonWriter) private static void
writeArtifacts
(org.apache.maven.project.MavenProject project, com.google.gson.stream.JsonWriter jsonWriter) private static void
writeAttributes
(Map<String, String> attributes, com.google.gson.stream.JsonWriter jsonWriter) private static void
writeCapabilities
(org.apache.maven.project.MavenProject project, List<Capability> capabilities, com.google.gson.stream.JsonWriter jsonWriter) private static void
writeChecksums
(File artifact, com.google.gson.stream.JsonWriter jsonWriter) private static void
writeComponentWithVariants
(org.apache.maven.project.MavenProject project, String mavenVersion, List<org.apache.maven.model.Dependency> platformDependencies, List<Capability> capabilities, com.google.gson.stream.JsonWriter jsonWriter) private static void
writeCreator
(String mavenVersion, com.google.gson.stream.JsonWriter jsonWriter) private static void
writeDependencies
(GradleModuleMetadataWriter.Variant variant, List<org.apache.maven.model.Dependency> dependencies, List<org.apache.maven.model.Dependency> platformDependencies, com.google.gson.stream.JsonWriter jsonWriter) private static void
writeDependency
(org.apache.maven.model.Dependency dependency, boolean toPlatform, com.google.gson.stream.JsonWriter jsonWriter) private static void
writeDependencyArtifact
(org.apache.maven.model.Dependency dependency, com.google.gson.stream.JsonWriter jsonWriter) private static void
writeExcludes
(List<org.apache.maven.model.Exclusion> excludes, com.google.gson.stream.JsonWriter jsonWriter) private static void
writeFormat
(com.google.gson.stream.JsonWriter jsonWriter) private static void
writeIdentity
(org.apache.maven.project.MavenProject project, com.google.gson.stream.JsonWriter jsonWriter) private static void
writeVariant
(org.apache.maven.project.MavenProject project, GradleModuleMetadataWriter.Variant variant, List<org.apache.maven.model.Dependency> platformDependencies, List<Capability> capabilities, com.google.gson.stream.JsonWriter jsonWriter) private static void
writeVariants
(org.apache.maven.project.MavenProject project, List<org.apache.maven.model.Dependency> platformDependencies, List<Capability> capabilities, com.google.gson.stream.JsonWriter jsonWriter) private static void
writeVersionConstraint
(String version, com.google.gson.stream.JsonWriter jsonWriter)
-
Field Details
-
FORMAT_VERSION
- See Also:
-
-
Constructor Details
-
GradleModuleMetadataWriter
public GradleModuleMetadataWriter()
-
-
Method Details
-
generateTo
public static void generateTo(org.apache.maven.project.MavenProject project, String mavenVersion, List<org.apache.maven.model.Dependency> platformDependencies, List<Capability> capabilities, Writer writer) throws IOException - Throws:
IOException
-
isSnapshot
private static boolean isSnapshot(org.apache.maven.project.MavenProject project) -
componentAttributes
-
variantAttributes
-
writeComponentWithVariants
private static void writeComponentWithVariants(org.apache.maven.project.MavenProject project, String mavenVersion, List<org.apache.maven.model.Dependency> platformDependencies, List<Capability> capabilities, com.google.gson.stream.JsonWriter jsonWriter) throws IOException - Throws:
IOException
-
writeIdentity
private static void writeIdentity(org.apache.maven.project.MavenProject project, com.google.gson.stream.JsonWriter jsonWriter) throws IOException - Throws:
IOException
-
writeVariants
private static void writeVariants(org.apache.maven.project.MavenProject project, List<org.apache.maven.model.Dependency> platformDependencies, List<Capability> capabilities, com.google.gson.stream.JsonWriter jsonWriter) throws IOException - Throws:
IOException
-
writeCreator
private static void writeCreator(String mavenVersion, com.google.gson.stream.JsonWriter jsonWriter) throws IOException - Throws:
IOException
-
writeFormat
- Throws:
IOException
-
writeVariant
private static void writeVariant(org.apache.maven.project.MavenProject project, GradleModuleMetadataWriter.Variant variant, List<org.apache.maven.model.Dependency> platformDependencies, List<Capability> capabilities, com.google.gson.stream.JsonWriter jsonWriter) throws IOException - Throws:
IOException
-
writeAttributes
private static void writeAttributes(Map<String, String> attributes, com.google.gson.stream.JsonWriter jsonWriter) throws IOException- Throws:
IOException
-
writeArtifacts
private static void writeArtifacts(org.apache.maven.project.MavenProject project, com.google.gson.stream.JsonWriter jsonWriter) throws IOException - Throws:
IOException
-
writeArtifact
private static void writeArtifact(File artifact, com.google.gson.stream.JsonWriter jsonWriter) throws IOException - Throws:
IOException
-
writeChecksums
private static void writeChecksums(File artifact, com.google.gson.stream.JsonWriter jsonWriter) throws IOException - Throws:
IOException
-
writeDependencies
private static void writeDependencies(GradleModuleMetadataWriter.Variant variant, List<org.apache.maven.model.Dependency> dependencies, List<org.apache.maven.model.Dependency> platformDependencies, com.google.gson.stream.JsonWriter jsonWriter) throws IOException - Throws:
IOException
-
writeDependency
private static void writeDependency(org.apache.maven.model.Dependency dependency, boolean toPlatform, com.google.gson.stream.JsonWriter jsonWriter) throws IOException - Throws:
IOException
-
writeVersionConstraint
private static void writeVersionConstraint(String version, com.google.gson.stream.JsonWriter jsonWriter) throws IOException - Throws:
IOException
-
writeDependencyArtifact
private static void writeDependencyArtifact(org.apache.maven.model.Dependency dependency, com.google.gson.stream.JsonWriter jsonWriter) throws IOException - Throws:
IOException
-
writeExcludes
private static void writeExcludes(List<org.apache.maven.model.Exclusion> excludes, com.google.gson.stream.JsonWriter jsonWriter) throws IOException - Throws:
IOException
-
writeCapabilities
private static void writeCapabilities(org.apache.maven.project.MavenProject project, List<Capability> capabilities, com.google.gson.stream.JsonWriter jsonWriter) throws IOException - Throws:
IOException
-
isNullOrEmpty
-
isNullOrEmpty
-