1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-11-19 00:04:53 +00:00

Add a version guard to go4it

Ideally we'd have one in Gradle too, but eh.
This commit is contained in:
Jonathan Coates 2021-04-24 12:02:27 +01:00
parent 27770a3172
commit 21207cb405

14
go4it
View File

@ -13,6 +13,8 @@ import argparse
import subprocess import subprocess
import shutil import shutil
import sys import sys
import re
import os
import os.path import os.path
from dataclasses import dataclass from dataclasses import dataclass
from typing import List, Tuple, Optional from typing import List, Tuple, Optional
@ -110,11 +112,23 @@ def check_git() -> None:
sys.exit(1) sys.exit(1)
def check_java() -> None:
home = os.getenv("JAVA_HOME")
java = "java" if home is None else os.path.join(home, "bin/java")
result = subprocess.check_output([java, "-version"], encoding="utf-8", stderr=subprocess.STDOUT)
if not re.search(r"\b1\.8\.\b", result): # Who needs actual version checks!
log(f"Not running under Java 8! Things are probably not going to go well.")
sys.stdout.write(result)
sys.exit(1)
def build() -> None: def build() -> None:
""" """
Merge in parent branches, then build all branches. Merge in parent branches, then build all branches.
""" """
check_git() check_git()
check_java()
# Merge each branch into the next one. # Merge each branch into the next one.
for branch in BRANCHES: for branch in BRANCHES: