blob: 4a513435de4622c73b65fd80498ec1cf6003a547 [file] [log] [blame]
Timoney, Dan (dt5972)135e4072019-07-01 13:08:58 -04001#!/usr/bin/env bash
2
3updatePom() {
4export XMLLINT_INDENT=" "
5cat $1 | xsltproc -o $1 /tmp/rebase-pom.xslt -
6}
7
8export -f updatePom
9
10# Copy blueprints to new directory structure
11find . -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
15cat <<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>&#xa; </xsl:text>
32 <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId><xsl:text>&#xa; </xsl:text>
33 <artifactId>rfc6991</artifactId><xsl:text>&#xa; </xsl:text>
34 </dependency><xsl:text>&#xa;</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>
45END
46
47find . -name pom.xml -exec bash -c 'updatePom "$0" .' '{}' \;