Exemplo n.º 1
0
        public override bool Execute()
        {
            WarnIfUneven(Tuple.Create("Prefixes", Prefixes), Tuple.Create("Suffixes", Suffixes), Tuple.Create("Outputs", Outputs));
            foreach (var tuple in Zip(Prefixes, Suffixes, Outputs))
            {
                ITaskItem prefix = tuple.Item1;
                ITaskItem suffix = tuple.Item2;
                ITaskItem output = tuple.Item3;

                DateTime prefixUpdated = prefix.GetTimestamp();
                DateTime suffixUpdated = suffix.GetTimestamp();

                Log.LogMessage(MessageImportance.High, "Appending");
                Log.LogMessage(MessageImportance.Normal, "Prefix: {0}", Path.GetFileName(prefix.ItemSpec));
                Log.LogMessage(MessageImportance.Normal, "Suffix: {0}", Path.GetFileName(suffix.ItemSpec));
                Log.LogMessage(MessageImportance.Normal, "Output: {0}", Path.GetFileName(output.ItemSpec));
                Log.LogMessage(MessageImportance.Normal, "Directory: {0}", Path.GetDirectoryName(prefix.ItemSpec));

                JoinModels.Join(
                    log: Log,
                    models: new[] { tuple.Item1, tuple.Item2 },
                    output: tuple.Item3);

                if (prefixUpdated > suffixUpdated)
                {
                    File.SetLastWriteTime(output.ItemSpec, prefixUpdated);
                }
                else
                {
                    File.SetLastWriteTime(output.ItemSpec, suffixUpdated);
                }
            }

            return(true);
        }
Exemplo n.º 2
0
 public override IObJoin AddJoin(params ObTermBase[] obTermBases)
 {
     foreach (var obTermBase in obTermBases)
     {
         JoinModels.Add(obTermBase.ModelType.ToTableName(obTermBase.ObRedefine?.Models));
     }
     return(this);
 }
Exemplo n.º 3
0
 public override IObJoin AddJoin(ObTermBase obTermBase)
 {
     JoinModels.Add(obTermBase.ModelType.ToTableName(obTermBase.ObRedefine?.Models));
     return(this);
 }
Exemplo n.º 4
0
 public ObJoin(ObTermBase obTermBase)
 {
     JoinModels.Add(obTermBase.ModelType.ToTableName(obTermBase.ObRedefine?.Models));
 }