Working Dockerfiles for Fedora and Ubuntu, changes to settings and project-creator

This commit is contained in:
Bradley committed 2024-08-17 21:52:12 -04:00
1 parent 472f9f3a68
commit e63cf2a777
4 files changed
+105 -15

No files matched your search

+13 -11
View File
@@ -22,13 +22,6 @@ def show_options(option_list, columns):
print("")
#def show_options(option_list, columns):
# for x in range(0, len(option_list), columns):
# for y in range(x, min(len(option_list), x + columns), 1):
# print("[{opnum}] {option}".format(opnum=y, option=option_list[y]), end=' ')
#
# print("")
def get_selection(option_list, columns, prompt):
selection = ""
@@ -158,7 +151,17 @@ shutil.copytree(vendordeps, os.path.join(new_project_path, "vendordeps"), dirs_e
### END Generate project directories and fill them with the appropriate files
### BEGIN Do find and replace work for java projects and all projects team number config
### BEGIN Do find and replace work for java and cpp projects and all projects team number config
### TODO Opening and closing build.gradle is unnecessarily repetitive,
### Might be better to lose the with calls and manually open/close the files?
with open(os.path.join(new_project_path, "build.gradle"), "r") as gradle_build_file:
gradle_build_content = gradle_build_file.read()
gradle_build_content = gradle_build_content.replace("###GRADLERIOREPLACE###", wpilib_version)
with open(os.path.join(new_project_path, "build.gradle"), "w") as gradle_build_file:
gradle_build_file.write(gradle_build_content)
if project_language == "java":
@@ -167,7 +170,6 @@ if project_language == "java":
with open(os.path.join(new_project_path, "build.gradle"), "r") as gradle_build_file:
gradle_build_content = gradle_build_file.read()
gradle_build_content = gradle_build_content.replace("###GRADLERIOREPLACE###", wpilib_version)
gradle_build_content = gradle_build_content.replace("###ROBOTCLASSREPLACE###", "frc.robot.Main")
with open(os.path.join(new_project_path, "build.gradle"), "w") as gradle_build_file:
@@ -175,7 +177,7 @@ if project_language == "java":
### END Gradle build file changes for Java
### BEGIN *.java find and replace template package in all files
### BEGIN *.java find and replace template/example package in all files
# This regular expression trickery needs to be HEAVILY tested.
# I don't think it's going to hold up everywhere...
@@ -185,7 +187,7 @@ if project_language == "java":
# Note that because the last [option]* list doesn't include period, this
# SHOULD ignore any continuing package structures after what we want to replace,
# this is necessary as to not break command based templates
template_regex = re.compile(r'edu\.wpi\.first\.wpilibj\.templates\.[a-zA-Z0-9]*')
template_regex = re.compile(r'edu\.wpi\.first\.wpilibj\.(templates|examples)\.[a-zA-Z0-9]*')
for file in glob.glob(os.path.join(new_project_path_src, "**", "*.java"), recursive=True):
with open(file, "r") as java_file: