Skip to content

Commit

Permalink
[FIXME] Attempt to simplify build
Browse files Browse the repository at this point in the history
Harmonise builds of dev-launcher and other artefacts

Related to issue
#75 (POM cleanup)
  • Loading branch information
bertfrees committed Jun 21, 2016
1 parent fb14827 commit fef6d75
Show file tree
Hide file tree
Showing 13 changed files with 560 additions and 180 deletions.
292 changes: 165 additions & 127 deletions pom.xml

Large diffs are not rendered by default.

53 changes: 24 additions & 29 deletions src/main/assembly/components/framework.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
<exclude>etc/system.properties</exclude>
<exclude>etc/config.properties</exclude>
<exclude>etc/config-logback.xml</exclude>
<exclude>etc/org.apache.felix.fileinstall-modules.cfg</exclude>
<exclude>etc/org.apache.felix.fileinstall-libs.cfg</exclude>
</excludes>
<outputDirectory>/</outputDirectory>
</fileSet>
Expand All @@ -24,11 +22,18 @@
<include>etc/system.properties</include>
<include>etc/config.properties</include>
<include>etc/config-logback.xml</include>
<include>etc/org.apache.felix.fileinstall-modules.cfg</include>
</includes>
<filtered>true</filtered>
<outputDirectory>/</outputDirectory>
</fileSet>
<fileSet>
<directory>target/generated-resources/etc/dist</directory>
<includes>
<include>org.apache.felix.fileinstall-*.cfg</include>
</includes>
<filtered>false</filtered>
<outputDirectory>/etc</outputDirectory>
</fileSet>
<fileSet>
<directory>src/main/resources</directory>
<includes>
Expand All @@ -39,46 +44,36 @@
<filtered>true</filtered>
</fileSet>
<fileSet>
<directory>target/bundles/bootstrap</directory>
<outputDirectory>/system/bootstrap</outputDirectory>
</fileSet>
<fileSet>
<directory>target/bundles/felix</directory>
<outputDirectory>/system/felix</outputDirectory>
<directory>target/bundles</directory>
<excludes>
<exclude>org.apache.felix.org.apache.felix.gogo*</exclude>
<exclude>system/felix/org.apache.felix.org.apache.felix.gogo*</exclude>
<exclude>system/libs/</exclude>
<exclude>system/libs/*</exclude>
<exclude>system/pipeline/</exclude>
<exclude>system/pipeline/*</exclude>
<exclude>modules/linux</exclude>
<exclude>modules/linux/*</exclude>
<exclude>modules/mac</exclude>
<exclude>modules/mac/*</exclude>
<exclude>modules/win</exclude>
<exclude>modules/win/*</exclude>
</excludes>
<outputDirectory>/</outputDirectory>
</fileSet>
<fileSet>
<directory>target/bundles/felix</directory>
<directory>target/bundles/system/felix</directory>
<outputDirectory>/system/felix/gogo</outputDirectory>
<includes>
<include>org.apache.felix.org.apache.felix.gogo*</include>
</includes>
</fileSet>
<fileSet>
<directory>target/bundles/libs</directory>
<directory>target/bundles/system/libs</directory>
<outputDirectory>/system/framework</outputDirectory>
</fileSet>
<fileSet>
<directory>target/bundles/pipeline</directory>
<directory>target/bundles/system/pipeline</directory>
<outputDirectory>/system/framework</outputDirectory>
</fileSet>
<fileSet>
<directory>target/bundles/frontend</directory>
<outputDirectory>/system/frontend</outputDirectory>
</fileSet>
<fileSet>
<directory>target/bundles/modules</directory>
<excludes>
<exclude>linux</exclude>
<exclude>linux/*</exclude>
<exclude>mac</exclude>
<exclude>mac/*</exclude>
<exclude>win</exclude>
<exclude>win/*</exclude>
</excludes>
<outputDirectory>/modules</outputDirectory>
</fileSet>
</fileSets>
</component>
4 changes: 2 additions & 2 deletions src/main/assembly/dev.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pipeline.log=${org.daisy.pipeline.data}/log
pipeline.config=${org.daisy.pipeline.home}/etc
bundles.auto.deploy=../bundles/felix
bundles.bootstrap=../bundles/bootstrap
bundles.auto.deploy=../bundles/system/felix
bundles.bootstrap=../bundles/system/bootstrap
pipeline.ws.clientkey=clientid
pipeline.ws.clientsecret=supersecret
7 changes: 2 additions & 5 deletions src/main/assembly/dev.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
<exclude>config.properties</exclude>
<exclude>system.properties</exclude>
<exclude>config-logback.xml</exclude>
<exclude>org.apache.felix.fileinstall-framework.cfg</exclude>
<exclude>org.apache.felix.fileinstall-frontend.cfg</exclude>
<exclude>org.apache.felix.fileinstall-modules.cfg</exclude>
</excludes>
<outputDirectory>/etc</outputDirectory>
<filtered>false</filtered>
Expand All @@ -30,12 +27,12 @@
<filtered>true</filtered>
</fileSet>
<fileSet>
<directory>target/generated-resources/etc</directory>
<directory>target/generated-resources/etc/dev</directory>
<includes>
<include>org.apache.felix.fileinstall-*.cfg</include>
</includes>
<outputDirectory>/etc</outputDirectory>
<filtered>true</filtered>
<filtered>false</filtered>
</fileSet>
<fileSet>
<directory>src/main/resources</directory>
Expand Down
1 change: 0 additions & 1 deletion src/main/assembly/dist.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ pipeline.log=${org.daisy.pipeline.data}/log
pipeline.config=${org.daisy.pipeline.home}/etc
bundles.auto.deploy=system/felix
bundles.bootstrap=system/bootstrap
bundles.modules=modules
pipeline.ws.host=http://localhost
pipeline.ws.port=8181
pipeline.ws.path=ws
Expand Down

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions src/main/resources/etc/org.apache.felix.fileinstall-libs.cfg

This file was deleted.

This file was deleted.

31 changes: 31 additions & 0 deletions src/main/xslt/pom-to-fileinstall-config-dir.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:pom="http://maven.apache.org/POM/4.0.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:pf="http://www.daisy.org/ns/pipeline/functions"
version="2.0">
<xsl:import href="uri-functions.xsl"/>
<xsl:param name="id"/>
<xsl:param name="base"/>
<xsl:param name="dest"/>
<xsl:output method="text" encoding="UTF-8" name="text"/>
<xsl:variable name="doc" as="document-node()" select="/"/>
<xsl:template match="/*">
<xsl:for-each select="tokenize($id,'\s*,\s*')[not(.='')]">
<xsl:variable name="id" select="."/>
<xsl:for-each select="$doc//pom:execution[pom:id=$id][not(ancestor::pom:profile)][1]/pom:configuration">
<xsl:variable name="outputDirectory" as="xs:string" select="pom:outputDirectory/string()"/>
<xsl:variable name="startLevel" as="xs:string" select="(pom:artifactItems/@startLevel/string(),'50')[1]"/>
<xsl:result-document href="{concat($dest, '/', 'org.apache.felix.fileinstall-', $id, '.cfg')}" format="text">
<xsl:text>felix.fileinstall.start.level=</xsl:text>
<xsl:value-of select="$startLevel"/>
<xsl:text>&#xA;</xsl:text>
<xsl:text>felix.fileinstall.dir=</xsl:text>
<xsl:value-of select="pf:relativize-uri($outputDirectory,$base)"/>
<xsl:text>&#xA;</xsl:text>
<xsl:text>felix.fileinstall.noInitialDelay=true&#xA;</xsl:text>
</xsl:result-document>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@
string(pom:classifier)=$classifier]
/pom:version[1]"/>
<xsl:variable name="classifierSuffix" select="if ($classifier!='') then concat('-', $classifier) else ''"/>
<!-- <xsl:variable name="nice-filename" -->
<!-- select="if (starts-with($groupId,'org.daisy.pipeline')) -->
<!-- then concat('o.d.p.',substring-after(concat($groupId,'.',$artifactId),'org.daisy.pipeline.')) -->
<!-- else concat($groupId,'.',$artifactId)"/> -->
<xsl:variable name="nice-filename"
select="if (starts-with($groupId,'org.daisy.pipeline'))
then concat('o.d.p.',substring-after(concat($groupId,'.',$artifactId),'org.daisy.pipeline.'))
else concat($groupId,'.',$artifactId)"/>
select="string-join((for $x in tokenize($groupId,'\.') return substring($x,1,1),$artifactId),'.')"/>
<xsl:variable name="startLevel"
select="(((self::*|parent::pom:artifactItems)/@startLevel)[last()]/string(),'50')[1]"/>
<xsl:if test="not(($classifier='windows' and not($isWindows)) or
Expand Down
5 changes: 4 additions & 1 deletion src/main/xslt/pom-to-release.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@
<xsl:apply-templates select="/pom:project/pom:build/pom:plugins/pom:plugin/pom:executions/pom:execution[./pom:id/text()='copy-pipeline-bundles']/pom:configuration/pom:artifactItems">
<xsl:with-param name="deployPath">/system/framework</xsl:with-param>
</xsl:apply-templates>
<xsl:apply-templates select="/pom:project/pom:build/pom:plugins/pom:plugin/pom:executions/pom:execution[./pom:id/text()='copy-logback-bundles']/pom:configuration/pom:artifactItems">
<xsl:with-param name="deployPath">/system/logback</xsl:with-param>
</xsl:apply-templates>
<xsl:apply-templates select="/pom:project/pom:build/pom:plugins/pom:plugin/pom:executions/pom:execution[./pom:id/text()='copy-frontend']/pom:configuration/pom:artifactItems">
<xsl:with-param name="deployPath">/system/frontend</xsl:with-param>
</xsl:apply-templates>
<xsl:apply-templates select="/pom:project/pom:build/pom:plugins/pom:plugin/pom:executions/pom:execution[./pom:id/text()='copy-pipeline-modules']/pom:configuration/pom:artifactItems">
<xsl:with-param name="deployPath">/system/modules</xsl:with-param>
<xsl:with-param name="deployPath">/modules</xsl:with-param>
</xsl:apply-templates>
<xsl:apply-templates mode="zip" select="/pom:project/pom:profiles/pom:profile/pom:build/pom:plugins/pom:plugin/pom:executions/pom:execution[./pom:id/text()='unpack-cli-win']/pom:configuration/pom:artifactItems/pom:artifactItem">
<xsl:with-param name="deployPath">/cli</xsl:with-param>
Expand Down
Loading

0 comments on commit fef6d75

Please sign in to comment.