private static void generateInjectorForTopDownAnalyzerForJs() throws IOException {
   DependencyInjectorGenerator generator = new DependencyInjectorGenerator(false);
   generateInjectorForTopDownAnalyzerCommon(generator);
   generator.addParameter(ModuleConfiguration.class);
   generator.generate(
       "js/js.translator/src", "org.jetbrains.jet.di", "InjectorForTopDownAnalyzerForJs");
 }
 private static void generateInjectorForTopDownAnalyzerBasic() throws IOException {
   DependencyInjectorGenerator generator = new DependencyInjectorGenerator(false);
   generateInjectorForTopDownAnalyzerCommon(generator);
   generator.addParameter(ModuleConfiguration.class);
   generator.generate(
       "compiler/frontend/src", "org.jetbrains.jet.di", "InjectorForTopDownAnalyzerBasic");
 }
 private static void generateInjectorForTopDownAnalyzerForJvm() throws IOException {
   DependencyInjectorGenerator generator = new DependencyInjectorGenerator(false);
   generateInjectorForTopDownAnalyzerCommon(generator);
   generator.addPublicField(JavaBridgeConfiguration.class);
   generator.addField(PsiClassFinderForJvm.class);
   generator.generate(
       "compiler/frontend.java/src", "org.jetbrains.jet.di", "InjectorForTopDownAnalyzerForJvm");
 }
  private static void generateInjectorForJavaSemanticServices() throws IOException {
    DependencyInjectorGenerator generator = new DependencyInjectorGenerator(false);

    // Fields
    generator.addPublicField(JavaSemanticServices.class);
    generator.addPublicField(JavaDescriptorResolver.class);
    generator.addField(
        true,
        BindingTrace.class,
        null,
        new GivenExpression("new org.jetbrains.jet.lang.resolve.BindingTraceContext()"));
    generator.addField(JavaBridgeConfiguration.class);
    generator.addPublicField(PsiClassFinderForJvm.class);
    generator.addField(
        false,
        ModuleDescriptor.class,
        null,
        new GivenExpression(
            "new org.jetbrains.jet.lang.descriptors.ModuleDescriptor(\"<dummy>\")"));

    // Parameters
    generator.addPublicParameter(Project.class);

    generator.generate(
        "compiler/frontend.java/src", "org.jetbrains.jet.di", "InjectorForJavaSemanticServices");
  }
  private static void generateMacroInjector() throws IOException {
    DependencyInjectorGenerator generator = new DependencyInjectorGenerator(false);

    // Fields
    generator.addPublicField(ExpressionTypingServices.class);

    // Parameters
    generator.addPublicParameter(Project.class);

    generator.generate("compiler/frontend/src", "org.jetbrains.jet.di", "InjectorForMacros");
  }
  private static void generateInjectorForTopDownAnalyzerCommon(
      DependencyInjectorGenerator generator) {
    // Fields
    generator.addPublicField(TopDownAnalyzer.class);
    generator.addPublicField(TopDownAnalysisContext.class);
    generator.addPublicField(BodyResolver.class);
    generator.addPublicField(ControlFlowAnalyzer.class);
    generator.addPublicField(DeclarationsChecker.class);
    generator.addPublicField(DescriptorResolver.class);

    // Parameters
    generator.addPublicParameter(Project.class);
    generator.addPublicParameter(TopDownAnalysisParameters.class);
    generator.addPublicParameter(ObservableBindingTrace.class);
    generator.addParameter(ModuleDescriptor.class);
    generator.addParameter(JetControlFlowDataTraceFactory.class, false);
  }
 private static void generateInjectorForJvmCodegen() throws IOException {
   DependencyInjectorGenerator generator = new DependencyInjectorGenerator(false);
   generator.addPublicParameter(JetStandardLibrary.class);
   generator.addParameter(BindingContext.class);
   generator.addParameter(DiType.listOf(JetFile.class));
   generator.addParameter(Project.class);
   generator.addPublicField(JetTypeMapper.class);
   generator.addField(true, IntrinsicMethods.class, "intrinsics", null);
   generator.generate("compiler/backend/src", "org.jetbrains.jet.di", "InjectorForJvmCodegen");
 }
  private static void generateTestInjector() throws IOException {
    DependencyInjectorGenerator generator = new DependencyInjectorGenerator(false);

    // Fields
    generator.addPublicField(DescriptorResolver.class);
    generator.addPublicField(ExpressionTypingServices.class);
    generator.addPublicField(TypeResolver.class);
    generator.addPublicField(CallResolver.class);
    generator.addField(
        true,
        JetStandardLibrary.class,
        null,
        new GivenExpression("JetStandardLibrary.getInstance()"));

    // Parameters
    generator.addPublicParameter(Project.class);

    generator.generate("compiler/tests", "org.jetbrains.jet.di", "InjectorForTests");
  }