MCPcopy Create free account
hub / github.com/diffplug/goomph / mirrorApp

Method mirrorApp

src/main/java/com/diffplug/gradle/p2/P2Model.java:251–277  ·  view source on GitHub ↗

Creates a p2.mirror ant task file which will mirror the model's described IU's and repos into the given destination folder. @see P2AntRunner

(File dstFolder)

Source from the content-addressed store, hash-verified

249 * @see P2AntRunner
250 */
251 @SuppressWarnings("unchecked")
252 public P2AntRunner mirrorApp(File dstFolder) {
253 return performWithoutMissingBundlePool(() -> {
254 return P2AntRunner.create("p2.mirror", taskNode -> {
255 sourceNode(taskNode);
256 Node destination = new Node(taskNode, "destination");
257 destination.attributes().put("location", FileMisc.asUrl(dstFolder));
258 destination.attributes().put("append", append);
259
260 for (String iu : ius) {
261 Node iuNode = new Node(taskNode, "iu");
262
263 int slash = iu.indexOf('/');
264 if (slash == -1) {
265 iuNode.attributes().put("id", iu);
266 } else {
267 iuNode.attributes().put("id", iu.substring(0, slash));
268 iuNode.attributes().put("version", iu.substring(slash + 1));
269 }
270 }
271
272 if (slicingOptions.size() > 0) {
273 slicingOptionsNode(taskNode);
274 }
275 });
276 });
277 }
278
279 /** Creates an XML node representing all the repos in this model. */
280 private Node sourceNode(Node parent) {

Callers 6

mainMethod · 0.95
getAppMethod · 0.95
testMirrorAntFileMethod · 0.80

Calls 6

createMethod · 0.95
sourceNodeMethod · 0.95
asUrlMethod · 0.95
slicingOptionsNodeMethod · 0.95
indexOfMethod · 0.80

Tested by 5

mainMethod · 0.76
testMirrorAntFileMethod · 0.64