diff --git a/.travis.yml b/.travis.yml index 266077156..742064177 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,13 +14,13 @@ matrix: packages: - ccache env: &Debug - - TRAVIS_CUBERITE_BUILD_TYPE=DEBUG CUBERITE_PATH=./Cuberite_debug + - TRAVIS_CUBERITE_BUILD_TYPE=DEBUG # AppleClang # OSX workers are slower to start up. Having these first in the build matrix makes travis faster overall. - os: osx compiler: clang env: &Release - - TRAVIS_CUBERITE_BUILD_TYPE=RELEASE CUBERITE_PATH=./Cuberite + - TRAVIS_CUBERITE_BUILD_TYPE=RELEASE - os: osx compiler: clang env: *Debug diff --git a/Server/BACKERS b/BACKERS similarity index 100% rename from Server/BACKERS rename to BACKERS diff --git a/CIbuild.sh b/CIbuild.sh index 9f2145624..b4163f0a8 100755 --- a/CIbuild.sh +++ b/CIbuild.sh @@ -24,7 +24,7 @@ echo "Testing..." cd Server/; touch apiCheckFailed.flag if [ "$TRAVIS_CUBERITE_BUILD_TYPE" != "COVERAGE" ]; then - ${CUBERITE_PATH} <<- EOF + ./Cuberite <<- EOF load APIDump apicheck restart diff --git a/Install/WCVersion.cmd.template b/Install/WCVersion.cmd.template deleted file mode 100644 index 7c6fac164..000000000 --- a/Install/WCVersion.cmd.template +++ /dev/null @@ -1 +0,0 @@ -set WCREV=$WCREV$ \ No newline at end of file diff --git a/Install/Zip2008.list b/Install/Zip2008.list deleted file mode 100644 index 92c728d52..000000000 --- a/Install/Zip2008.list +++ /dev/null @@ -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 diff --git a/Install/Zip2008_PDBs.list b/Install/Zip2008_PDBs.list deleted file mode 100644 index ca523522e..000000000 --- a/Install/Zip2008_PDBs.list +++ /dev/null @@ -1,3 +0,0 @@ -Server\*.pdb -Server\buildinfo.txt -src\Bindings\Bindings.* diff --git a/Install/.gitignore b/Server/Install/.gitignore similarity index 100% rename from Install/.gitignore rename to Server/Install/.gitignore diff --git a/Install/Cuberite_high_detail_debug.cmd b/Server/Install/Cuberite_high_detail_debug.cmd similarity index 100% rename from Install/Cuberite_high_detail_debug.cmd rename to Server/Install/Cuberite_high_detail_debug.cmd diff --git a/Install/Cuberite_medium_detail_debug.cmd b/Server/Install/Cuberite_medium_detail_debug.cmd similarity index 100% rename from Install/Cuberite_medium_detail_debug.cmd rename to Server/Install/Cuberite_medium_detail_debug.cmd diff --git a/Server/Install/PackWindowsExecutables.cmd b/Server/Install/PackWindowsExecutables.cmd new file mode 100644 index 000000000..8993ab3ed --- /dev/null +++ b/Server/Install/PackWindowsExecutables.cmd @@ -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..\Server\buildinfo.txt -- 7z a -tzip -y ../Cuberite.zip -scsWIN -i@Zip2008.list -xr!*.git* -- cd .. -- 7z a -tzip -y PDBs.zip -scsWIN -i@Install/Zip2008_PDBs.list -xr!*.git* -- cd Server\plugins -- git clone https://github.com/madmaxoft/ManualApiDump -- cd .. -- 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 0buildinfo.txt +- Install\PackWindowsExecutables.cmd +- appveyor PushArtifact Cuberite.zip -FileName Cuberite.zip +- appveyor PushArtifact PDBs.zip -FileName PDBs.zip +- appveyor PushArtifact AutoAPI.zip -FileName AutoAPI.zip +- appveyor PushArtifact ManualAPI.zip -FileName ManualAPI.zip +- appveyor PushArtifact .luacheckrc -FileName .luacheckrc diff --git a/lib/lua b/lib/lua index e28ba2761..4a435929d 160000 --- a/lib/lua +++ b/lib/lua @@ -1 +1 @@ -Subproject commit e28ba276192e2aa68601952ab88760387fa7fd25 +Subproject commit 4a435929d50870b63bc97174a9e5820e400f93d8 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 105f234f1..4358f6bce 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -323,25 +323,84 @@ if (MSVC) endif() + + + add_executable(${CMAKE_PROJECT_NAME} ${SOURCE}) # Output the executable into the $/Server folder, so that it has access to external resources: SET_TARGET_PROPERTIES(${CMAKE_PROJECT_NAME} PROPERTIES - RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/Server - RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}/Server - RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}/Server - RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_SOURCE_DIR}/Server - RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_SOURCE_DIR}/Server - RUNTIME_OUTPUT_DIRECTORY_DEBUGPROFILE ${CMAKE_SOURCE_DIR}/Server - RUNTIME_OUTPUT_DIRECTORY_RELEASEPROFILE ${CMAKE_SOURCE_DIR}/Server + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Server + RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/Server + RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/Server + RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_BINARY_DIR}/Server + RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_BINARY_DIR}/Server + RUNTIME_OUTPUT_DIRECTORY_DEBUGPROFILE ${CMAKE_BINARY_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) @@ -375,9 +434,11 @@ target_link_libraries(${CMAKE_PROJECT_NAME} luaexpat jsoncpp_lib_static mbedtls # Create a folder for Bindings' documentation: 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) 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()