Skip to content

Commit

Permalink
Release C3 publicly
Browse files Browse the repository at this point in the history
  • Loading branch information
grzryc committed Sep 2, 2019
0 parents commit 6d4eda6
Show file tree
Hide file tree
Showing 519 changed files with 107,078 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.vs/
Bin/
CreateBuild/
Tmp/
obj/
.vscode
*.ipch
*.exe
*.dll
*.pdb
*.db
*.db-journal
*.vcxproj.user
*c3-web-api-log*
PER_BUILD_DYNAMIC_SIGNATURE_SEED.hpp
__pycache__
Src/Common/C3_BUILD_VERSION_HASH_PART.hxx
Builds/
1 change: 1 addition & 0 deletions CleanBinFiles.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FOR /d /r . %%d IN (Bin) DO @IF EXIST "%%d" rd /s /q "%%d"
16 changes: 16 additions & 0 deletions CleanTempFiles.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
set DIR=%CD%
FOR /d /r . %%d IN (.vs) DO @IF EXIST "%%d" rd /s /q "%%d"
FOR /d /r . %%d IN (Tmp) DO @IF EXIST "%%d" rd /s /q "%%d"
del /s *.obj
del /s *.o
del /s *.pch
del /s *.ipch
del /s *.lastbuildstate
del /s *.tlog
del /s *.pdb
del /s *.ilk
del /s *.idb
del /s *.gch
del /s *.suo
del /s *.VC.db
for /f "usebackq delims=" %%d in (`"dir /ad/b/s | sort /R"`) do rd "%%d"
86 changes: 86 additions & 0 deletions CreateBuild.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
@REM This script requires MSBuild in PATH.

@REM Adjust values below before running this script.
@SETLOCAL
@SET BUILD_MAJOR_NO=1
@SET BUILD_MINOR_NO=0
@SET BUILD_REVISION_NO=0
@SET BUILD_PREFIX=C3
@SET BUILD_HEADER_FILE=Src\Common\C3_BUILD_VERSION_HASH_PART.hxx
@SET BUILDS_PATH=Builds

@REM Script part starts here.
@ECHO OFF

ECHO Cleaning from temporary files...
@CALL CleanTempFiles.cmd >nul 2>nul

ECHO Ensuring '%BUILDS_PATH%' folder exists...
IF EXIST "%BUILDS_PATH%" (RMDIR /s /q "%BUILDS_PATH%")
MKDIR %BUILDS_PATH%

SET BUILD_FULL_SIGNATURE=%BUILD_PREFIX%-%BUILD_MAJOR_NO%.%BUILD_MINOR_NO%.%BUILD_REVISION_NO%

ECHO Creating build folder - '%BUILD_FULL_SIGNATURE%'...
IF EXIST %BUILDS_PATH%\\%BUILD_FULL_SIGNATURE% (RMDIR /s /q "%BUILDS_PATH%\\%BUILD_FULL_SIGNATURE%")
MKDIR %BUILDS_PATH%\\%BUILD_FULL_SIGNATURE% || GOTO :ERROR

ECHO Creating build versioning header...
SET BuildDefinition=#define C3_BUILD_VERSION
ECHO #include "StdAfx.h" > %BUILD_HEADER_FILE% || GOTO :ERROR
ECHO %BuildDefinition% "%BUILD_FULL_SIGNATURE%" >> %BUILD_HEADER_FILE% || GOTO :ERROR


if ""=="%~1" (
set BuildTool=MSBuild
) else (
set BuildTool=%1
)

ECHO.
ECHO Building x64 binaries...
%BuildTool% /nologo /verbosity:quiet /consoleloggerparameters:summary "Src" "/t:GatewayConsoleExe;NodeRelayConsoleExe;NodeRelayDll" "/p:Configuration=Release" "/p:Platform=x64" || GOTO :ERROR

ECHO.
ECHO Building x86 binaries...
%BuildTool% /nologo /verbosity:quiet /consoleloggerparameters:summary "Src" "/t:GatewayConsoleExe;NodeRelayConsoleExe;NodeRelayDll" "/p:Configuration=Release" "/p:Platform=x86" || GOTO :ERROR

ECHO.
ECHO Copying binaries...
IF NOT EXIST "%BUILDS_PATH%\\%BUILD_FULL_SIGNATURE%\\Bin" (MKDIR "%BUILDS_PATH%\\%BUILD_FULL_SIGNATURE%\\Bin") || GOTO :ERROR
COPY "Bin\\GatewayConsoleExe_r64.exe" "%BUILDS_PATH%\\%BUILD_FULL_SIGNATURE%\\Bin\\GatewayConsoleExe_r64.exe" || GOTO :ERROR
COPY "Bin\\NodeRelayConsoleExe_r64.exe" "%BUILDS_PATH%\\%BUILD_FULL_SIGNATURE%\\Bin\\NodeRelayConsoleExe_r64.exe" || GOTO :ERROR
COPY "Bin\\GatewayConsoleExe_r86.exe" "%BUILDS_PATH%\\%BUILD_FULL_SIGNATURE%\\Bin\\GatewayConsoleExe_r86.exe" || GOTO :ERROR
COPY "Bin\\NodeRelayConsoleExe_r86.exe" "%BUILDS_PATH%\\%BUILD_FULL_SIGNATURE%\\Bin\\NodeRelayConsoleExe_r86.exe" || GOTO :ERROR
COPY "Bin\\NodeRelayDll_r64.dll" "%BUILDS_PATH%\\%BUILD_FULL_SIGNATURE%\\Bin\\NodeRelayDll_r64.dll" || GOTO :ERROR
COPY "Bin\\NodeRelayDll_r86.dll" "%BUILDS_PATH%\\%BUILD_FULL_SIGNATURE%\\Bin\\NodeRelayDll_r86.dll" || GOTO :ERROR

ECHO.
ECHO Copying sample Gateway configuration...
COPY "Res\\GatewayConfiguration.json" "%BUILDS_PATH%\\%BUILD_FULL_SIGNATURE%\\Bin\\GatewayConfiguration.json" || GOTO :ERROR

ECHO.
ECHO Building WebController...
IF EXIST "%BUILDS_PATH%\\%BUILD_FULL_SIGNATURE%\\WebController" (RMDIR /s /q "%BUILDS_PATH%\\%BUILD_FULL_SIGNATURE%\\WebController") || GOTO :ERROR
dotnet publish -c Release "Src\\WebController\\Backend" || GOTO :ERROR
XCOPY /s /q "Bin\\WebController\\Release\\netcoreapp2.2\\publish" "%BUILDS_PATH%\\%BUILD_FULL_SIGNATURE%\\WebController\" || GOTO :ERROR

ECHO.
ECHO Copying scripts...
COPY "StartWebController.cmd" "%BUILDS_PATH%\\%BUILD_FULL_SIGNATURE%\\StartWebController.cmd" || GOTO :ERROR
COPY "RestartWebController.cmd" "%BUILDS_PATH%\\%BUILD_FULL_SIGNATURE%\\RestartWebController.cmd" || GOTO :ERROR

ECHO.
ECHO Done. Build %BUILD_FULL_SIGNATURE% successfully created.

:DONE
ECHO.
ECHO Done.
SET /p answer=Press any button to continue...
EXIT /b 0

:ERROR
ECHO.
ECHO Build failed.
SET /p answer=Press any button to continue...
EXIT /b %errorlevel%
29 changes: 29 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2018-2019, MWR Infosecurity
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Loading

0 comments on commit 6d4eda6

Please sign in to comment.