Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,13 @@ if env["platform"] == "macos" and os.environ.get("OSXCROSS_ROOT", ""):
opts.Update(env)

target = env["target"]
addon_name = "webrtc_native"
if env["godot_version"] == "3":
result_path = os.path.join("bin", "gdnative", "webrtc" if env["target"] == "release" else "webrtc_debug")
if env["target"] != "release":
addon_name = "webrtc_native_debug"
result_path = os.path.join("bin", "gdnative", "addons", addon_name)
else:
result_path = os.path.join("bin", "extension", "webrtc")
result_path = os.path.join("bin", "extension", "addons", addon_name)

# Our includes and sources
env.Append(CPPPATH=["src/"])
Expand Down Expand Up @@ -238,17 +241,16 @@ Default(library)

# GDNativeLibrary
if env["godot_version"] == "3":
gdnlib = "webrtc" if target != "debug" else "webrtc_debug"
ext = ".tres"
extfile = env.Substfile(
os.path.join(result_path, gdnlib + ext),
"misc/webrtc" + ext,
os.path.join(result_path, addon_name + ".tres"),
"misc/cfg.tres",
SUBST_DICT={
"{GDNATIVE_PATH}": gdnlib,
"{GDNATIVE_PATH}": "addons/" + addon_name,
"{TARGET}": "template_" + env["target"],
},
)
else:
extfile = env.InstallAs(os.path.join(result_path, "webrtc.gdextension"), "misc/webrtc.gdextension")
extfile = env.InstallAs(os.path.join(result_path, addon_name + ".gdextension"), "misc/cfg.gdextension")

Default(extfile)
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions misc/scripts/package_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@ set -x
ARTIFACTS=${ARTIFACTS:-"artifacts"}
DESTINATION=${DESTINATION:-"release"}
VERSION=${VERSION:-"extension"}
TYPE=${TYPE:-"webrtc"}
ADDON_NAME=${ADDON_NAME:-"webrtc_native"}

mkdir -p ${DESTINATION}
ls -R ${DESTINATION}
ls -R ${ARTIFACTS}

DESTDIR="${DESTINATION}/${VERSION}/${TYPE}"
DESTDIR="${DESTINATION}/${VERSION}/addons/${ADDON_NAME}"

mkdir -p ${DESTDIR}/lib

find "${ARTIFACTS}" -maxdepth 5 -wholename "*/${VERSION}/${TYPE}/lib/*" | xargs cp -r -t "${DESTDIR}/lib/"
find "${ARTIFACTS}" -maxdepth 6 -wholename "*/${VERSION}/addons/${ADDON_NAME}/lib/*" | xargs cp -r -t "${DESTDIR}/lib/"
find "${ARTIFACTS}" -wholename "*/LICENSE*" | xargs cp -t "${DESTDIR}/"

if [ $VERSION = "gdnative" ]; then
find "${ARTIFACTS}" -wholename "*/${VERSION}/${TYPE}/${TYPE}.tres" | head -n 1 | xargs cp -t "${DESTDIR}/"
find "${ARTIFACTS}" -wholename "*/${VERSION}/addons/${ADDON_NAME}/${ADDON_NAME}.tres" | head -n 1 | xargs cp -t "${DESTDIR}/"
else
find "${ARTIFACTS}" -wholename "*/${VERSION}/${TYPE}/${TYPE}.gdextension" | head -n 1 | xargs cp -t "${DESTDIR}/"
find "${ARTIFACTS}" -wholename "*/${VERSION}/addons/${ADDON_NAME}/${ADDON_NAME}.gdextension" | head -n 1 | xargs cp -t "${DESTDIR}/"
fi

CURDIR=$(pwd)
cd "${DESTINATION}/${VERSION}"
zip -r ../godot-${VERSION}-${TYPE}.zip ${TYPE}
zip -r ../godot-${VERSION}-${ADDON_NAME}.zip addons
cd "$CURDIR"

ls -R ${DESTINATION}
Loading