Package de.jjohannes.maven.gmm
Class GradleModuleMetadataWriter
- java.lang.Object
-
- de.jjohannes.maven.gmm.GradleModuleMetadataWriter
-
public class GradleModuleMetadataWriter extends java.lang.ObjectThe Gradle module metadata file generator is responsible for generating a JSON file describing module metadata.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classGradleModuleMetadataWriter.Variant
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringFORMAT_VERSION
-
Constructor Summary
Constructors Constructor Description GradleModuleMetadataWriter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static java.util.Map<java.lang.String,java.lang.String>componentAttributes(org.apache.maven.project.MavenProject project)static voidgenerateTo(org.apache.maven.project.MavenProject project, java.lang.String mavenVersion, java.util.List<org.apache.maven.model.Dependency> platformDependencies, java.util.List<Capability> capabilities, java.io.Writer writer)private static booleanisNullOrEmpty(java.lang.String s)private static booleanisNullOrEmpty(java.util.List<?> l)private static booleanisSnapshot(org.apache.maven.project.MavenProject project)private static java.util.Map<java.lang.String,java.lang.String>variantAttributes(GradleModuleMetadataWriter.Variant variant)private static voidwriteArtifact(java.io.File artifact, com.google.gson.stream.JsonWriter jsonWriter)private static voidwriteArtifacts(org.apache.maven.project.MavenProject project, com.google.gson.stream.JsonWriter jsonWriter)private static voidwriteAttributes(java.util.Map<java.lang.String,java.lang.String> attributes, com.google.gson.stream.JsonWriter jsonWriter)private static voidwriteCapabilities(org.apache.maven.project.MavenProject project, java.util.List<Capability> capabilities, com.google.gson.stream.JsonWriter jsonWriter)private static voidwriteChecksums(java.io.File artifact, com.google.gson.stream.JsonWriter jsonWriter)private static voidwriteComponentWithVariants(org.apache.maven.project.MavenProject project, java.lang.String mavenVersion, java.util.List<org.apache.maven.model.Dependency> platformDependencies, java.util.List<Capability> capabilities, com.google.gson.stream.JsonWriter jsonWriter)private static voidwriteCreator(java.lang.String mavenVersion, com.google.gson.stream.JsonWriter jsonWriter)private static voidwriteDependencies(GradleModuleMetadataWriter.Variant variant, java.util.List<org.apache.maven.model.Dependency> dependencies, java.util.List<org.apache.maven.model.Dependency> platformDependencies, com.google.gson.stream.JsonWriter jsonWriter)private static voidwriteDependency(org.apache.maven.model.Dependency dependency, boolean toPlatform, com.google.gson.stream.JsonWriter jsonWriter)private static voidwriteDependencyArtifact(org.apache.maven.model.Dependency dependency, com.google.gson.stream.JsonWriter jsonWriter)private static voidwriteExcludes(java.util.List<org.apache.maven.model.Exclusion> excludes, com.google.gson.stream.JsonWriter jsonWriter)private static voidwriteFormat(com.google.gson.stream.JsonWriter jsonWriter)private static voidwriteIdentity(org.apache.maven.project.MavenProject project, com.google.gson.stream.JsonWriter jsonWriter)private static voidwriteVariant(org.apache.maven.project.MavenProject project, GradleModuleMetadataWriter.Variant variant, java.util.List<org.apache.maven.model.Dependency> platformDependencies, java.util.List<Capability> capabilities, com.google.gson.stream.JsonWriter jsonWriter)private static voidwriteVariants(org.apache.maven.project.MavenProject project, java.util.List<org.apache.maven.model.Dependency> platformDependencies, java.util.List<Capability> capabilities, com.google.gson.stream.JsonWriter jsonWriter)private static voidwriteVersionConstraint(java.lang.String version, com.google.gson.stream.JsonWriter jsonWriter)
-
-
-
Field Detail
-
FORMAT_VERSION
private static final java.lang.String FORMAT_VERSION
- See Also:
- Constant Field Values
-
-
Method Detail
-
generateTo
public static void generateTo(org.apache.maven.project.MavenProject project, java.lang.String mavenVersion, java.util.List<org.apache.maven.model.Dependency> platformDependencies, java.util.List<Capability> capabilities, java.io.Writer writer) throws java.io.IOException- Throws:
java.io.IOException
-
isSnapshot
private static boolean isSnapshot(org.apache.maven.project.MavenProject project)
-
componentAttributes
private static java.util.Map<java.lang.String,java.lang.String> componentAttributes(org.apache.maven.project.MavenProject project)
-
variantAttributes
private static java.util.Map<java.lang.String,java.lang.String> variantAttributes(GradleModuleMetadataWriter.Variant variant)
-
writeComponentWithVariants
private static void writeComponentWithVariants(org.apache.maven.project.MavenProject project, java.lang.String mavenVersion, java.util.List<org.apache.maven.model.Dependency> platformDependencies, java.util.List<Capability> capabilities, com.google.gson.stream.JsonWriter jsonWriter) throws java.io.IOException- Throws:
java.io.IOException
-
writeIdentity
private static void writeIdentity(org.apache.maven.project.MavenProject project, com.google.gson.stream.JsonWriter jsonWriter) throws java.io.IOException- Throws:
java.io.IOException
-
writeVariants
private static void writeVariants(org.apache.maven.project.MavenProject project, java.util.List<org.apache.maven.model.Dependency> platformDependencies, java.util.List<Capability> capabilities, com.google.gson.stream.JsonWriter jsonWriter) throws java.io.IOException- Throws:
java.io.IOException
-
writeCreator
private static void writeCreator(java.lang.String mavenVersion, com.google.gson.stream.JsonWriter jsonWriter) throws java.io.IOException- Throws:
java.io.IOException
-
writeFormat
private static void writeFormat(com.google.gson.stream.JsonWriter jsonWriter) throws java.io.IOException- Throws:
java.io.IOException
-
writeVariant
private static void writeVariant(org.apache.maven.project.MavenProject project, GradleModuleMetadataWriter.Variant variant, java.util.List<org.apache.maven.model.Dependency> platformDependencies, java.util.List<Capability> capabilities, com.google.gson.stream.JsonWriter jsonWriter) throws java.io.IOException- Throws:
java.io.IOException
-
writeAttributes
private static void writeAttributes(java.util.Map<java.lang.String,java.lang.String> attributes, com.google.gson.stream.JsonWriter jsonWriter) throws java.io.IOException- Throws:
java.io.IOException
-
writeArtifacts
private static void writeArtifacts(org.apache.maven.project.MavenProject project, com.google.gson.stream.JsonWriter jsonWriter) throws java.io.IOException- Throws:
java.io.IOException
-
writeArtifact
private static void writeArtifact(java.io.File artifact, com.google.gson.stream.JsonWriter jsonWriter) throws java.io.IOException- Throws:
java.io.IOException
-
writeChecksums
private static void writeChecksums(java.io.File artifact, com.google.gson.stream.JsonWriter jsonWriter) throws java.io.IOException- Throws:
java.io.IOException
-
writeDependencies
private static void writeDependencies(GradleModuleMetadataWriter.Variant variant, java.util.List<org.apache.maven.model.Dependency> dependencies, java.util.List<org.apache.maven.model.Dependency> platformDependencies, com.google.gson.stream.JsonWriter jsonWriter) throws java.io.IOException
- Throws:
java.io.IOException
-
writeDependency
private static void writeDependency(org.apache.maven.model.Dependency dependency, boolean toPlatform, com.google.gson.stream.JsonWriter jsonWriter) throws java.io.IOException- Throws:
java.io.IOException
-
writeVersionConstraint
private static void writeVersionConstraint(java.lang.String version, com.google.gson.stream.JsonWriter jsonWriter) throws java.io.IOException- Throws:
java.io.IOException
-
writeDependencyArtifact
private static void writeDependencyArtifact(org.apache.maven.model.Dependency dependency, com.google.gson.stream.JsonWriter jsonWriter) throws java.io.IOException- Throws:
java.io.IOException
-
writeExcludes
private static void writeExcludes(java.util.List<org.apache.maven.model.Exclusion> excludes, com.google.gson.stream.JsonWriter jsonWriter) throws java.io.IOException- Throws:
java.io.IOException
-
writeCapabilities
private static void writeCapabilities(org.apache.maven.project.MavenProject project, java.util.List<Capability> capabilities, com.google.gson.stream.JsonWriter jsonWriter) throws java.io.IOException- Throws:
java.io.IOException
-
isNullOrEmpty
private static boolean isNullOrEmpty(java.lang.String s)
-
isNullOrEmpty
private static boolean isNullOrEmpty(java.util.List<?> l)
-
-