Refactor spec, use non-numeric version of aggregator

This commit is contained in:
Marian Koncek 2022-09-07 12:48:11 +02:00
parent 3997d274ef
commit 69ec695355
2 changed files with 20 additions and 34 deletions

View File

@ -2,13 +2,18 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.fedoraproject.xmvn.junit5</groupId>
<artifactId>aggregator</artifactId>
<version>1.0.0</version>
<version>any</version>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<modules>
<module>junit-bom</module>
<module>junit-jupiter</module>
<module>junit-jupiter-api</module>
<module>junit-jupiter-engine</module>
<module>junit-jupiter-migrationsupport</module>
<module>junit-jupiter-params</module>
<module>junit-platform-commons</module>
<module>junit-platform-console</module>
<module>junit-platform-console-standalone</module>
@ -17,13 +22,8 @@
<module>junit-platform-reporting</module>
<module>junit-platform-runner</module>
<module>junit-platform-suite-api</module>
<module>junit-platform-testkit</module>
<module>junit-platform-suite-commons</module>
<module>junit-jupiter</module>
<module>junit-jupiter-api</module>
<module>junit-jupiter-engine</module>
<module>junit-jupiter-migrationsupport</module>
<module>junit-jupiter-params</module>
<module>junit-platform-testkit</module>
<module>junit-vintage-engine</module>
</modules>
<build>

View File

@ -74,33 +74,19 @@ JUnit 5 User Guide.
find -name \*.jar -delete
cp -p %{SOURCE100} pom.xml
cp -p %{SOURCE200} junit-platform-commons/pom.xml
cp -p %{SOURCE201} junit-platform-console/pom.xml
cp -p %{SOURCE202} junit-platform-console-standalone/pom.xml
cp -p %{SOURCE203} junit-platform-engine/pom.xml
cp -p %{SOURCE205} junit-platform-launcher/pom.xml
cp -p %{SOURCE206} junit-platform-runner/pom.xml
cp -p %{SOURCE207} junit-platform-suite-api/pom.xml
cp -p %{SOURCE208} junit-platform-reporting/pom.xml
cp -p %{SOURCE209} junit-platform-testkit/pom.xml
cp -p %{SOURCE210} junit-platform-suite-commons/pom.xml
cp -p %{SOURCE300} junit-jupiter/pom.xml
cp -p %{SOURCE301} junit-jupiter-api/pom.xml
cp -p %{SOURCE302} junit-jupiter-engine/pom.xml
cp -p %{SOURCE303} junit-jupiter-migrationsupport/pom.xml
cp -p %{SOURCE304} junit-jupiter-params/pom.xml
cp -p %{SOURCE400} junit-vintage-engine/pom.xml
cp -p %{SOURCE500} junit-bom/pom.xml
for pom in $(find -mindepth 2 -name pom.xml | grep -v tests/); do
# Set parent to aggregator
%pom_xpath_inject pom:project "<parent><groupId>org.fedoraproject.xmvn.junit5</groupId><artifactId>aggregator</artifactId><version>1.0.0</version></parent>" $pom
for source in $(echo %{sources} | cut -d ' ' -f3-); do
module=${source}
module=${module##*/}
module=${module%%-*}
cp -p ${source} ${module}/pom.xml
%pom_add_parent org.fedoraproject.xmvn.junit5:aggregator:any ${module}
# OSGi BSN
bsn=$(sed 's|/pom.xml$||;s|.*/|org.|;s|-|.|g' <<<"$pom")
%pom_xpath_inject pom:project "<properties><osgi.bsn>${bsn}</osgi.bsn></properties>" $pom
bsn=org.${module//-/.}
%pom_xpath_inject pom:project "<properties><osgi.bsn>${bsn}</osgi.bsn></properties>" ${module}
# Incorrect scope - API guardian is just annotation, needed only during compilation
%pom_xpath_set -f "pom:dependency[pom:artifactId='apiguardian-api']/pom:scope" provided $pom
sed -i s/runtime/compile/ $pom
%pom_xpath_set -f "pom:dependency[pom:artifactId='apiguardian-api']/pom:scope" provided ${module}
%pom_xpath_set -f "pom:dependency[pom:scope='runtime']/pom:scope" "compile" ${module}
done
%pom_remove_parent junit-bom