rename typefiles to be consistent with nexus
[dcaegen2/platform/plugins.git] / makefile
1 none:
2         @echo make verify-versions
3
4 verify-versions:
5         @echo check pom.xml against setup.py and types.yaml files
6         @for i in */pom.xml; do \
7                 p=$$(dirname $$i); \
8                 echo Working on $$i; \
9                 v=$$(grep "<version>" $$i | sed 2q | tail -n 1 | sed -e 's!</\?version>!!g' -e 's/-SNAPSHOT//' -e 's/[[:space:]]//g'); \
10                 if grep 'version[[:space:]]*=[[:space:]]*["'"']$$v['"'"]' $$p/setup.py > /dev/null; then \
11                         echo "$$i version $$v verified in $$p/setup.py"; \
12                 else \
13                         grep -n "<version>" $$i /dev/null | sed 2q | tail -n 1; \
14                         grep -n "version[[:space:]]*=" $$p/setup.py /dev/null; \
15                         echo "$$i version $$v not found in $$p/setup.py. Instead found the above version."; \
16                         exit 1 ; \
17                 fi; \
18                 typefiles=$$( grep -l "package_version[[:space:]]*:" $$p/* 2>/dev/null ); \
19                 if [ -z "$$typefiles" ]; then \
20                         echo "No type files found in $$p"; \
21                         exit 1 ; \
22                 else \
23                         for typefile in $$typefiles; do \
24                                 if grep "package_version:[[:space:]]*$$v" "$$typefile" > /dev/null 2>&1; then \
25                                         echo "$$i version $$v verified in" "$$typefile"; \
26                                 else \
27                                         grep -n "<version>" $$i /dev/null | sed 2q | tail -n 1; \
28                                         grep -n "package_version:" "$$typefile" /dev/null; \
29                                         exit 1 ; \
30                                 fi; \
31                         done; \
32                 fi; \
33                 echo; \
34         done
35         @pomv=$$(grep "<version>" pom.xml | sed 2q | tail -n 1 | sed -e 's!</\?version>!!g' -e 's/[[:space:]]//g'); \
36         for i in */pom.xml; do \
37                 v=$$(grep "<version>" $$i | sed 1q | sed -e 's!</\?version>!!g' -e 's/[[:space:]]//g'); \
38                 if [ "$$pomv" = "$$v" ]; then \
39                         echo "pom.xml version $$pomv verified in $$i"; \
40                 else \
41                         grep -n "<version>" $$i /dev/null | sed 1q; \
42                         echo "pom.xml version $$pomv not found in $$i. Instead found $$v"; \
43                         exit 1 ; \
44                 fi; \
45         done