SRADA-758: Removed Mars dependency from Maven build
authorDmitriy Nikiforov <d.nikiforov@partner.samsung.com>
Thu, 23 Jun 2016 14:26:04 +0000 (17:26 +0300)
committerMaria Guseva <m.guseva@samsung.com>
Fri, 15 Jul 2016 10:39:12 +0000 (19:39 +0900)
Now all bundle dependencies will reside in local p2-repository repackaged if
necessary into osgi-bundles to avoid packaging them inside plugins.

Creation of local p2-site can be done with p2-maven-plugin: mvn p2:site
It also automatically repackages all mentioned dependencies into osgi-bundles.

Additional artifacts can be published with FeaturesAndBundlesPublisher
application with '-append' option which was added in build.linux script to
publish all Eclipse dependencies and common-eplugin.

Eclipse Mars will be downloaded from 'advux_main' repository no matter which
repository user has specified to pkg-build tool.

Change-Id: Ib2463b512e85ea74895b6efff96713e73b7cd520

p2-deps/features/org.eclipse.equinox.executable_3.5.1.v20111216-1653-7P7NFUIFIbaUcU77s0KQWHw5HZTZ.jar [new file with mode: 0644]
p2-deps/pom.xml [new file with mode: 0644]
package/build.linux
package/pkginfo.manifest
pom.xml

diff --git a/p2-deps/features/org.eclipse.equinox.executable_3.5.1.v20111216-1653-7P7NFUIFIbaUcU77s0KQWHw5HZTZ.jar b/p2-deps/features/org.eclipse.equinox.executable_3.5.1.v20111216-1653-7P7NFUIFIbaUcU77s0KQWHw5HZTZ.jar
new file mode 100644 (file)
index 0000000..537b57b
Binary files /dev/null and b/p2-deps/features/org.eclipse.equinox.executable_3.5.1.v20111216-1653-7P7NFUIFIbaUcU77s0KQWHw5HZTZ.jar differ
diff --git a/p2-deps/pom.xml b/p2-deps/pom.xml
new file mode 100644 (file)
index 0000000..a961508
--- /dev/null
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+       xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+       <modelVersion>4.0.0</modelVersion>
+
+       <groupId>org.tizen.dynamicanalyzer</groupId>
+       <artifactId>org.tizen.dynamicanalyzer.p2-deps</artifactId>
+       <version>1.0.0</version>
+       <packaging>pom</packaging>
+
+       <pluginRepositories>
+               <pluginRepository>
+                       <id>reficio</id>
+                       <url>http://repo.reficio.org/maven/</url>
+               </pluginRepository>
+       </pluginRepositories>
+
+       <build>
+               <plugins>
+                       <plugin>
+                               <groupId>org.reficio</groupId>
+                               <artifactId>p2-maven-plugin</artifactId>
+                               <version>1.2.0-SNAPSHOT</version>
+                               <executions>
+                                       <execution>
+                                               <id>default-cli</id>
+                                               <configuration>
+                                                       <p2>
+                                                       </p2>
+                                                       <artifacts>
+                                                       </artifacts>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
+               </plugins>
+       </build>
+</project>
index 56c7ebd..08a99be 100644 (file)
@@ -2,7 +2,7 @@
 
 build_path=${SRCDIR}/org.tizen.dynamicanalyzer.workbench.product/target/products/org.tizen.dynamicanalyzer.workbench.product
 build_time=`date +%Y%m%d-%H%M`
-da_dep_repo=${SRCDIR}/package/da-repo
+repo_url="http://10.113.138.168/packages/advux_main/binary/"
 
 __set_parameter()
 {
@@ -58,21 +58,6 @@ __set_build_parameter()
        product_version=${manifest_version}
        branding_path="org.tizen.dynamicanalyzer.workbench.product"
        branding_file="dynamicanalyzer.product"
-
-       case ${platform} in
-               ubuntu-32|ubuntu-64)
-                       reference_ide_path=${ROOTDIR}/indigo-pde/eclipse
-                       ;;
-               windows-32|windows-64)
-                       reference_ide_path=${ROOTDIR}/indigo-winpde/eclipse
-                       ;;
-               macos-64)
-                       reference_ide_path=${ROOTDIR}/indigo-macpde/eclipse
-                       ;;
-               *)
-                       echo "${platform} is not support yet."
-                       ;;
-       esac
 }
 
 __set_install_parameter()
@@ -126,13 +111,83 @@ __restore_product_info() {
     mv ${about_mapping_path}.bkp ${about_mapping_path}
 }
 
