Class RunCodeGenerators


  • public class RunCodeGenerators
    extends java.lang.Object
    Generates various classes which require knowing the available Google Ads API major versions.

    This cannot run as an annotation processor, since we need to know all the available versions. An annotation processor only has access to the annotations from the current compilation step, which in the case of a multi-module build, is only the sources from that module. So we would only be able to detect a single version at a time.

    • Constructor Summary

      Constructors 
      Constructor Description
      RunCodeGenerators​(java.io.File targetDirectory)  
      RunCodeGenerators​(java.io.File targetDirectory, java.util.Map<com.google.ads.googleads.lib.stubs.annotations.VersionDescriptor,​java.lang.Class<?>> versionDescriptors)
      Creates a new instance.
      RunCodeGenerators​(java.io.File targetDirectory, java.util.Set<java.lang.Class<?>> annotatedClasses)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(java.lang.String[] args)
      Defines the main entry point to run the code generators.
      void runAll()
      Runs the code generators.
      • Methods inherited from class java.lang.Object

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

      • RunCodeGenerators

        public RunCodeGenerators​(java.io.File targetDirectory)
      • RunCodeGenerators

        public RunCodeGenerators​(java.io.File targetDirectory,
                                 java.util.Set<java.lang.Class<?>> annotatedClasses)
      • RunCodeGenerators

        public RunCodeGenerators​(java.io.File targetDirectory,
                                 java.util.Map<com.google.ads.googleads.lib.stubs.annotations.VersionDescriptor,​java.lang.Class<?>> versionDescriptors)
        Creates a new instance.
        Parameters:
        targetDirectory - directory to contain the generated code.
        versionDescriptors - defines the mapping from VersionDescriptor to its declaring class.
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
        Defines the main entry point to run the code generators. This is invoked from gradle.

        Requires a single argument, the output directory in which to write generated code.

      • runAll

        public void runAll()
        Runs the code generators.