From 8fdcad4ec7e8a2b59e6b3e29a68ba8b6e80045eb Mon Sep 17 00:00:00 2001 From: neuecc Date: Fri, 11 Oct 2019 19:03:25 +0900 Subject: [PATCH] copy dotnet dll to plugins --- .../Scripts/MessagePack/MessagePack.asmdef | 3 ++- src/MessagePack.UnityClient/copy_assets.bat | 20 +++++++++++++++ src/MessagePack.UnityClient/link_assets.bat | 20 --------------- src/MessagePack.UnityClient/link_assets.sh | 25 ------------------- 4 files changed, 22 insertions(+), 46 deletions(-) create mode 100644 src/MessagePack.UnityClient/copy_assets.bat delete mode 100644 src/MessagePack.UnityClient/link_assets.bat delete mode 100755 src/MessagePack.UnityClient/link_assets.sh diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePack.asmdef b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePack.asmdef index e569d073..0b434a44 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePack.asmdef +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePack.asmdef @@ -8,5 +8,6 @@ "overrideReferences": false, "precompiledReferences": [], "autoReferenced": true, - "defineConstraints": [] + "defineConstraints": [], + "versionDefines": [] } \ No newline at end of file diff --git a/src/MessagePack.UnityClient/copy_assets.bat b/src/MessagePack.UnityClient/copy_assets.bat new file mode 100644 index 00000000..9ea1a444 --- /dev/null +++ b/src/MessagePack.UnityClient/copy_assets.bat @@ -0,0 +1,20 @@ +:: Link in the binaries we build or restore, that Unity expects inside its Assets directory. +@SETLOCAL +@if "%CONFIG%"=="" SET CONFIG=Release +@IF NOT EXIST "%~dp0..\..\bin\MessagePack\%CONFIG%\netstandard2.0\publish" ( + dotnet publish "%~dp0..\MessagePack" -c release -f netstandard2.0 + IF ERRORLEVEL 1 EXIT /B %ERRORLEVEL% +) + +@pushd %~dp0 + +echo F | xcopy "..\..\bin\MessagePack\release\netstandard2.0\publish\Microsoft.VisualStudio.Validation.dll" ".\Assets\Plugins\Microsoft.VisualStudio.Validation.dll" /Y /I +echo F | xcopy "..\..\bin\MessagePack\release\netstandard2.0\publish\Microsoft.VisualStudio.Threading.dll" ".\Assets\Plugins\Microsoft.VisualStudio.Threading.dll" /Y /I +echo F | xcopy "..\..\bin\MessagePack\release\netstandard2.0\publish\Nerdbank.Streams.dll" ".\Assets\Plugins\Nerdbank.Streams.dll" /Y /I +echo F | xcopy "..\..\bin\MessagePack\release\netstandard2.0\publish\System.IO.Pipelines.dll" ".\Assets\Plugins\System.IO.Pipelines.dll" /Y /I +echo F | xcopy "..\..\bin\MessagePack\release\netstandard2.0\publish\System.Buffers.dll" ".\Assets\Plugins\System.Buffers.dll" /Y /I +echo F | xcopy "..\..\bin\MessagePack\release\netstandard2.0\publish\System.Memory.dll" ".\Assets\Plugins\System.Memory.dll" /Y /I +echo F | xcopy "..\..\bin\MessagePack\release\netstandard2.0\publish\System.Runtime.CompilerServices.Unsafe.dll" ".\Assets\Plugins\System.Runtime.CompilerServices.Unsafe.dll" /Y /I +echo F | xcopy "..\..\bin\MessagePack\release\netstandard2.0\publish\System.Threading.Tasks.Extensions.dll" ".\Assets\Plugins\System.Threading.Tasks.Extensions.dll" /Y /I + +@popd diff --git a/src/MessagePack.UnityClient/link_assets.bat b/src/MessagePack.UnityClient/link_assets.bat deleted file mode 100644 index 88d0af1f..00000000 --- a/src/MessagePack.UnityClient/link_assets.bat +++ /dev/null @@ -1,20 +0,0 @@ -:: Link in the binaries we build or restore, that Unity expects inside its Assets directory. -@SETLOCAL -@if "%CONFIG%"=="" SET CONFIG=Release -@IF NOT EXIST "%~dp0..\..\bin\MessagePack\%CONFIG%\netstandard2.0\publish" ( - dotnet publish "%~dp0..\MessagePack" -c release -f netstandard2.0 - IF ERRORLEVEL 1 EXIT /B %ERRORLEVEL% -) - -@pushd %~dp0 - -mklink ".\Assets\Microsoft.VisualStudio.Validation.dll" "..\..\..\bin\MessagePack\%CONFIG%\netstandard2.0\publish\Microsoft.VisualStudio.Validation.dll" -mklink ".\Assets\Microsoft.VisualStudio.Threading.dll" "..\..\..\bin\MessagePack\%CONFIG%\netstandard2.0\publish\Microsoft.VisualStudio.Threading.dll" -mklink ".\Assets\Nerdbank.Streams.dll" "..\..\..\bin\MessagePack\%CONFIG%\netstandard2.0\publish\Nerdbank.Streams.dll" -mklink ".\Assets\System.IO.Pipelines.dll" "..\..\..\bin\MessagePack\%CONFIG%\netstandard2.0\publish\System.IO.Pipelines.dll" -mklink ".\Assets\System.Buffers.dll" "..\..\..\bin\MessagePack\%CONFIG%\netstandard2.0\publish\System.Buffers.dll" -mklink ".\Assets\System.Memory.dll" "..\..\..\bin\MessagePack\%CONFIG%\netstandard2.0\publish\System.Memory.dll" -mklink ".\Assets\System.Runtime.CompilerServices.Unsafe.dll" "..\..\..\bin\MessagePack\%CONFIG%\netstandard2.0\publish\System.Runtime.CompilerServices.Unsafe.dll" -mklink ".\Assets\System.Threading.Tasks.Extensions.dll" "..\..\..\bin\MessagePack\%CONFIG%\netstandard2.0\publish\System.Threading.Tasks.Extensions.dll" - -@popd diff --git a/src/MessagePack.UnityClient/link_assets.sh b/src/MessagePack.UnityClient/link_assets.sh deleted file mode 100755 index 0f1d39c4..00000000 --- a/src/MessagePack.UnityClient/link_assets.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# Link in the binaries we build or restore, that Unity expects inside its Assets directory. - -if ! [[ -v BuildConfiguration ]] ; then BuildConfiguration=Release; fi - -SCRIPT_DIR=$(dirname "$(realpath $0)") -SRCDIR=${SCRIPT_DIR}/../../bin/MessagePack/${BuildConfiguration}/netstandard2.0/publish - -if ! [ -d "${SRCDIR}" ] ; then - dotnet publish "${SCRIPT_DIR}/../MessagePack" -c ${BuildConfiguration} -f netstandard2.0 -fi - -pushd ${SCRIPT_DIR} - -ln -s "${SRCDIR}/Microsoft.VisualStudio.Validation.dll" "Assets/Microsoft.VisualStudio.Validation.dll" -ln -s "${SRCDIR}/Microsoft.VisualStudio.Threading.dll" "Assets/Microsoft.VisualStudio.Threading.dll" -ln -s "${SRCDIR}/Nerdbank.Streams.dll" "Assets/Nerdbank.Streams.dll" -ln -s "${SRCDIR}/System.IO.Pipelines.dll" "Assets/System.IO.Pipelines.dll" -ln -s "${SRCDIR}/System.Buffers.dll" "Assets/System.Buffers.dll" -ln -s "${SRCDIR}/System.Memory.dll" "Assets/System.Memory.dll" -ln -s "${SRCDIR}/System.Runtime.CompilerServices.Unsafe.dll" "Assets/System.Runtime.CompilerServices.Unsafe.dll" -ln -s "${SRCDIR}/System.Threading.Tasks.Extensions.dll" "Assets/System.Threading.Tasks.Extensions.dll" - -popd