+__prepare_eclipse() {
+       case ${platform} in
+               ubuntu-32)
+                       package_name="eclipse-pde_3.0.8_ubuntu-32"
+                       ;;
+               windows-32)
+                       package_name="eclipse-pde_3.0.8_windows-32"
+                       ;;
+               ubuntu-64)
+                       package_name="eclipse-pde_3.0.2_ubuntu-64"
+                       ;;
+                       windows-64)
+                       package_name="eclipse-pde_3.0.8_windows-64"
+                       ;;
+               macos-64)
+                       package_name="eclipse-pde_3.0.8_macos-64"
+                       ;;
+               *)
+                       echo "${platform} is not support yet."
+                       ;;
+       esac
+
+       if [ ! -d ${ROOTDIR}/${package_name} ]; then
+               echo "Downloading Eclipse Mars..."
+
+               cd /tmp
+               wget -nc -q "${repo_url}/${package_name}.zip"
+               unzip "${package_name}.zip" -d "${ROOTDIR}/${package_name}"
+               cd ${SRCDIR}
+       fi
+
+       reference_ide_path=${ROOTDIR}/${package_name}/data/eclipse-pde/eclipse
+
+       if [ "${package_name}" = "eclipse-pde_3.0.8_macos-64" ]; then
+               reference_ide_path=${ROOTDIR}/${package_name}/data/eclipse-pde/Eclipse.app/Contents/Eclipse
+       fi
+}
+
+__compose_da_dependencies() {
+       echo "Compose dependencies repository..."
+
+       da_dep_repo=${SRCDIR}/p2-deps
+       cd ${da_dep_repo}
+
+       # create p2 repository with dependencies plugins
+
+       # extra dependencies
+       mvn p2:site
+       built_repo=${da_dep_repo}/target/repository
+
+       # common-eplugin
+       __publishFeaturesAndBundles ${built_repo} ${ROOTDIR}/ide
+       # eclipse dependencies
+       __publishFeaturesAndBundles ${built_repo} ${reference_ide_path}
+       # some dependencies that cannot be downloaded
+       __publishFeaturesAndBundles ${built_repo} ${da_dep_repo}
+
+       cd ${SRCDIR}
+}
+
+__publishFeaturesAndBundles() {
+       java -jar ${reference_ide_path}/plugins/org.eclipse.equinox.launcher_*.jar \
+               -application org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher \
+               -metadataRepository file:$1 \
+               -artifactRepository file:$1 \
+               -source $2 \
+               -configs ${windowing}.${archive_platform_name}.${architecture} \
+               -publishArtifacts \
+               -append
+}
+
 __execute_pde_build()
 {
        echo "Execute Product Ant Builder..."
        cd ${SRCDIR}
 
-       #DA_DEP_REPO=${da_dep_repo} mvn -V -DenvOs=${archive_platform_name} -DenvWs=${windowing} -DenvArch=${architecture} clean package
-       DA_DEP_REPO=${da_dep_repo} mvn -V -DenvOs=${archive_platform_name} -DenvWs=${windowing} -DenvArch=${architecture} -DskipTests clean package
+       mvn -V -DenvOs=${archive_platform_name} -DenvWs=${windowing} -DenvArch=${architecture} -DskipTests clean package
 
        if [ $? != 0 ];
        then
@@ -193,6 +248,8 @@ build_plugins()
        __clean_build_environment
        __set_product_version
        __set_product_about_info
+       __prepare_eclipse
+       __compose_da_dependencies
        __execute_pde_build
        __execute_ant_build
        __cleanup
index d057995..8beedfb 100644 (file)
@@ -6,7 +6,7 @@ Package:dynamic-analyzer-product
 Label:Dynamic Analyzer
 OS:ubuntu-32
 Build-host-os:ubuntu-32
-Build-dependency:
+Build-dependency: common-eplugin-rcp [ubuntu-32]
 Description:The host of the Dynamic Analyzer
 C-Prerequisites:rpm2cpio,cpio
 
@@ -14,14 +14,14 @@ Package:dynamic-analyzer-product
 Label:Dynamic Analyzer
 OS:windows-32
 Build-host-os:ubuntu-32
-Build-dependency:
+Build-dependency: common-eplugin-rcp [windows-32]
 Description:The host of the Dynamic Analyzer
 
 Package:dynamic-analyzer-product
 Label:Dynamic Analyzer
 OS:ubuntu-64
 Build-host-os:ubuntu-64
-Build-dependency:
+Build-dependency: common-eplugin-rcp [ubuntu-64]
 Description:The host of the Dynamic Analyzer
 C-Prerequisites:rpm2cpio,cpio
 
@@ -29,12 +29,12 @@ Package:dynamic-analyzer-product
 Label:Dynamic Analyzer
 OS:windows-64
 Build-host-os:ubuntu-64
-Build-dependency:
+Build-dependency: common-eplugin-rcp [windows-64]
 Description:The host of the Dynamic Analyzer
 
 Package:dynamic-analyzer-product
 Label:Dynamic Analyzer
 OS:macos-64
 Build-host-os:ubuntu-64
-Build-dependency:
+Build-dependency: common-eplugin-rcp [macos-64]
 Description:The host of the Dynamic Analyzer
diff --git a/pom.xml b/pom.xml
index a346712..f2ec648 100644 (file)
--- a/pom.xml
+++ b/pom.xml
 
        <repositories>
                <repository>
-                       <id>eclipse-mars</id>
-                       <url>http://download.eclipse.org/releases/mars</url>
-                       <layout>p2</layout>
-               </repository>
-               <repository>
-                       <id>local-p2-repo</id>
-                       <url>file://${env.DA_DEP_REPO}</url>
+                       <id>local-p2</id>
+                       <url>file://${project.basedir}/../p2-deps/target/repository</url>
                        <layout>p2</layout>
                </repository>
        </repositories>