build p2 repo with maven plugin instead of manually invoking launcher jar

This commit is contained in:
Fredrik Teschke
2014-11-21 15:18:14 +01:00
parent 56c25c50d7
commit 91fef8fc84
7 changed files with 56 additions and 56 deletions
+21 -14
View File
@@ -513,6 +513,18 @@ echo "Starting $@ of server..."
if [[ "$@" == "build" ]] || [[ "$@" == "all" ]]; then
# yield build so that we get updated product
if [ $offline -eq 1 ]; then
echo "INFO: Activating offline mode"
extra="$extra -o"
fi
if [ $proxy -eq 1 ]; then
echo "INFO: Activating proxy profile"
extra="$extra -P no-debug.with-proxy"
MAVEN_SETTINGS=$MAVEN_SETTINGS_PROXY
else
extra="$extra -P no-debug.without-proxy"
fi
cd $PROJECT_HOME/java
if [ $gwtcompile -eq 1 ]; then
@@ -543,7 +555,15 @@ if [[ "$@" == "build" ]] || [[ "$@" == "all" ]]; then
if [ $p2local -eq 1 ]; then
echo "INFO: Building and using local p2 repo"
(cd com.sap.$PROJECT_TYPE.targetplatform/scripts; ./createLocalBaseP2repositoryLinux.sh; ./createLocalTargetDef.sh)
#build local p2 repo
echo "Using following command (pwd: java/com.sap.sailing.targetplatform.base): mvn -fae -s $MAVEN_SETTINGS $clean tycho-p2-extras:publish-features-and-bundles"
echo "Maven version used: `mvn --version`"
(cd com.sap.$PROJECT_TYPE.targetplatform.base; mvn -fae -s $MAVEN_SETTINGS $clean tycho-p2-extras:publish-features-and-bundles 2>&1 | tee $START_DIR/build.log)
# now get the exit status from mvn, and not that of tee which is what $? contains now
MVN_EXIT_CODE=${PIPESTATUS[0]}
echo "Maven exit code is $MVN_EXIT_CODE"
#create local target definition
(cd com.sap.$PROJECT_TYPE.targetplatform/scripts; ./createLocalTargetDef.sh)
extra="$extra -Dp2-local" # activates the p2-target.local profile in java/pom.xml
else
echo "INFO: Using remote p2 repo (http://p2.sapsailing.com/p2/sailing/)"
@@ -560,19 +580,6 @@ if [[ "$@" == "build" ]] || [[ "$@" == "all" ]]; then
# TODO: Think about http://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html
fi
if [ $offline -eq 1 ]; then
echo "INFO: Activating offline mode"
extra="$extra -o"
fi
if [ $proxy -eq 1 ]; then
echo "INFO: Activating proxy profile"
extra="$extra -P no-debug.with-proxy"
MAVEN_SETTINGS=$MAVEN_SETTINGS_PROXY
else
extra="$extra -P no-debug.without-proxy"
fi
if [ $android -eq 0 ] && [ $gwtcompile -eq 0 ] && [ $testing -eq 0 ]; then
parallelexecution=1
echo "INFO: Running build in parallel with 2.5*CPU threads"
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001 XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>root</artifactId>
<groupId>com.sap.sailing</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<packaging>eclipse-repository</packaging>
<artifactId>com.sap.sailing.targetplatform.base</artifactId>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-p2-extras-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<artifactRepositoryLocation>${basedir}/gen/p2</artifactRepositoryLocation>
<metadataRepositoryLocation>${basedir}/gen/p2</metadataRepositoryLocation>
<sourceLocation>${basedir}</sourceLocation>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -1,22 +1,3 @@
#!/bin/bash
set -u
if [ "$ECLIPSE_HOME" = "" ]; then
ECLIPSE_HOME=C:/Users/D056866/Sailing/eclipse
fi
if [ "$SAILING_GIT_HOME" = "" ]; then
SAILING_GIT_HOME=C:/Users/D056866/Sailing/git
fi
TARGET_PLATFORM_BASE_DIR=${SAILING_GIT_HOME}/java/com.sap.sailing.targetplatform.base
ECLIPSE_VM_ARGS="-Xmx256m"
ECLIPSE_LAUNCHER=${ECLIPSE_HOME}/plugins/org.eclipse.equinox.launcher_*.jar
echo TARGET_PLATFORM_BASE_DIR is $SAILING_GIT_HOME
echo ECLIPSE_HOME is $ECLIPSE_HOME
echo Eclipse Launcher $ECLIPSE_LAUNCHER
java -jar ${ECLIPSE_LAUNCHER} -consolelog -nosplash -verbose -application org.eclipse.equinox.p2.publisher.UpdateSitePublisher \
-metadataRepository file:/${TARGET_PLATFORM_BASE_DIR}/gen/p2 \
-artifactRepository file:/${TARGET_PLATFORM_BASE_DIR}/gen/p2 \
-source ${TARGET_PLATFORM_BASE_DIR} \
-publishArtifacts -publishArtifactRepository -compress -noDefaultIUs -vmargs ${ECLIPSE_VM_ARGS}
cd ../../com.sap.sailing.targetplatform.base
mvn tycho-p2-extras:publish-features-and-bundles
@@ -1,21 +0,0 @@
#!/bin/bash
# see http://wiki.eclipse.org/Equinox/p2/Publisher for documentation
if [ "$ECLIPSE_HOME" = "" ]; then
ECLIPSE_BIN=`which eclipse`
ECLIPSE_HOME="`dirname $ECLIPSE_BIN`"
fi
SAILING_GIT_HOME="`pwd`/../../.."
TARGET_PLATFORM_BASE_DIR=${SAILING_GIT_HOME}/java/com.sap.sailing.targetplatform.base
ECLIPSE_VM_ARGS="-Xmx256m"
ECLIPSE_LAUNCHER=${ECLIPSE_HOME}/plugins/org.eclipse.equinox.launcher_*.jar
echo "Deploying metadata to $TARGET_PLATFORM_BASE_DIR/gen/p2..."
java -jar ${ECLIPSE_LAUNCHER} -consolelog -nosplash -verbose -application org.eclipse.equinox.p2.publisher.UpdateSitePublisher \
-metadataRepository file:/${TARGET_PLATFORM_BASE_DIR}/gen/p2 \
-artifactRepository file:/${TARGET_PLATFORM_BASE_DIR}/gen/p2 \
-source ${TARGET_PLATFORM_BASE_DIR} \
-publishArtifacts -publishArtifactRepository -compress -noDefaultIUs -vmargs ${ECLIPSE_VM_ARGS}
@@ -1,3 +1,6 @@
#!/bin/bash
# generate a target definition pointing to the locally built p2 repo from the race-analysis-p2-remote target defintion
base="../definitions/race-analysis-p2"
remote_repo="http://p2.sapsailing.com/p2/sailing/"
local_repo="file://$(readlink -f ../../com.sap.sailing.targetplatform.base/gen/p2/)"
+1
View File
@@ -117,6 +117,7 @@
<module>com.sap.sailing.selenium.test</module>
<module>com.sap.sailing.autoload</module>
<module>com.sap.sailing.feature.p2build</module>
<!-- com.sap.sailing.targetplatform.base left out on purpose: only invoke maven manually to build target platform -->
</modules>
<properties>