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("../")
|
|
|
|
|
|
|
|
pomxml = ET.parse(gen.find_pomxml())
|
|
|
|
pomroot = pomxml.getroot()
|
|
|
|
projname = pomroot.find("{" + gen.POM_NAMESPACE + "}" + "name").text
|
|
|
|
pluginver = pomroot.find("{" + gen.POM_NAMESPACE + "}" + "version").text
|
|
|
|
pluginfilename = projname + "-" + pluginver + ".jar"
|
|
|
|
|
2022-01-20 18:23:30 +00:00
|
|
|
plugindir = gen.DEV_SERVER_PATH + "plugins/"
|
2021-04-01 21:10:11 +00:00
|
|
|
if not os.path.exists(plugindir):
|
|
|
|
os.mkdir(plugindir)
|
|
|
|
|
|
|
|
pluginpath = gen.find_pomxmldir() + "/target/{0}".format(pluginfilename)
|
|
|
|
|
|
|
|
if not os.path.exists(pluginpath):
|
|
|
|
print("Could not find \"{0}\". Is it packaged?".format(pluginpath))
|
|
|
|
exit(1)
|
|
|
|
|
|
|
|
shutil.copy(pluginpath, plugindir + pluginfilename)
|
|
|
|
print("Copied \"{0}\" to \"{1}\".".format(pluginpath, plugindir + pluginfilename))
|