Lines 46-51
Link Here
|
46 |
|
46 |
|
47 |
import java.io.File; |
47 |
import java.io.File; |
48 |
import java.io.IOException; |
48 |
import java.io.IOException; |
|
|
49 |
import java.util.Arrays; |
49 |
import java.util.Map; |
50 |
import java.util.Map; |
50 |
import org.apache.tools.ant.module.AntModule; |
51 |
import org.apache.tools.ant.module.AntModule; |
51 |
import org.apache.tools.ant.module.api.AntProjectCookie; |
52 |
import org.apache.tools.ant.module.api.AntProjectCookie; |
Lines 62-68
Link Here
|
62 |
* Records the last Ant target(s) that was executed. |
63 |
* Records the last Ant target(s) that was executed. |
63 |
* @author Jesse Glick |
64 |
* @author Jesse Glick |
64 |
*/ |
65 |
*/ |
65 |
public class LastTargetExecuted implements BuildExecutionSupport.Item { |
66 |
public class LastTargetExecuted implements BuildExecutionSupport.ActionItem { |
66 |
|
67 |
|
67 |
private LastTargetExecuted() {} |
68 |
private LastTargetExecuted() {} |
68 |
|
69 |
|
Lines 152-155
Link Here
|
152 |
} |
153 |
} |
153 |
} |
154 |
} |
154 |
|
155 |
|
|
|
156 |
@Override |
157 |
public String getAction() { |
158 |
String p = properties != null ? properties.get("nb.internal.action.name") : null; |
159 |
return p != null ? p : "xxx-custom"; |
155 |
} |
160 |
} |
|
|
161 |
|
162 |
@Override |
163 |
public FileObject getProjectDirectory() { |
164 |
return FileUtil.toFileObject(buildScript.getParentFile()); |
165 |
} |
166 |
|
167 |
|
168 |
//equals + hashcode handle duplicates in history list |
169 |
@Override |
170 |
public int hashCode() { |
171 |
int hash = 7; |
172 |
hash = 71 * hash + (this.buildScript != null ? this.buildScript.hashCode() : 0); |
173 |
hash = 71 * hash + Arrays.deepHashCode(this.targets); |
174 |
hash = 71 * hash + getAction().hashCode(); |
175 |
return hash; |
176 |
} |
177 |
|
178 |
@Override |
179 |
public boolean equals(Object obj) { |
180 |
if (obj == null) { |
181 |
return false; |
182 |
} |
183 |
if (getClass() != obj.getClass()) { |
184 |
return false; |
185 |
} |
186 |
final LastTargetExecuted other = (LastTargetExecuted) obj; |
187 |
if (this.buildScript != other.buildScript && (this.buildScript == null || !this.buildScript.equals(other.buildScript))) { |
188 |
return false; |
189 |
} |
190 |
if (!Arrays.deepEquals(this.targets, other.targets)) { |
191 |
return false; |
192 |
} |
193 |
return getAction().equals(other.getAction()); |
194 |
} |
195 |
|
196 |
|
197 |
} |