Skip to main content
summaryrefslogtreecommitdiffstats
blob: bf71e4097f762c37e1b5496731753afe5d95e7f2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright (c) 2015 IBM Corporation and others.

  This program and the accompanying materials
  are made available under the terms of the Eclipse Public License 2.0
  which accompanies this distribution, and is available at
  https://www.eclipse.org/legal/epl-2.0/

  SPDX-License-Identifier: EPL-2.0

  Contributors:
  David Williams - initial API and implementation
-->

<project
  default="updateGenericComposites"
  basedir=".">

  <!--
    updateGenericComposites is a utilty to use once a year or so,
    when ever a new release is started.
    It must be ran from "antRunner appliction"

  -->
  <target name="updateGenericComposites">

    <fail
      unless="currentStream"
      message="currentStream (such as '4.13') must be defined for this script" />
    <fail
      unless="maintenanceStream"
      message="maintenanceStream (such as '4.12') must be defined for this script" />

    <!-- Note: we do not put stream number in 'name', since once a 'name' is defined
         in Eclipse's UI, it does not change. -->
    <updatecomposite
      repotocreate="/home/data/httpd/download.eclipse.org/eclipse/updates/I-builds"
      repotopointto="https://download.eclipse.org/eclipse/updates/${currentStream}-I-builds/"
      reponame="Eclipse Project current integration builds repository" />
    <updatecomposite
      repotocreate="/home/data/httpd/download.eclipse.org/eclipse/updates/milestones"
      repotopointto="https://download.eclipse.org/eclipse/updates/${currentStream}milestones/"       
      reponame="Eclipse Project current milestone builds repository" />

  </target>

  <!--
    macro to create a "generic" composite site, that simply points to
    annohter repository.

    repoToCreate must be an absolute file path directory,
    that is writeable.

    repoToPointTo can be any repo, but must be in "full form", such as
    http://download.eclipse.org/eclipse/updates/${currentStream}milestones/

  -->
  <macrodef name="updatecomposite">
    <attribute name="repoToCreate" />
    <attribute name="repoToPointTo" />
    <attribute name="reponame" />
    <sequential>
      <!-- delete it, if already exists -->
      <delete
        dir="@{repoToCreate}"
        failonerror="false" />
      <!-- create it -->
      <mkdir dir="@{repoToCreate}" />
      <!-- now add the one child -->
      <echo message="(re)creating repostory: @{repoToCreate}" />
      <echo message="adding child repository: @{repoToPointTo}" />
      <p2.composite.repository>
        <repository location="file://@{repoToCreate}" name="@{reponame}"/>
        <add location="@{repoToPointTo}" />
      </p2.composite.repository>

      <local name="p2IndexFilename" />
      <property
        name="p2IndexFilename"
        value="@{repoToCreate}/p2.index" />
      <echo message="creating p2.index file" />
      <echo
        file="${p2IndexFilename}"
        message="version=1${line.separator}" />
      <echo
        file="${p2IndexFilename}"
        append="true"
        message="metadata.repository.factory.order=compositeContent.xml,!${line.separator}" />
      <echo
        file="${p2IndexFilename}"
        append="true"
        message="artifact.repository.factory.order=compositeArtifacts.xml,!${line.separator}" />

    </sequential>
  </macrodef>

</project>

Back to the top