forked from avaje/avaje-inject
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjavax-to-jakarta.sh
executable file
·31 lines (23 loc) · 1.62 KB
/
javax-to-jakarta.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
30
31
#!/usr/bin/env bash
## adjust pom dependencies
sed -i 's/\(<version>[^<]*\)-javax\([^<]*<\/version>\)/\1\2/' pom.xml
sed -i 's/\(<version>[^<]*\)-javax\([^<]*<\/version>\)/\1\2/' inject/pom.xml
sed -i 's/\(<version>[^<]*\)-javax\([^<]*<\/version>\)/\1\2/' inject-aop/pom.xml
sed -i 's/\(<version>[^<]*\)-javax\([^<]*<\/version>\)/\1\2/' inject-events/pom.xml
sed -i 's/\(<version>[^<]*\)-javax\([^<]*<\/version>\)/\1\2/' inject-generator/pom.xml
sed -i 's/\(<version>[^<]*\)-javax\([^<]*<\/version>\)/\1\2/' inject-maven-plugin/pom.xml
sed -i 's/\(<version>[^<]*\)-javax\([^<]*<\/version>\)/\1\2/' inject-test/pom.xml
sed -i 's/\(<version>[^<]*\)-javax\([^<]*<\/version>\)/\1\2/' blackbox-aspect/pom.xml
sed -i 's/\(<version>[^<]*\)-javax\([^<]*<\/version>\)/\1\2/' blackbox-other/pom.xml
sed -i 's/\(<version>[^<]*\)-javax\([^<]*<\/version>\)/\1\2/' blackbox-test-inject/pom.xml
sed -i '' -e 's|<version>1\.0\.5</version> <!-- javax -->|<version>2\.0\.1</version> <!-- jakarta -->|g' inject/pom.xml
## adjust module-info
sed -i '' -e 's| java\.inject| jakarta\.inject|g' inject/src/main/java/module-info.java
## adjust code
find . -type f -not -name 'IncludeAnnotations.java' -name '*.java' -exec sed -i '' -e 's|javax\.inject\.|jakarta\.inject\.|g' {} +
## Linux version
sed -i'' -e 's|<version>1\.0\.5</version> <!-- javax -->|<version>2\.0\.1</version> <!-- jakarta -->|g' inject/pom.xml
## adjust module-info
sed -i'' -e 's| java\.inject| jakarta\.inject|g' inject/src/main/java/module-info.java
## adjust code
find . -type f -not -name 'IncludeAnnotations.java' -name '*.java' -exec sed -i'' -e 's|javax\.inject\.|jakarta\.inject\.|g' {} +