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)
| 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) { |