1 /* 2 * Copyright (C) 2015 Google Inc. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.google.caliper.runner; 18 19 import com.google.caliper.bridge.BridgeModule; 20 import com.google.caliper.config.CaliperConfig; 21 import com.google.caliper.config.ConfigModule; 22 import com.google.caliper.json.GsonModule; 23 import com.google.caliper.options.CaliperOptions; 24 import com.google.caliper.options.OptionsModule; 25 import com.google.caliper.util.OutputModule; 26 import com.google.common.util.concurrent.ServiceManager; 27 28 import dagger.Component; 29 30 import javax.inject.Singleton; 31 32 /** 33 * The main component used when running caliper. 34 */ 35 @Singleton 36 @Component(modules = { 37 BenchmarkClassModule.class, 38 BridgeModule.class, 39 ConfigModule.class, 40 ExperimentingRunnerModule.class, 41 GsonModule.class, 42 MainModule.class, 43 OptionsModule.class, 44 OutputModule.class, 45 PlatformModule.class, 46 RunnerModule.class, 47 ServiceModule.class, 48 }) 49 interface MainComponent { 50 getBenchmarkClass()51 BenchmarkClass getBenchmarkClass(); 52 getCaliperConfig()53 CaliperConfig getCaliperConfig(); 54 getCaliperOptions()55 CaliperOptions getCaliperOptions(); 56 getCaliperRun()57 CaliperRun getCaliperRun(); 58 getServiceManager()59 ServiceManager getServiceManager(); 60 newTrialComponent(TrialModule trialModule)61 TrialScopeComponent newTrialComponent(TrialModule trialModule); 62 newExperimentComponent(ExperimentModule experimentModule)63 ExperimentComponent newExperimentComponent(ExperimentModule experimentModule); 64 } 65