Timoney, Dan (dt5972) | 135e407 | 2019-07-01 13:08:58 -0400 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | updatePom() { |
| 4 | export XMLLINT_INDENT=" " |
| 5 | cat $1 | xsltproc -o $1 /tmp/rebase-pom.xslt - |
| 6 | } |
| 7 | |
| 8 | export -f updatePom |
| 9 | |
| 10 | # Copy blueprints to new directory structure |
| 11 | find . -path '*/src/main/resources/org/opendaylight/blueprint/*.xml' -execdir sh -c "mkdir -p ../../../OSGI-INF/blueprint; cp {} ../../../OSGI-INF/blueprint" \; |
| 12 | |
| 13 | # Update ietf-net-types dependencies |
| 14 | |
| 15 | cat <<END > /tmp/rebase-pom.xslt |
| 16 | <?xml version="1.0" encoding="utf-8"?> |
| 17 | <xsl:stylesheet version="1.0" |
| 18 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
| 19 | xmlns:pom="http://maven.apache.org/POM/4.0.0" |
| 20 | xmlns="http://maven.apache.org/POM/4.0.0" |
| 21 | exclude-result-prefixes="pom"> |
| 22 | |
| 23 | <!-- Copy everything that does not match a rewrite rule --> |
| 24 | <xsl:template match="@*|node()"> |
| 25 | <xsl:copy> |
| 26 | <xsl:apply-templates select="@*|node()" /> |
| 27 | </xsl:copy> |
| 28 | </xsl:template> |
| 29 | |
| 30 | <xsl:template match="//pom:dependency[pom:groupId='org.opendaylight.mdsal.model' and pom:artifactId='ietf-inet-types-2013-07-15']"> |
| 31 | <dependency><xsl:text>
 </xsl:text> |
| 32 | <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId><xsl:text>
 </xsl:text> |
| 33 | <artifactId>rfc6991</artifactId><xsl:text>
 </xsl:text> |
| 34 | </dependency><xsl:text>
</xsl:text> |
| 35 | </xsl:template> |
| 36 | |
| 37 | <xsl:template match="//pom:dependency[pom:groupId='org.opendaylight.mdsal.model' and pom:artifactId='ietf-yang-types-20130715']"> |
| 38 | </xsl:template> |
| 39 | |
| 40 | <xsl:template match="//pom:dependency[pom:groupId='org.opendaylight.mdsal.model' and pom:artifactId='mdsal-model-artifacts']"> |
| 41 | </xsl:template> |
| 42 | |
| 43 | <xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="no"/> |
| 44 | </xsl:stylesheet> |
| 45 | END |
| 46 | |
| 47 | find . -name pom.xml -exec bash -c 'updatePom "$0" .' '{}' \; |