source: trunk/sources/HeuristicLab/3.3/Tests/PluginLoader.cs @ 4490

Last change on this file since 4490 was 4490, checked in by mkommend, 9 years ago

Created PluginDependenciesTest and corrected all projects (ticket #1202).

File size: 6.1 KB
Line 
1
2using System;
3using System.Collections.Generic;
4using System.IO;
5using System.Linq;
6using System.Reflection;
7using HeuristicLab.PluginInfrastructure;
8
9namespace HeuristicLab_3._3.Tests {
10  internal static class PluginLoader {
11    public const string AssemblyExtension = ".dll";
12    public static List<Assembly> pluginAssemblies;
13
14    static PluginLoader() {
15      foreach (string path in Directory.EnumerateFiles(AppDomain.CurrentDomain.BaseDirectory)
16        .Where(s => s.EndsWith(AssemblyExtension)))
17        Assembly.LoadFrom(path);
18
19      pluginAssemblies = AppDomain.CurrentDomain.GetAssemblies().Where(IsPluginAssembly).ToList();
20    }
21
22    private static bool IsPluginAssembly(Assembly assembly) {
23      return assembly.GetExportedTypes()
24        .Where(t => typeof(IPlugin).IsAssignableFrom(t) && !t.IsAbstract && !t.IsInterface).Any();
25    }
26
27
28    //public static void LoadPluginsIntoAppDomain() {
29    //  new HeuristicLab.Algorithms.DataAnalysis.HeuristicLabAlgorithmsDataAnalysisPlugin();
30    //  new HeuristicLab.Algorithms.EvolutionStrategy.HeuristicLabAlgorithmsEvolutionStrategyPlugin();
31    //  new HeuristicLab.Algorithms.GeneticAlgorithm.HeuristicLabAlgorithmsGeneticAlgorithmPlugin();
32    //  new HeuristicLab.Algorithms.LocalSearch.HeuristicLabAlgorithmsLocalSearchPlugin();
33    //  new HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm.HeuristicLabAlgorithmsOffspringSelectionGeneticAlgorithmPlugin();
34    //  new HeuristicLab.Algorithms.SimulatedAnnealing.HeuristicLabAlgorithmsSimulatedAnnealingPlugin();
35    //  new HeuristicLab.Algorithms.TabuSearch.HeuristicLabAlgorithmsTabuSearchPlugin();
36
37    //  new HeuristicLab.Analysis.HeuristicLabAnalysisPlugin();
38    //  new HeuristicLab.Analysis.Views.HeuristicLabAnalysisViewsPlugin();
39
40    //  new HeuristicLab.Clients.Common.HeuristicLabClientsCommonPlugin();
41    //  new HeuristicLab.CodeEditor.HeuristicLabCodeEditorPlugin();
42    //  new HeuristicLab.Collections.HeuristicLabCollectionsPlugin();
43
44    //  new HeuristicLab.Common.HeuristicLabCommonPlugin();
45    //  new HeuristicLab.Common.Resources.HeuristicLabCommonResourcesPlugin();
46
47    //  new HeuristicLab.Core.HeuristicLabCorePlugin();
48    //  new HeuristicLab.Core.Views.HeuristicLabCoreViewsPlugin();
49
50    //  new HeuristicLab.Data.HeuristicLabDataPlugin();
51    //  new HeuristicLab.Data.Views.HeuristicLabDataViewsPlugin();
52
53    //  new HeuristicLab.Encodings.BinaryVectorEncoding.HeuristicLabEncodingsBinaryVectorEncodingPlugin();
54    //  new HeuristicLab.Encodings.IntegerVectorEncoding.HeuristicLabEncodingsIntegerVectorEncodingPlugin();
55    //  new HeuristicLab.Encodings.PermutationEncoding.HeuristicLabEncodingsPermutationEncodingPlugin();
56    //  new HeuristicLab.Encodings.PermutationEncoding.Views.HeuristicLabEncodingsPermutationEncodingViewsPlugin();
57    //  new HeuristicLab.Encodings.RealVectorEncoding.HeuristicLabEncodingsRealVectorEncodingPlugin();
58    //  new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.HeuristicLabEncodingsSymbolicExpressionTreeEncodingPlugin();
59    //  new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.HeuristicLabEncodingsSymbolicExpressionTreeEncodingViewsPlugin();
60
61    //  new HeuristicLab.MainForm.HeuristicLabMainFormPlugin();
62    //  new HeuristicLab.MainForm.WindowsForms.HeuristicLabMainFormPlugin();
63
64    //  new HeuristicLab.Operators.HeuristicLabOperatorsPlugin();
65    //  new HeuristicLab.Operators.Programmable.HeuristicLabOperatorsProgrammablePlugin();
66    //  new HeuristicLab.Operators.Views.HeuristicLabOperatorsViewsPlugin();
67    //  new HeuristicLab.Operators.Views.GraphVisualization.HeuristicLabOperatorsViewsGraphVisualizationPlugin();
68
69    //  new HeuristicLab.Parameters.HeuristicLabParametersPlugin();
70    //  new HeuristicLab.Parameters.Views.HeuristicLabParametersViewsPlugin();
71
72    //  new HeuristicLab.Persistence.HeuristicLabPersistencePlugin();
73    //  new HeuristicLab.Persistence.GUI.HeuristicLabPersistenceGUIPlugin();
74
75    //  new HeuristicLab.Problems.ArtificialAnt.HeuristicLabProblemsArtificialAntPlugin();
76    //  new HeuristicLab.Problems.ArtificialAnt.Views.HeuristicLabProblemsArtificialAntViewsPlugin();
77    //  new HeuristicLab.Problems.DataAnalysis.HeuristicLabProblemsDataAnalysisPlugin();
78    //  new HeuristicLab.Problems.DataAnalysis.Regression.HeuristicLabProblemsDataAnalysisRegressionPlugin();
79    //  new HeuristicLab.Problems.DataAnalysis.Views.HeuristicLabProblemsDataAnalysisViewsPlugin();
80    //  new HeuristicLab.Problems.ExternalEvaluation.HeuristicLabProblemsExternalEvaluationPlugin();
81    //  new HeuristicLab.Problems.ExternalEvaluation.GP.HeuristicLabProblemsExternalEvaluationGPPlugin();
82    //  new HeuristicLab.Problems.ExternalEvaluation.GP.Views.HeuristicLabProblemsExternalEvaluationGPViewsPlugin();
83    //  new HeuristicLab.Problems.ExternalEvaluation.Views.HeuristicLabProblemsExternalEvaluationViewsPlugin();
84    //  new HeuristicLab.Problems.Knapsack.HeuristicLabProblemsKnapsackPlugin();
85    //  new HeuristicLab.Problems.Knapsack.Views.HeuristicLabProblemsKnapsackViewsPlugin();
86    //  new HeuristicLab.Problems.OneMax.HeuristicLabProblemsOneMaxPlugin();
87    //  new HeuristicLab.Problems.OneMax.Views.HeuristicLabProblemsKnapsackViewsPlugin();
88    //  new HeuristicLab.Problems.TestFunctions.HeuristicLabProblemsTestFunctionsPlugin();
89    //  new HeuristicLab.Problems.TestFunctions.Views.HeuristicLabProblemsTestFunctionsViewsPlugin();
90    //  new HeuristicLab.Problems.TravelingSalesman.HeuristicLabProblemsTravelingSalesmanPlugin();
91    //  new HeuristicLab.Problems.TravelingSalesman.Views.HeuristicLabProblemsTravelingSalesmanViewsPlugin();
92    //  new HeuristicLab.Problems.VehicleRouting.HeuristicLabProblemsVehicleRoutingPlugin();
93    //  new HeuristicLab.Problems.VehicleRouting.Views.HeuristicLabProblemsVehicleRoutingViewsPlugin();
94
95    //  new HeuristicLab.Random.HeuristicLabRandomPlugin();
96    //  new HeuristicLab.Selection.HeuristicLabSelectionPlugin();
97    //  new HeuristicLab.SequentialEngine.HeuristicLabSequentialEnginePlugin();
98    //  new HeuristicLab.Tracing.HeuristicLabPersistencePlugin();
99    //}
100  }
101}
Note: See TracBrowser for help on using the repository browser.