Skip to content

Commit 55bd727

Browse files
committed
[Build] Repack platform repositorie's content.jar and content.xml.xz
Fixes #1912
1 parent 53a75be commit 55bd727

File tree

3 files changed

+43
-82
lines changed
  • cje-production/promotion
  • eclipse-platform-parent
  • eclipse.platform.releng.tychoeclipsebuilder/eclipse.platform.repository

3 files changed

+43
-82
lines changed

cje-production/promotion/promoteSites.sh

Lines changed: 0 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -235,87 +235,6 @@ function addRepoProperties ()
235235
${ECLIPSE_EXE} --launcher.suppressErrors -nosplash -consolelog -debug -data ${devworkspace} -application ${APP_NAME} -vmargs ${MIRRORS_URL_ARG} -Dp2ArtifactRepositoryName="${ART_REPO_NAME}" -Dp2MetadataRepositoryName="${CON_REPO_NAME}" ${ART_REPO_ARG} ${CON_REPO_ARG}
236236
}
237237

238-
function createXZ
239-
{
240-
BUILDMACHINE_SITE=$1
241-
242-
CONTENT_JAR_FILE="${BUILDMACHINE_SITE}/content.jar"
243-
if [[ ! -e "${CONTENT_JAR_FILE}" ]]
244-
then
245-
echo -e "\n\tERROR: content.jar file did not exist at ${BUILDMACHINE_SITE}."
246-
return 1
247-
fi
248-
ARTIFACTS_JAR_FILE="${BUILDMACHINE_SITE}/artifacts.jar"
249-
if [[ ! -e "${ARTIFACTS_JAR_FILE}" ]]
250-
then
251-
echo -e "\n\tERROR: artifacts.jar file did not exist at ${BUILDMACHINE_SITE}."
252-
return 1
253-
fi
254-
255-
# Notice we overwrite the XML files, if they already exists.
256-
unzip -q -o "${CONTENT_JAR_FILE}" -d "${BUILDMACHINE_SITE}"
257-
RC=$?
258-
if [[ $RC != 0 ]]
259-
then
260-
echo "ERROR: could not unzip ${CONTENT_JAR_FILE}."
261-
return $RC
262-
fi
263-
# Notice we overwrite the XML files, if they already exists.
264-
unzip -q -o "${ARTIFACTS_JAR_FILE}" -d "${BUILDMACHINE_SITE}"
265-
RC=$?
266-
if [[ $RC != 0 ]]
267-
then
268-
echo "ERROR: could not unzip ${ARTIFACTS_JAR_FILE}."
269-
return $RC
270-
fi
271-
272-
CONTENT_XML_FILE="${BUILDMACHINE_SITE}/content.xml"
273-
ARTIFACTS_XML_FILE="${BUILDMACHINE_SITE}/artifacts.xml"
274-
# We will check the content.xml and artifacts.xml files really exists. In some strange world, the jars could contain something else.
275-
if [[ ! -e "${CONTENT_XML_FILE}" || ! -e "${ARTIFACTS_XML_FILE}" ]]
276-
then
277-
echo -e "\n\tERROR: content.xml or artifacts.xml file did not exist as expected at ${BUILDMACHINE_SITE}."
278-
return 1
279-
fi
280-
281-
# finally, compress them, using "extra effort"
282-
# Notice we use "force" to over write any existing file, presumably there from a previous run?
283-
XZ_EXE=$(which xz)
284-
if [[ $? != 0 || -z "${XZ_EXE}" ]]
285-
then
286-
echo -e "\n\tERROR: xz executable did not exist."
287-
return 1
288-
fi
289-
echo -e "\n\tXZ compression of ${CONTENT_XML_FILE} ... "
290-
$XZ_EXE -e --force "${CONTENT_XML_FILE}"
291-
RC=$?
292-
if [[ $RC != 0 ]]
293-
then
294-
echo "ERROR: could not compress, using $XZ_EXE -e ${CONTENT_XML_FILE}."
295-
return $RC
296-
fi
297-
298-
echo -e "\tXZ compression of ${ARTIFACTS_XML_FILE} ... "
299-
$XZ_EXE -e --force "${ARTIFACTS_XML_FILE}"
300-
RC=$?
301-
if [[ $RC != 0 ]]
302-
then
303-
echo "ERROR: could not compress, using $XZ_EXE -e ${ARTIFACTS_XML_FILE}."
304-
return $RC
305-
fi
306-
307-
308-
# Notice we just write over any existing p2.index file.
309-
# May want to make backup of this and other files, for production use.
310-
P2_INDEX_FILE="${BUILDMACHINE_SITE}/p2.index"
311-
echo "version=1" > "${P2_INDEX_FILE}"
312-
echo "metadata.repository.factory.order= content.xml.xz,content.xml,!" >> "${P2_INDEX_FILE}"
313-
echo "artifact.repository.factory.order= artifacts.xml.xz,artifacts.xml,!" >> "${P2_INDEX_FILE}"
314-
echo -e "\tCreated ${P2_INDEX_FILE}"
315-
316-
return 0
317-
}
318-
319238
DROP_ID=$(echo $DROP_ID|tr -d ' ')
320239

