Skip to content

Commit

Permalink
wow
Browse files Browse the repository at this point in the history
  • Loading branch information
allwefantasy committed Aug 10, 2020
1 parent 8be105d commit 2753768
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
36 changes: 36 additions & 0 deletions dev/python/convert_pom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
newlines = []

meet = False
meet1 = False

with open("pom.xml", "r") as reader:
line = reader.readline()
while line:

if "<!-- spark 2.4 end -->" in line:
meet = False

if meet:
newlines.append("<!-- " + line.rstrip("\n") + " -->" + "\n")

if "<!-- spark 2.4 start -->" in line:
newlines.append(line)
meet = True

if "<!-- spark 3.0 end -->" in line:
meet1 = False

if meet1:
newlines.append(line.lstrip().lstrip("<!--").rstrip().rstrip("\n").rstrip("-->") + "\n")

if "<!-- spark 3.0 start -->" in line:
newlines.append(line)
meet1 = True

if not meet and not meet1:
newlines.append(line)

line = reader.readline()

with open("pom.xml","w") as writer:
writer.writelines(newlines)
3 changes: 2 additions & 1 deletion dev/sync.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
git co .
git pull origin TRY
./dev/change-scala-version.sh 2.12
./dev/change-scala-version.sh 2.12
python ./dev/python/convert_pom.py

0 comments on commit 2753768

Please sign in to comment.