Ejemplo n.º 1
0
 public static void AddTarget(string targetPath)
 {
     using (AssemblyDefinition targetDef = AssemblyDefinition.ReadAssembly(targetPath))
     {
         foreach (AssemblyNameReference asmRefName in targetDef.MainModule.AssemblyReferences)
         {
             Console.WriteLine("Adding Reference: {0}", asmRefName.FullName);
             //Assembly.
             //AddReference(asmName);
         }
         TargetAssemblies.Add(targetPath);
     }
 }
Ejemplo n.º 2
0
        /// <inheritdoc/>
        public void Process(IConfigurationSection section, string configurationFullPath, string currentDirectory)
        {
            var targets = new TargetAssemblies();

            section.Bind(targets);
            if (targets.AspectBuilders == null || !targets.AspectBuilders.Any())
            {
                throw new ApplicationException($"Empty aspect references in {configurationFullPath}.");
            }

            if (targets.Targets == null || !targets.Targets.Any())
            {
                throw new ApplicationException($"Empty targets in {configurationFullPath}.");
            }

            var aspects   = InitializeAspects(targets.AspectBuilders, DefaultAspectAssemblyKey, targets.DefaultAdviceAssemblyKey, section, configurationFullPath);
            var sequences = InitializeSequences(targets.Order, configurationFullPath);
            var weaver    = BuildWeaver(aspects, sequences, configurationFullPath);

            Weave(weaver, targets.Targets, configurationFullPath, currentDirectory);
        }
Ejemplo n.º 3
0
        //public static void AddReference(AssemblyName refAsm)
        //{
        //    if (refAsm == null) return;
        //    ReferenceAssemblies.Add(refAsm);
        //}

        public static void ClearTargets()
        {
            TargetAssemblies.Clear();
        }