321240
if [[ -z "${DROP_ID}" ]]
@@ -670,7 +589,6 @@ then
670589
pushd ${LOCAL_REPO}
671590
BUILDMACHINE_SITE=${LOCAL_REPO}/${REPO_ID}
672591
addRepoProperties ${BUILDMACHINE_SITE} ${REPO_SITE_SEGMENT} ${DL_DROP_ID}
673-
createXZ ${BUILDMACHINE_SITE}
674592
mv ${REPO_ID} ${DL_DROP_ID}
675593
scp -r ${LOCAL_REPO}/${DL_DROP_ID} [email protected]:/home/data/httpd/download.eclipse.org/eclipse/updates/${REPO_SITE_SEGMENT}
676594
popd

eclipse-platform-parent/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,11 @@
633633
<artifactId>build-helper-maven-plugin</artifactId>
634634
<version>3.6.1</version>
635635
</plugin>
636+
<plugin>
637+
<groupId>org.codehaus.mojo</groupId>
638+
<artifactId>exec-maven-plugin</artifactId>
639+
<version>3.5.1</version>
640+
</plugin>
636641
<plugin>
637642
<groupId>org.apache.maven.plugins</groupId>
638643
<artifactId>maven-javadoc-plugin</artifactId>

eclipse.platform.releng.tychoeclipsebuilder/eclipse.platform.repository/pom.xml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,44 @@
120120
</execution>
121121
</executions>
122122
</plugin>
123+
<plugin>
124+
<groupId>org.codehaus.mojo</groupId>
125+
<artifactId>exec-maven-plugin</artifactId>
126+
<executions>
127+
<execution>
128+
<id>repack-content-jar</id>
129+
<goals>
130+
<goal>exec</goal>
131+
</goals>
132+
<phase>package</phase>
133+
<configuration>
134+
<executable>jar</executable>
135+
<arguments>
136+
<argument>--create</argument>
137+
<argument>--no-manifest</argument>
138+
<argument>--file=${project.build.directory}/repository/content.jar</argument>
139+
<argument>${project.build.directory}/repository/content.xml</argument>
140+
</arguments>
141+
</configuration>
142+
</execution>
143+
<execution>
144+
<id>repack-content-xml-xz</id>
145+
<goals>
146+
<goal>exec</goal>
147+
</goals>
148+
<phase>package</phase>
149+
<configuration>
150+
<!-- Also deletes the content.xml file-->
151+
<executable>xz</executable>
152+
<arguments>
153+
<argument>--extreme</argument>
154+
<argument>--force</argument>
155+
<argument>${project.build.directory}/repository/content.xml</argument>
156+
</arguments>
157+
</configuration>
158+
</execution>
159+
</executions>
160+
</plugin>
123161
<plugin>
124162
<groupId>org.eclipse.tycho.extras</groupId>
125163
<artifactId>tycho-p2-extras-plugin</artifactId>

0 commit comments

Comments
 (0)