forked from avaje/avaje-inject
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjakarta-to-javax.sh
executable file
·29 lines (22 loc) · 2.1 KB
/
jakarta-to-javax.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env bash
## adjust pom dependencies
sed -i -E '0,/<version>[^<]*<\/version>/ s/<version>([^-]*)-?([^<]*)(<\/version>)/<version>\1-javax\2\3/' pom.xml
sed -i -E '0,/<version>[^<]*<\/version>/ s/<version>([^-]*)-?([^<]*)(<\/version>)/<version>\1-javax\2\3/' inject/pom.xml
sed -i -E '0,/<version>[^<]*<\/version>/ s/<version>([^-]*)-?([^<]*)(<\/version>)/<version>\1-javax\2\3/' inject-aop/pom.xml
sed -i -E '0,/<version>[^<]*<\/version>/ s/<version>([^-]*)-?([^<]*)(<\/version>)/<version>\1-javax\2\3/' inject-events/pom.xml
sed -i -E '0,/<version>[^<]*<\/version>/ s/<version>([^-]*)-?([^<]*)(<\/version>)/<version>\1-javax\2\3/' inject-generator/pom.xml
sed -i -E '0,/<version>[^<]*<\/version>/ s/<version>([^-]*)-?([^<]*)(<\/version>)/<version>\1-javax\2\3/' inject-maven-plugin/pom.xml
sed -i -E '0,/<version>[^<]*<\/version>/ s/<version>([^-]*)-?([^<]*)(<\/version>)/<version>\1-javax\2\3/' inject-test/pom.xml
sed -i -E '0,/<version>[^<]*<\/version>/ s/<version>([^-]*)-?([^<]*)(<\/version>)/<version>\1-javax\2\3/' blackbox-aspect/pom.xml
sed -i -E '0,/<version>[^<]*<\/version>/ s/<version>([^-]*)-?([^<]*)(<\/version>)/<version>\1-javax\2\3/' blackbox-other/pom.xml
sed -i -E '0,/<version>[^<]*<\/version>/ s/<version>([^-]*)-?([^<]*)(<\/version>)/<version>\1-javax\2\3/' blackbox-test-inject/pom.xml
sed -i '' -e 's|<version>2\.0\.1</version> <!-- jakarta -->|<version>1\.0\.5</version> <!-- javax -->|g' inject/pom.xml
## adjust module-info
sed -i '' -e 's| jakarta\.inject| java\.inject|g' inject/src/main/java/module-info.java
## adjust code
#find . -type f -name '*.java' -exec sed -i'' -e 's| jakarta\.inject\.| javax\.inject\.|g' {} +
find . -type f -not -name 'IncludeAnnotations.java' -name '*.java' -exec sed -i '' -e 's|jakarta\.inject\.|javax\.inject\.|g' {} +
## linux sed
sed -i'' -e 's|<version>2\.0\.1</version> <!-- jakarta -->|<version>1\.0\.5</version> <!-- javax -->|g' inject/pom.xml
sed -i'' -e 's| jakarta\.inject| java\.inject|g' inject/src/main/java/module-info.java
find . -type f -not -name 'IncludeAnnotations.java' -name '*.java' -exec sed -i'' -e 's|jakarta\.inject\.|javax\.inject\.|g' {} +