diff --git a/templates/create_formula/languages/csharp/Makefile b/templates/create_formula/languages/csharp/Makefile index 5a809ad2..e229eb9c 100644 --- a/templates/create_formula/languages/csharp/Makefile +++ b/templates/create_formula/languages/csharp/Makefile @@ -2,21 +2,17 @@ SOURCE_FILE=src/src.csproj BIN_FOLDER=bin BIN_FOLDER_LINUX=linux -BIN_FOLDER_WINDOWS=windows BIN_FOLDER_DARWIN=darwin -BIN_UNIX=src -BIN_WINDOWS=src.exe +BIN_UNIX=src.dll SH=$(BIN_FOLDER)/run.sh -BAT=$(BIN_FOLDER)/run.bat -build: linux-build windows-build macOS-build sh-unix bat-windows docker +build: linux-build macOS-build sh-unix docker linux-build: - mkdir -p $(BIN_FOLDER)/$(BIN_FOLDER_LINUX) - dotnet build $(SOURCE_FILE) -o $(BIN_FOLDER)/$(BIN_FOLDER_LINUX) --configuration Release --runtime linux-x64 -windows-build: - mkdir -p $(BIN_FOLDER)/$(BIN_FOLDER_WINDOWS) - dotnet build $(SOURCE_FILE) -o $(BIN_FOLDER)/$(BIN_FOLDER_WINDOWS) --configuration Release --runtime win10-x64 + mkdir -p $(BIN_FOLDER) + cp -r src/* $(BIN_FOLDER) + dotnet build $(SOURCE_FILE) -o $(BIN_FOLDER)/$(BIN_FOLDER_LINUX) --configuration Release + macOS-build: mkdir -p $(BIN_FOLDER)/$(BIN_FOLDER_DARWIN) dotnet build $(SOURCE_FILE) -o $(BIN_FOLDER)/$(BIN_FOLDER_DARWIN) --configuration Release --runtime osx-x64 @@ -24,15 +20,11 @@ macOS-build: sh-unix: echo '#!/bin/sh' > $(SH) echo 'if [ $$(uname) = "Darwin" ]; then' >> $(SH) - echo ' "$$(dirname "$$0")"/$(BIN_FOLDER_DARWIN)/$(BIN_UNIX)' >> $(SH) + echo ' dotnet "$$(dirname "$$0")"/$(BIN_FOLDER_DARWIN)/$(BIN_UNIX)' >> $(SH) echo 'else' >> $(SH) - echo ' "$$(dirname "$$0")"/$(BIN_FOLDER_LINUX)/$(BIN_UNIX)' >> $(SH) + echo ' dotnet "$$(dirname "$$0")"/$(BIN_FOLDER_LINUX)/$(BIN_UNIX)' >> $(SH) echo 'fi' >> $(SH) chmod +x $(SH) -bat-windows: - echo '@ECHO OFF' > $(BAT) - echo '%~dp0$(BIN_FOLDER_WINDOWS)/$(BIN_WINDOWS)' >> $(BAT) - docker: cp Dockerfile set_umask.sh $(BIN_FOLDER) diff --git a/templates/create_formula/languages/csharp/build.bat b/templates/create_formula/languages/csharp/build.bat index 54f684b4..c9b4ca09 100755 --- a/templates/create_formula/languages/csharp/build.bat +++ b/templates/create_formula/languages/csharp/build.bat @@ -3,38 +3,21 @@ echo off SETLOCAL SET SOURCE_FILE=src/src.csproj SET BIN_FOLDER=bin -SET BIN_FOLDER_LINUX=linux SET BIN_FOLDER_WINDOWS=windows -SET BIN_FOLDER_DARWIN=darwin -SET BIN_UNIX=src SET BIN_WINDOWs=src.exe -SET SH_FILE=%BIN_FOLDER%\run.sh SET BAT_FILE=%BIN_FOLDER%\run.bat - :build - mkdir %BIN_FOLDER%/%BIN_FOLDER_LINUX% - dotnet build %SOURCE_FILE% -o %BIN_FOLDER%/%BIN_FOLDER_LINUX% --configuration Release --runtime linux-x64 - mkdir %BIN_FOLDER%/%BIN_FOLDER_WINDOWS% - dotnet build %SOURCE_FILE% -o %BIN_FOLDER%/%BIN_FOLDER_WINDOWS% --configuration Release --runtime win10-x64 + mkdir %BIN_FOLDER% + xcopy /E /I src %BIN_FOLDER% + dotnet build %SOURCE_FILE% -o %BIN_FOLDER%/%BIN_FOLDER_WINDOWS% --configuration Release CALL :BAT_WINDOWS - CALL :SH_LINUX CALL :CP_DOCKER GOTO DONE :BAT_WINDOWS echo @ECHO OFF > %BAT_FILE% - echo %%~dp0%BIN_FOLDER_WINDOWS%/%BIN_WINDOWS% >> %BAT_FILE% - GOTO DONE - -:SH_LINUX - echo #!/bin/sh > %SH_FILE% - echo if [ $(uname) = "Darwin" ]; then >> %SH_FILE% - echo $(dirname $0)/%BIN_FOLDER_DARWIN%/%BIN_UNIX% >> %SH_FILE% - echo else >> %SH_FILE% - echo $(dirname $0)/%BIN_FOLDER_LINUX%/%BIN_UNIX% >> %SH_FILE% - echo fi >> %SH_FILE% - chmod +x %SH_FILE% + echo %%~dp0%BIN_FOLDER%/src.exe >> %BAT_FILE% GOTO DONE :CP_DOCKER