Update icon entries during scons build
This commit is contained in:
parent
2528741333
commit
629062ea26
14
SConstruct
14
SConstruct
|
@ -35,9 +35,19 @@ env = SConscript("godot-cpp/SConstruct")
|
|||
# - LINKFLAGS are for linking flags
|
||||
|
||||
# Generate version header.
|
||||
import limboai_version
|
||||
from limboai_version import generate_module_version_header
|
||||
|
||||
limboai_version.generate_module_version_header()
|
||||
print("Generating LimboAI version header...")
|
||||
generate_module_version_header()
|
||||
|
||||
# Update icon entries in limboai.gdextension file.
|
||||
# Note: This will remove everything after [icons] section, and rebuild it with generated icon entries.
|
||||
sys.path.append("gdextension")
|
||||
from update_icon_entries import update_icon_entries
|
||||
|
||||
print("Updating LimboAI icon entries...")
|
||||
update_icon_entries(silent=True)
|
||||
sys.path.remove("gdextension")
|
||||
|
||||
# Tweak this if you want to use different folders, or more folders, to store your source code in.
|
||||
env.Append(CPPDEFINES=["LIMBOAI_GDEXTENSION"])
|
||||
|
|
|
@ -28,28 +28,7 @@ def get_script_dir():
|
|||
return os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
|
||||
def main():
|
||||
silent = False
|
||||
try:
|
||||
opts, args = getopt.getopt(sys.argv[1:], "s", ["silent"])
|
||||
except getopt.GetoptError as e:
|
||||
print(
|
||||
"%s: %s!\n"
|
||||
% (
|
||||
os.path.basename(__file__),
|
||||
e.msg,
|
||||
)
|
||||
)
|
||||
usage()
|
||||
sys.exit(2)
|
||||
|
||||
for opt, arg in opts:
|
||||
if opt in ("-h", "--help"):
|
||||
usage()
|
||||
sys.exit(0)
|
||||
elif opt in ("-s", "--silent"):
|
||||
silent = True
|
||||
|
||||
def update_icon_entries(silent=False):
|
||||
config_dir = get_script_dir()
|
||||
config_path = os.path.join(config_dir, "limboai.gdextension")
|
||||
content = ""
|
||||
|
@ -83,4 +62,25 @@ def main():
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
silent = False
|
||||
try:
|
||||
opts, args = getopt.getopt(sys.argv[1:], "s", ["silent"])
|
||||
except getopt.GetoptError as e:
|
||||
print(
|
||||
"%s: %s!\n"
|
||||
% (
|
||||
os.path.basename(__file__),
|
||||
e.msg,
|
||||
)
|
||||
)
|
||||
usage()
|
||||
sys.exit(2)
|
||||
|
||||
for opt, arg in opts:
|
||||
if opt in ("-h", "--help"):
|
||||
usage()
|
||||
sys.exit(0)
|
||||
elif opt in ("-s", "--silent"):
|
||||
silent = True
|
||||
|
||||
update_icon_entries(silent)
|
||||
|
|
Loading…
Reference in New Issue