You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echo"Scanning for yml files including GitHub action files..."
7
10
forfin$(find . -name "*.yml");do
8
11
sed -E 's/Set up JDK [0-9]*/Set up JDK '"$latestJavaLTS"'/g'"$f">"$f""01"
9
12
mv "$f""01""$f"
@@ -13,12 +16,16 @@ if [[ -n $latestJavaLTS ]]; then
13
16
mv "$f""01""$f"
14
17
done
15
18
19
+
# Gradle Java - Version
20
+
echo"Scanning for .java-version files..."
16
21
f=".java-version"
17
22
if [ -f$f ];then
18
23
sed -E "s/[0-9]*/$latestJavaLTS/g""$f">"$f""01"
19
24
mv "$f""01""$f"
20
25
fi
21
26
27
+
# Gradle Files
28
+
echo"Scanning for build.gradle and build.gradle.kts files..."
22
29
forfin$(find . -name "build.gradle*");do
23
30
sed -E 's/java\.sourceCompatibility\s*=\s*JavaVersion\.VERSION_[0-9]*/java.sourceCompatibility = JavaVersion.VERSION_'"$latestJavaLTS"'/g'"$f">"$f""01"
24
31
mv "$f""01""$f"
@@ -28,12 +35,22 @@ if [[ -n $latestJavaLTS ]]; then
28
35
mv "$f""01""$f"
29
36
done
30
37
38
+
# POM Files
39
+
echo"Scanning for pom.xml files..."
31
40
forfin$(find . -name "pom.xml");do
32
41
sed -E "s/<java\.version>[0-9]*<\/java\.version>/<java.version>$latestJavaLTS<\/java.version>/g""$f">"$f""01"
33
42
mv "$f""01""$f"
34
43
sed -E "s/<java\.jdk>[0-9]*<\/java\.jdk>/<java.jdk>$latestJavaLTS<\/java.jdk>/g""$f">"$f""01"
35
44
mv "$f""01""$f"
36
45
done
46
+
47
+
# Docker Files
48
+
echo"Scanning for Docker files..."
49
+
forfin$(find . -name "Dockerfile");do
50
+
sed -E 's/FROM .*jdk.*/FROM '"$targetImage"'/g'"$f">"$f""01"
0 commit comments