Exemple #1
0
 private static BuildTarget CreateTarget(MethodInfo m, TargetAttribute attr)
 {
     return(new BuildTarget(
                attr.Name ?? m.Name,
                $"{m.DeclaringType.FullName}.{m.Name}",
                attr.Dependencies,
                (Func <BuildTargetContext, BuildTargetResult>)m.CreateDelegate(typeof(Func <BuildTargetContext, BuildTargetResult>))));
 }
Exemple #2
0
        private static BuildTarget CreateTarget(
            MethodInfo methodInfo,
            TargetAttribute targetAttribute,
            IEnumerable <TargetConditionAttribute> targetConditionAttributes)
        {
            var name = targetAttribute.Name ?? methodInfo.Name;

            var conditions = ExtractTargetConditionsFromAttributes(targetConditionAttributes);

            return(new BuildTarget(
                       name,
                       $"{methodInfo.DeclaringType.FullName}.{methodInfo.Name}",
                       targetAttribute.Dependencies,
                       conditions,
                       (Func <BuildTargetContext, BuildTargetResult>)methodInfo.CreateDelegate(typeof(Func <BuildTargetContext, BuildTargetResult>))));
        }