Support building without zip archives 57/77657/2
authorStephen Kitt <skitt@redhat.com>
Fri, 9 Nov 2018 15:56:16 +0000 (16:56 +0100)
committerRobert Varga <nite@hq.sk>
Sun, 11 Nov 2018 16:13:42 +0000 (16:13 +0000)
The build can be configured to skip zip or tar.gz archives (or even
both). Currently if zip archives are disabled, the build fails since
features-test expects a zip archive; this patch allows either a zip or
a tar.gz to be used, depending on what's built.

If both are disabled the build will fail unless it can retrieve a
matching archive from a repository. The nominal configuration is still
to build both.

JIRA: ODLPARENT-174
Change-Id: I858810767bcca452eebf52107ee76be129f85192
Signed-off-by: Stephen Kitt <skitt@redhat.com>
features-test/pom.xml

index 26e7e10336f45f908caee89d845d11c5ff66d555..bdbb411943e596d6cfd9debed19fabc5b3af3c4e 100644 (file)
             <artifactId>org.osgi.core</artifactId>
             <scope>compile</scope>
         </dependency>
-        <dependency>
-            <groupId>org.opendaylight.odlparent</groupId>
-            <artifactId>opendaylight-karaf-empty</artifactId>
-            <type>zip</type>
-            <exclusions>
-              <exclusion>
-                <groupId>*</groupId>
-                <artifactId>*</artifactId>
-              </exclusion>
-            </exclusions>
-        </dependency>
         <!-- BEWARE of adding additional dependencies here...
              It will cause weird issues e.g. in integration/distribution/features/repos/distribution -->
         <dependency>
         </plugins>
     </build>
 
+    <!-- We use profiles to handle the different archives which are user-configurable.
+         We need at least one archive to be built. -->
+    <profiles>
+        <profile>
+            <id>zip</id>
+            <activation>
+                <property>
+                    <name>karaf.archiveZip</name>
+                    <value>true</value>
+                </property>
+            </activation>
+            <dependencies>
+                <dependency>
+                    <groupId>org.opendaylight.odlparent</groupId>
+                    <artifactId>opendaylight-karaf-empty</artifactId>
+                    <type>zip</type>
+                    <exclusions>
+                        <exclusion>
+                            <groupId>*</groupId>
+                            <artifactId>*</artifactId>
+                        </exclusion>
+                    </exclusions>
+                </dependency>
+            </dependencies>
+            <properties>
+                <archive.extension>zip</archive.extension>
+            </properties>
+        </profile>
+        <profile>
+            <id>tarGz</id>
+            <activation>
+                <property>
+                    <name>karaf.archiveTarGz</name>
+                    <value>true</value>
+                </property>
+            </activation>
+            <properties>
+                <archive.extension>tar.gz</archive.extension>
+            </properties>
+        </profile>
+    </profiles>
 </project>