Class GradleModuleMetadataWriter


  • public class GradleModuleMetadataWriter
    extends java.lang.Object
    The Gradle module metadata file generator is responsible for generating a JSON file describing module metadata.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String FORMAT_VERSION  
    • 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 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)  
      private static boolean isNullOrEmpty​(java.lang.String s)  
      private static boolean isNullOrEmpty​(java.util.List<?> l)  
      private static boolean isSnapshot​(org.apache.maven.project.MavenProject project)  
      private static java.util.Map<java.lang.String,​java.lang.String> variantAttributes​(GradleModuleMetadataWriter.Variant variant)  
      private static void writeArtifact​(java.io.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​(java.util.Map<java.lang.String,​java.lang.String> attributes, com.google.gson.stream.JsonWriter jsonWriter)  
      private static void writeCapabilities​(org.apache.maven.project.MavenProject project, java.util.List<Capability> capabilities, com.google.gson.stream.JsonWriter jsonWriter)  
      private static void writeChecksums​(java.io.File artifact, com.google.gson.stream.JsonWriter jsonWriter)  
      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)  
      private static void writeCreator​(java.lang.String mavenVersion, com.google.gson.stream.JsonWriter jsonWriter)  
      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)  
      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​(java.util.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, java.util.List<org.apache.maven.model.Dependency> platformDependencies, java.util.List<Capability> capabilities, com.google.gson.stream.JsonWriter jsonWriter)  
      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)  
      private static void writeVersionConstraint​(java.lang.String version, com.google.gson.stream.JsonWriter jsonWriter)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

    • Constructor Detail

      • GradleModuleMetadataWriter

        public GradleModuleMetadataWriter()
    • 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)
      • 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)