Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 53 lines (43 sloc) 1.359 kb
8dc7dd9 refactor so that when you register a target, you provide a TargetGenerat...
Lucas Meijer authored
1 using System;
ad49f40 first pass of a big simplification. needs more cleanup
Lucas Meijer authored
2 using System.Collections.Generic;
8dc7dd9 refactor so that when you register a target, you provide a TargetGenerat...
Lucas Meijer authored
3
a4d34d6 rename the took to cake
Lucas Meijer authored
4 namespace cake
8dc7dd9 refactor so that when you register a target, you provide a TargetGenerat...
Lucas Meijer authored
5 {
9a5a4e9 more big cleanup
Lucas Meijer authored
6 public class TargetGenerateSettings
8dc7dd9 refactor so that when you register a target, you provide a TargetGenerat...
Lucas Meijer authored
7 {
1cb9518 small cleanup
Lucas Meijer authored
8 public ITargetGeneratingAction Action { get; private set; }
9 public string ActionHash { get; private set; }
ad49f40 first pass of a big simplification. needs more cleanup
Lucas Meijer authored
10 public HashSet<string> InputFiles { get; private set; }
8f0df8b and more cleanup. nice.
Lucas Meijer authored
11 public HashSet<string> OutputFiles { get; private set; }
ad49f40 first pass of a big simplification. needs more cleanup
Lucas Meijer authored
12
8f0df8b and more cleanup. nice.
Lucas Meijer authored
13 public TargetGenerateSettings(ITargetGeneratingAction action, IEnumerable<string> inputFiles, string outputFile)
14 : this(action,inputFiles, new[] {outputFile})
ad49f40 first pass of a big simplification. needs more cleanup
Lucas Meijer authored
15 {
8f0df8b and more cleanup. nice.
Lucas Meijer authored
16 }
17
18 public TargetGenerateSettings(ITargetGeneratingAction action, IEnumerable<string> inputFiles, IEnumerable<string> outputFiles)
19 {
20 OutputFiles = new HashSet<string>(outputFiles);
ad49f40 first pass of a big simplification. needs more cleanup
Lucas Meijer authored
21 Action = action;
1cb9518 small cleanup
Lucas Meijer authored
22 ActionHash = Action.GetActionHash();
9a5a4e9 more big cleanup
Lucas Meijer authored
23 InputFiles = new HashSet<string>(inputFiles);
ad49f40 first pass of a big simplification. needs more cleanup
Lucas Meijer authored
24 }
25
26 //todo: figure out how to write a sane Equals
27 public override bool Equals(object obj)
28 {
29 if (obj == null)
30 return false;
31
9a5a4e9 more big cleanup
Lucas Meijer authored
32 var other = obj as TargetGenerateSettings;
ad49f40 first pass of a big simplification. needs more cleanup
Lucas Meijer authored
33 if (other == null)
34 return false;
35
36 if (ActionHash != other.ActionHash)
37 return false;
84ea5e6 make chained dependencies work
Lucas Meijer authored
38
39 if (!other.InputFiles.SetEquals(InputFiles))
40 return false;
41
42 if (!other.OutputFiles.SetEquals(OutputFiles))
43 return false;
44
45 return true;
ad49f40 first pass of a big simplification. needs more cleanup
Lucas Meijer authored
46 }
47
48 public override int GetHashCode()
49 {
50 return (InputFiles != null ? InputFiles.GetHashCode() : 0);
51 }
8dc7dd9 refactor so that when you register a target, you provide a TargetGenerat...
Lucas Meijer authored
52 }
53 }
Something went wrong with that request. Please try again.