Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: da6739c62a9b9fd511b8cfb1bb68c23ceb939d38 (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
<project name="Build Repos" default="all" basedir=".">

  <target name="init">
    <property name="featureTempRoot" value="${equinox.build.configs}/equinox-launchers" />
    <property name="featureTempDir" value="featureTemp" />
    <property name="featureTemp" value="${featureTempRoot}/${featureTempDir}" />
    <property name="featureTemp2" value="${featureTempRoot}/featureTemp2" />
  </target>

  <target name="all" depends="init">
    <antcall target="equinoxlaunchers" />
  </target>

  <target name="equinoxlaunchers">
    <property name="archiveRoot" value="launchers" />
    <buildRepos os="win32" ws="win32" arch="x86_64" archiveName="${archiveRoot}-win32.win32.x86_64.${buildId}.zip" />
    <buildRepos os="linux" ws="gtk" arch="x86_64" archiveName="${archiveRoot}-linux.gtk.x86_64.${buildId}.tar.gz" />
    <buildRepos os="linux" ws="gtk" arch="ppc64le" archiveName="${archiveRoot}-linux.gtk.ppc64le.${buildId}.tar.gz" />
    <buildRepos os="macosx" ws="cocoa" arch="x86_64" archiveName="${archiveRoot}-macosx.cocoa.x86_64.${buildId}.tar.gz" />
  </target>


  <macrodef name="buildRepos">
    <attribute name="os" />
    <attribute name="ws" />
    <attribute name="arch" />
    <attribute name="archiveName" />

    <sequential>
      <delete dir="${featureTemp}" />
      <mkdir dir="${featureTemp}" />
      <delete dir="${featureTemp2}" />
      <mkdir dir="${featureTemp2}" />
      <p2.mirror source="file://${buildRepo}">
        <destination kind="metadata" location="file://${featureTemp}" name="Equinox Launchers Repo" format="file://${buildRepo}" />
        <destination kind="artifact" location="file://${featureTemp}" name="Equinox Launchers Repo" format="file://${buildRepo}" />
        <iu id="org.eclipse.equinox.executable.feature.group" version="" />
        <iu id="org.eclipse.equinox.executable" version="" />
        <slicingOptions platformFilter="@{os},@{ws},@{arch}" includeOptional="false" includeNonGreedy="false" followStrict="true" />
      </p2.mirror>
      <p2.repo2runnable destination="${featureTemp2}/eclipse">
        <source dir="${featureTempRoot}" includes="${featureTempDir}" />
      </p2.repo2runnable>
      <delete>
        <fileset dir="${featureTemp2}/eclipse" includes="*.jar" />
        <fileset dir="${featureTemp2}/eclipse" includes="*.xml" />
      </delete>
      <!-- assemble compressed files and create checksums -->
      <antcall target="compress">
        <param name="archiveName" value="@{archiveName}" />
        <param name="dir" value="${featureTemp2}" />
      </antcall>
    </sequential>
  </macrodef>

  <target name="compress">
    <!-- set the target based on which OS we are running on since there
    is a difference between unzip and untar/gunzip -->
    <property name="archiveFullPath" value="${equinoxPostingDirectory}/${buildDir}/${archiveName}" />
    <condition property="compress.target" value="compress-zip">
      <contains string="${archiveName}" substring=".zip" />
    </condition>
    <condition property="compress.target" value="compress-tar.gz">
      <contains string="${archiveName}" substring=".tar.gz" />
    </condition>
    <antcall target="${compress.target}">
      <param name="dir" value="${featureTemp2}" />
      <param name="filename" value="${archiveName}" />
    </antcall>
  </target>

  <target name="compress-zip">
    <exec dir="${dir}" executable="zip">
      <arg line="-q ${dir}/${filename} -r ." />
    </exec>
    <move file="${dir}/${filename}" tofile="${archiveFullPath}" />
  </target>

  <target name="compress-tar.gz">
    <exec dir="${dir}" executable="sh">
      <arg line='-c "tar -cvzf ${dir}/${filename} *"' />
    </exec>
    <move file="${dir}/${filename}" tofile="${archiveFullPath}" />
  </target>


</project>

Back to the top