Skip to content

Commit

Permalink
Merge pull request #28 from wit-ai/add_plugin_flavour
Browse files Browse the repository at this point in the history
add plugin flavour
  • Loading branch information
wangpingsx authored Jan 26, 2023
2 parents 323c17b + 475be07 commit 80f99b8
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,6 @@ scripts/all-in-one/UE5_1/workspace
scripts/all-in-one/UE5_1/output/*
scripts/all-in-one/github_UE4/workspace
scripts/all-in-one/github_UE4/output/*
scripts/all-in-one/TP/workspace
scripts/all-in-one/TP/output/*

8 changes: 8 additions & 0 deletions scripts/all-in-one/TP/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
:: Copyright (c) Meta Platforms, Inc. and affiliates.
::
:: This source code is licensed under the license found in the
:: LICENSE file in the root directory of this source tree.

echo off

../utils/all_in_one_packaging.bat 4.27 TP
2 changes: 1 addition & 1 deletion scripts/all-in-one/UE4/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@

echo off

../utils/all_in_one_packaging.bat 4.27
../utils/all_in_one_packaging.bat 4.27 MP
2 changes: 1 addition & 1 deletion scripts/all-in-one/UE5_0/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@

echo off

../utils/all_in_one_packaging.bat 5.0
../utils/all_in_one_packaging.bat 5.0 MP
2 changes: 1 addition & 1 deletion scripts/all-in-one/UE5_1/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@

echo off

../utils/all_in_one_packaging.bat 5.1
../utils/all_in_one_packaging.bat 5.1 MP
1 change: 1 addition & 0 deletions scripts/all-in-one/github_UE4/all_in_one_packaging.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ git clone https://github.com/wit-ai/voicesdk-unreal
git clone https://github.com/wit-ai/wit-unreal

node ../../update_WITH_VOICESDK_USERAGENT_flag.js
node ../../utils/update_plugin_flavour.js aio

cd voicesdk-unreal
rmdir /s /q .git
Expand Down
8 changes: 6 additions & 2 deletions scripts/all-in-one/utils/all_in_one_packaging.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@

echo off
IF "%1"=="" GOTO arg_not_exists

IF "%2"=="" GOTO arg_not_exists
set unrealVersion=%1
set pluginFlavour=%2

rmdir /s /q output
mkdir output
Expand All @@ -24,11 +25,14 @@ git clone https://github.com/wit-ai/voicesdk-unreal
echo ">> 3. add WITH_VOICESDK macro for 'create preset' feature, this can be removed if 2 repos merged."
node ../../utils/update_WITH_VOICESDK_flag.js
node ../../utils/update_WITH_VOICESDK_MARKETPLACE_flag.js

echo ">> 3.1 change useragent."
node ../../update_WITH_VOICESDK_USERAGENT_flag.js
echo ">> 3.2 change plugin flavour."
node ../../utils/update_plugin_flavour.js %pluginFlavour%

echo ">> 4. Copy code and content from wit to voicesdk"
powershell -Command "cp ./wit-unreal/Source/* ./voicesdk-unreal/Source/ -recurse -force"
powershell -Command "Copy-Item ./wit-unreal/Content -Destination ./voicesdk-unreal/ -recurse -force"

powershell -Command "Copy-Item ../../utils/VoiceSDK.uplugin -Destination ./voicesdk-unreal/"
powershell -Command "Copy-Item ../../utils/Config -Destination ./voicesdk-unreal/ -recurse"
Expand Down
20 changes: 20 additions & 0 deletions scripts/all-in-one/utils/update_plugin_flavour.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the license found in the
* LICENSE file in the root directory of this source tree.
*/

const updateFileAsync = require("../../helper");

const FILE_PATH = 'wit-unreal\\Source\\Wit\\Private\\Wit\\Request\\HTTP\\WitHttpRequest.cpp';
const PLUGIN_FLAVOUR_KEY_STRING_START = 'const FString PluginFlavour = FString("';
const PLUGIN_FLAVOUR_KEY_STRING_END = '"';

console.log(process.argv);

if(process.argv.length < 3) {
console.log('Please call this script with : node update_Plugin_flavour.js xxx');
}

updateFileAsync(FILE_PATH, PLUGIN_FLAVOUR_KEY_STRING_START, process.argv[2], PLUGIN_FLAVOUR_KEY_STRING_END);

0 comments on commit 80f99b8

Please sign in to comment.