2021-04-01 21:10:11 +00:00
|
|
|
import os
|
|
|
|
import xml.etree.ElementTree as ET
|
|
|
|
import shutil
|
|
|
|
import gen
|
|
|
|
|
2022-01-20 18:17:55 +00:00
|
|
|
if (os.getcwd().endswith("SpigotPluginBaseTools/")):
|
2021-04-01 21:10:11 +00:00
|
|
|
os.chdir("../")
|
|
|
|
|
2022-12-08 17:18:21 +00:00
|
|
|
pom_xml = ET.parse(gen.find_pom_xml())
|
|
|
|
pom_root = pom_xml.getroot()
|
|
|
|
proj_name = pom_root.find("{" + gen.POM_NAMESPACE + "}" + "name").text
|
|
|
|
plugin_ver = pom_root.find("{" + gen.POM_NAMESPACE + "}" + "version").text
|
|
|
|
plugin_filename = proj_name + "-" + plugin_ver + ".jar"
|
2021-04-01 21:10:11 +00:00
|
|
|
|
2022-12-08 17:18:21 +00:00
|
|
|
plugin_dir = gen.DEV_SERVER_PATH + "plugins/"
|
|
|
|
if not os.path.exists(plugin_dir):
|
|
|
|
os.mkdir(plugin_dir)
|
2021-04-01 21:10:11 +00:00
|
|
|
|
2022-12-08 17:18:21 +00:00
|
|
|
plugin_path = gen.find_pom_xml_dir() + "/target/{0}".format(plugin_filename)
|
2021-04-01 21:10:11 +00:00
|
|
|
|
2022-12-08 17:18:21 +00:00
|
|
|
if not os.path.exists(plugin_path):
|
|
|
|
print("Could not find \"{0}\". Is it packaged?".format(plugin_path))
|
2021-04-01 21:10:11 +00:00
|
|
|
exit(1)
|
|
|
|
|
2022-12-08 17:18:21 +00:00
|
|
|
shutil.copy(plugin_path, plugin_dir + plugin_filename)
|
|
|
|
print("Copied \"{0}\" to \"{1}\".".format(plugin_path, plugin_dir + plugin_filename))
|