|
|
@@ -27,7 +27,7 @@ def buildReferencesXml(path): |
|
|
|
return "<!--Start Dependencies-->\n <ItemGroup>\n" + "".join(result) + " </ItemGroup>\n<!--End Dependencies-->" |
|
|
|
|
|
|
|
if __name__ == "__main__": |
|
|
|
parser = argparse.ArgumentParser(description="Generate GamecraftModdingAPI.csproj") |
|
|
|
parser = argparse.ArgumentParser(description="Generate TechbloxModdingAPI.csproj") |
|
|
|
# TODO (maybe?): add params for custom csproj read and write locations |
|
|
|
args = parser.parse_args() |
|
|
|
|
|
|
@@ -35,8 +35,8 @@ if __name__ == "__main__": |
|
|
|
asmXml = buildReferencesXml("../ref/TechbloxPreview_Data/Managed") |
|
|
|
# print(asmXml) |
|
|
|
|
|
|
|
with open("../GamecraftModdingAPI/GamecraftModdingAPI.csproj", "r") as xmlFile: |
|
|
|
print("Parsing GamecraftModdingAPI.csproj") |
|
|
|
with open("../TechbloxModdingAPI/TechbloxModdingAPI.csproj", "r") as xmlFile: |
|
|
|
print("Parsing TechbloxModdingAPI.csproj") |
|
|
|
fileStr = xmlFile.read() |
|
|
|
# print(fileStr) |
|
|
|
depsStart = re.search(r"\<!--\s*Start\s+Dependencies\s*--\>", fileStr) |
|
|
@@ -45,7 +45,7 @@ if __name__ == "__main__": |
|
|
|
print("Unable to find dependency XML comments, aborting!") |
|
|
|
exit(1) |
|
|
|
newFileStr = fileStr[:depsStart.start()] + "\n" + asmXml + "\n" + fileStr[depsEnd.end() + 1:] |
|
|
|
with open("../GamecraftModdingAPI/GamecraftModdingAPI.csproj", "w") as xmlFile: |
|
|
|
with open("../TechbloxModdingAPI/TechbloxModdingAPI.csproj", "w") as xmlFile: |
|
|
|
print("Writing Assembly references") |
|
|
|
xmlFile.write(newFileStr) |
|
|
|
# print(newFileStr) |
|
|
|