Class RunCodeGenerators

java.lang.Object
com.google.ads.googleads.codegen.RunCodeGenerators

public class RunCodeGenerators extends 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 Details

    • RunCodeGenerators

      public RunCodeGenerators(File targetDirectory)
    • RunCodeGenerators

      public RunCodeGenerators(File targetDirectory, Set<Class<?>> annotatedClasses)
    • RunCodeGenerators

      public RunCodeGenerators(File targetDirectory, Map<com.google.ads.googleads.lib.stubs.annotations.VersionDescriptor,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 Details

    • main

      public static void main(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.