1
0

Output the binaries into a per-configuration Server subfolder. (#4440)

Make links to the original Server subfolder's items from the per-configuration Server subfolder.
This commit is contained in:
Mattes D 2019-12-28 12:53:37 +01:00 committed by GitHub
parent f5af0e2e04
commit cc72b204b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 144 additions and 84 deletions

View File

@ -14,13 +14,13 @@ matrix:
packages: packages:
- ccache - ccache
env: &Debug env: &Debug
- TRAVIS_CUBERITE_BUILD_TYPE=DEBUG CUBERITE_PATH=./Cuberite_debug - TRAVIS_CUBERITE_BUILD_TYPE=DEBUG
# AppleClang # AppleClang
# OSX workers are slower to start up. Having these first in the build matrix makes travis faster overall. # OSX workers are slower to start up. Having these first in the build matrix makes travis faster overall.
- os: osx - os: osx
compiler: clang compiler: clang
env: &Release env: &Release
- TRAVIS_CUBERITE_BUILD_TYPE=RELEASE CUBERITE_PATH=./Cuberite - TRAVIS_CUBERITE_BUILD_TYPE=RELEASE
- os: osx - os: osx
compiler: clang compiler: clang
env: *Debug env: *Debug

View File

@ -24,7 +24,7 @@ echo "Testing..."
cd Server/; cd Server/;
touch apiCheckFailed.flag touch apiCheckFailed.flag
if [ "$TRAVIS_CUBERITE_BUILD_TYPE" != "COVERAGE" ]; then if [ "$TRAVIS_CUBERITE_BUILD_TYPE" != "COVERAGE" ]; then
${CUBERITE_PATH} <<- EOF ./Cuberite <<- EOF
load APIDump load APIDump
apicheck apicheck
restart restart

View File

@ -1 +0,0 @@
set WCREV=$WCREV$

View File

@ -1,19 +0,0 @@
..\Server\Cuberite.exe
..\Server\*.dll
..\Server\Plugins
..\Server\Prefabs
..\Server\webadmin
..\Server\BACKERS
..\Server\brewing.txt
..\Server\crafting.txt
..\Server\furnace.txt
..\Server\items.ini
..\Server\monsters.ini
..\Server\buildinfo.txt
..\Server\README.txt
..\Server\favicon.png
..\CONTRIBUTORS
..\LICENSE
Cuberite*debug.cmd
*.example.ini
ThirdPartyLicenses

View File

@ -1,3 +0,0 @@
Server\*.pdb
Server\buildinfo.txt
src\Bindings\Bindings.*

View File

@ -0,0 +1,21 @@
@echo off
:: This script is run in the Appveyor CI builds to pack up the artifacts
:: It is expected to be run with the Server folder as the current working dir
@echo on
del Cuberite.zip
del PDBs.zip
del ManualAPI.zip
del AutoAPI.zip
rd /q /s Plugins\ManualApiDump
7z a -tzip -y Cuberite.zip -scsWIN -i@Install\WindowsExecutables.list -xr!*.git*
7z a -tzip -y PDBs.zip -scsWIN -i@Install/WindowsPDBs.list -xr!*.git*
git clone https://github.com/madmaxoft/ManualApiDump Plugins/ManualApiDump
echo load ManualApiDump 1>cmds.txt
echo manualapi 1>>cmds.txt
echo load APIDump 1>>cmds.txt
echo api 1>>cmds.txt
echo stop 1>>cmds.txt
Cuberite --port 32767 0<cmds.txt
7z a -tzip -y ManualAPI.zip -scsWIN "ManualAPI.lua"
7z a -tzip -y AutoAPI.zip -scsWIN "BindingsDocs\*.lua" -x!_raw.lua

View File

@ -0,0 +1,19 @@
Cuberite.exe
*.dll
Plugins
Prefabs
webadmin
BACKERS
brewing.txt
crafting.txt
furnace.txt
items.ini
monsters.ini
buildinfo.txt
README.txt
favicon.png
CONTRIBUTORS
LICENSE
Cuberite*debug.cmd
*.example.ini
ThirdPartyLicenses

View File

@ -0,0 +1,2 @@
*.pdb
buildinfo.txt

View File

@ -11,15 +11,15 @@ environment:
matrix: matrix:
- job_name: Windows-x64-debug - job_name: Windows-x64-debug
configuration: Debug configuration: Debug
CUBERITE_EXECUTABLE: cuberite_debug BUILD_DIR: Debug-x64
- job_name: Windows-x86 - job_name: Windows-x86
configuration: Release configuration: Release
CUBERITE_EXECUTABLE: cuberite BUILD_DIR: Release-x86
- job_name: Windows-x64 - job_name: Windows-x64
configuration: Release configuration: Release
CUBERITE_EXECUTABLE: cuberite BUILD_DIR: Release-x64
install: install:
- echo %TIME% - echo %TIME%
@ -35,8 +35,8 @@ for:
- job_name: Windows-x64-debug - job_name: Windows-x64-debug
before_build: before_build:
- if not exist Debug-x64 mkdir Debug-x64 - if not exist %BUILD_DIR% mkdir %BUILD_DIR%
- cd Debug-x64 - cd %BUILD_DIR%
- echo %TIME% - echo %TIME%
- cmake -G "Visual Studio 14 2015 Win64" -DSELF_TEST=1 -DBUILD_TOOLS=1 .. - cmake -G "Visual Studio 14 2015 Win64" -DSELF_TEST=1 -DBUILD_TOOLS=1 ..
- echo %TIME% - echo %TIME%
@ -56,8 +56,8 @@ for:
- job_name: Windows-x86 - job_name: Windows-x86
before_build: before_build:
- if not exist Release-x86 mkdir Release-x86 - if not exist %BUILD_DIR% mkdir %BUILD_DIR%
- cd Release-x86 - cd %BUILD_DIR%
- echo %TIME% - echo %TIME%
- cmake -G "Visual Studio 14 2015" .. - cmake -G "Visual Studio 14 2015" ..
- echo %TIME% - echo %TIME%
@ -77,8 +77,8 @@ for:
- job_name: Windows-x64 - job_name: Windows-x64
before_build: before_build:
- if not exist Release-x64 mkdir Release-x64 - if not exist %BUILD_DIR% mkdir %BUILD_DIR%
- cd Release-x64 - cd %BUILD_DIR%
- echo %TIME% - echo %TIME%
- cmake -G "Visual Studio 14 2015 Win64" .. - cmake -G "Visual Studio 14 2015 Win64" ..
- echo %TIME% - echo %TIME%
@ -89,44 +89,24 @@ for:
parallel: true parallel: true
verbosity: minimal verbosity: minimal
###########################################
# Cache for speeding up subsequent builds #
###########################################
cache: cache:
- Debug-x64 - Debug-x64
- Release-x86 - Release-x86
- Release-x64 - Release-x64
#####################
# Package artifacts #
#####################
after_build: after_build:
- cd Install - cd %BUILD_DIR%\Server
- echo Cuberite %APPVEYOR_JOB_NAME%-#%APPVEYOR_BUILD_NUMBER% 1>..\Server\buildinfo.txt - echo Cuberite %APPVEYOR_JOB_NAME%-#%APPVEYOR_BUILD_NUMBER% 1>buildinfo.txt
- 7z a -tzip -y ../Cuberite.zip -scsWIN -i@Zip2008.list -xr!*.git* - Install\PackWindowsExecutables.cmd
- cd .. - appveyor PushArtifact Cuberite.zip -FileName Cuberite.zip
- 7z a -tzip -y PDBs.zip -scsWIN -i@Install/Zip2008_PDBs.list -xr!*.git* - appveyor PushArtifact PDBs.zip -FileName PDBs.zip
- cd Server\plugins - appveyor PushArtifact AutoAPI.zip -FileName AutoAPI.zip
- git clone https://github.com/madmaxoft/ManualApiDump - appveyor PushArtifact ManualAPI.zip -FileName ManualAPI.zip
- cd .. - appveyor PushArtifact .luacheckrc -FileName .luacheckrc
- echo load ManualApiDump 1>cmds.txt
- echo manualapi 1>>cmds.txt
- echo load APIDump 1>>cmds.txt
- echo api 1>>cmds.txt
- echo stop 1>>cmds.txt
- "%CUBERITE_EXECUTABLE% --port 32767 0<cmds.txt"
- cd ..
- cd src/Bindings/docs
- 7z a -tzip -y ../../../AutoAPI.zip -scsWIN "*.lua" -x!_raw.lua
- cd ..\..\..\Server
- 7z a -tzip -y ../ManualAPI.zip -scsWIN "ManualAPI.lua"
artifacts:
- path: Cuberite.zip
name: Cuberite
- path: PDBs.zip
name: PDBs
- path: AutoAPI.zip
name: AutoAPI
- path: ManualAPI.zip
name: ManualAPI
- path: Server\.luacheckrc
name: .luacheckrc

@ -1 +1 @@
Subproject commit e28ba276192e2aa68601952ab88760387fa7fd25 Subproject commit 4a435929d50870b63bc97174a9e5820e400f93d8

View File

@ -323,25 +323,84 @@ if (MSVC)
endif() endif()
add_executable(${CMAKE_PROJECT_NAME} ${SOURCE}) add_executable(${CMAKE_PROJECT_NAME} ${SOURCE})
# Output the executable into the $/Server folder, so that it has access to external resources: # Output the executable into the $/Server folder, so that it has access to external resources:
SET_TARGET_PROPERTIES(${CMAKE_PROJECT_NAME} PROPERTIES SET_TARGET_PROPERTIES(${CMAKE_PROJECT_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/Server RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Server
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}/Server RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/Server
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}/Server RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/Server
RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_SOURCE_DIR}/Server RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_BINARY_DIR}/Server
RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_SOURCE_DIR}/Server RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_BINARY_DIR}/Server
RUNTIME_OUTPUT_DIRECTORY_DEBUGPROFILE ${CMAKE_SOURCE_DIR}/Server RUNTIME_OUTPUT_DIRECTORY_DEBUGPROFILE ${CMAKE_BINARY_DIR}/Server
RUNTIME_OUTPUT_DIRECTORY_RELEASEPROFILE ${CMAKE_SOURCE_DIR}/Server RUNTIME_OUTPUT_DIRECTORY_RELEASEPROFILE ${CMAKE_BINARY_DIR}/Server
) )
# Make the debug executable have a "_debug" suffix
SET_TARGET_PROPERTIES(${CMAKE_PROJECT_NAME} PROPERTIES DEBUG_POSTFIX "_debug")
# Make the profiled executables have a "_profile" postfix
SET_TARGET_PROPERTIES(${CMAKE_PROJECT_NAME} PROPERTIES DEBUGPROFILE_POSTFIX "_debug_profile")
SET_TARGET_PROPERTIES(${CMAKE_PROJECT_NAME} PROPERTIES RELEASEPROFILE_POSTFIX "_profile")
# Create a symbolic link from ${orig} to ${link}
# If ${link} already exists, does nothing.
function(make_symlink orig link)
# Get OS dependent path to use in `execute_process`
message("Creating symlink, orig = ${orig}; link = ${link}")
file(TO_NATIVE_PATH "${orig}" orig)
file(TO_NATIVE_PATH "${link}" link)
if (NOT EXISTS ${link})
if (CMAKE_HOST_UNIX)
set(command ln -s ${orig} ${link})
else()
if (IS_DIRECTORY ${orig})
set(command cmd.exe /c mklink /j ${link} ${orig})
else()
set(command cmd.exe /c mklink /h ${link} ${orig})
endif()
endif()
execute_process(COMMAND ${command}
RESULT_VARIABLE result
ERROR_VARIABLE output)
if (NOT ${result} EQUAL 0)
message(FATAL_ERROR "Could not create symbolic link for: ${link} --> ${orig}: ${output}")
endif()
endif()
endfunction(make_symlink)
# Populate the output folder with symlinks to the Server folder's internals:
set(symlinks
Install
lang
Plugins
Prefabs
Protocol
webadmin
brewing.txt
crafting.txt
favicon.png
items.ini
monsters.ini
)
message("Creating output folder and symlinks...")
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/Server")
foreach (symlink ${symlinks})
make_symlink("${CMAKE_SOURCE_DIR}/Server/${symlink}" "${CMAKE_BINARY_DIR}/Server/${symlink}")
endforeach(symlink)
make_symlink("${CMAKE_SOURCE_DIR}/BACKERS" "${CMAKE_BINARY_DIR}/Server/BACKERS")
make_symlink("${CMAKE_SOURCE_DIR}/CONTRIBUTORS" "${CMAKE_BINARY_DIR}/Server/CONTRIBUTORS")
make_symlink("${CMAKE_SOURCE_DIR}/LICENSE" "${CMAKE_BINARY_DIR}/Server/LICENSE")
make_symlink("${CMAKE_SOURCE_DIR}/Server/Install/ThirdPartyLicenses" "${CMAKE_BINARY_DIR}/Server/ThirdPartyLicenses")
# Precompiled headers (2nd part) # Precompiled headers (2nd part)
@ -375,9 +434,11 @@ target_link_libraries(${CMAKE_PROJECT_NAME} luaexpat jsoncpp_lib_static mbedtls
# Create a folder for Bindings' documentation: # Create a folder for Bindings' documentation:
FILE(MAKE_DIRECTORY "Bindings/docs") FILE(MAKE_DIRECTORY "Bindings/docs")
make_symlink("${CMAKE_SOURCE_DIR}/src/Bindings/docs" "${CMAKE_BINARY_DIR}/Server/BindingsDocs")
# For MSVC, set the startup project to Cuberite: # For MSVC, set the startup project to Cuberite, and the debugger dir:
if (MSVC) if (MSVC)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${CMAKE_PROJECT_NAME}) set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${CMAKE_PROJECT_NAME})
set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/Server")
endif() endif()