Skip to content
This repository has been archived by the owner on Nov 7, 2022. It is now read-only.

Commit

Permalink
Update CI to release versions
Browse files Browse the repository at this point in the history
  • Loading branch information
scemino committed Oct 31, 2019
1 parent f653277 commit 510ac96
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 40 deletions.
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ matrix:
- cmake .. -DCMAKE_BUILD_TYPE=Release $CMAKE_FLAGS -DSFML_DIR=$TRAVIS_BUILD_DIR/SFML-2.5.1/install/lib/cmake/SFML
-DImGui-SFML_DIR=$TRAVIS_BUILD_DIR/imgui-sfml-2.1/install/lib/cmake/ImGui-SFML
-DCMAKE_INSTALL_PREFIX=../install
- cmake --build . --config Release
- cmake --build . --config Release --target package
- name: macOS
compiler: clang
os: osx
Expand All @@ -54,17 +54,17 @@ matrix:
- mkdir build && cd build
- cmake .. -DCMAKE_BUILD_TYPE=Release $CMAKE_FLAGS -DImGui-SFML_DIR=$TRAVIS_BUILD_DIR/imgui-sfml/install/lib/cmake/ImGui-SFML
-DCMAKE_INSTALL_PREFIX=../install
- cmake --build . --config Release
before_deploy:
- mv engge "engge-$TRAVIS_OS_NAME"
- cmake --build . --config Release --target package
deploy:
provider: releases
api_key:
secure: YzN2W7SkV2T5cO/st5e/RwiRuMSkoyyzsBwii6K3Mvmybu6KM/FpLAMs7fCGxqjj/EAHbUFBNW6mJC9xlqRC5ee24x1B8KhRM2FEbTz9oUPnFnGJJK+8SKqVtnLhXdEdfC1adcL0TrJsaP9kiudgbwGNOXHzddNwfpciMhKanNmc9N+c0eHhlIbpVIGBaYDUf960ON7NKwMsYgUyWm72Z2mchUAY43Q44QOB+TZ1dn0alCsvaBzGRqHXNcq8jLhFYiltilUP85g90ebe2lwEgVsCjjU1DkorQr3oTlcONHXB5O+i0SJUjpHxGDNUxcmgf5rKnyHlHZfKITQwNN5rxHMHiPX1LQuTlTx0WDc+sXloAVpj/ZV7ubIlOjKjXL530CcLISCi4DothjRLeXzXEIEa14GcrmQRHIU0scukp7kmP2PhqQhYCcjzKZcFdD8f6YvrCWcnQydXwy4/1HZBvg40gMtS11va29hn0YuvK3SnYyjVG6un7RBryfIArzdZYv5rriOU5HlFekdYaMWgcVz335283a3kkv8YpBhLPB/DUhy2wni2znObDur5dxDdjulRe6tOyTmWPfYO/v3hqE2haH0GcULJHhA9RodRiGrG+fQIzoYlAkQWSGAMWWf9MXqz+WDH1hUKSKt6m+QpjgmVOiQpOrJIFeX+YZDK5qQ=
file_glob: true
file:
- engge-*
- engge-*.zip
skip_cleanup: true
draft: true
on:
repo: scemino/engge
tags: true
tag_name: $TRAVIS_TAG
name: $TRAVIS_COMMIT_MESSAGE
draft: true
63 changes: 38 additions & 25 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,35 +1,48 @@
cmake_minimum_required(VERSION 3.5.0)
project(engge)

include(appInfo.cmake)

project("${appName}")

# Compiler flags
set (SQ_DISABLE_INSTALLER ON)
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")

# Dependencies
find_package (SFML REQUIRED COMPONENTS system window graphics audio)
find_package (ImGui-SFML REQUIRED)

include_directories(include/ extlibs/squirrel/include/ extlibs/spdlog/include/)
link_directories(extlibs/squirrel/squirrel/ extlibs/squirrel/sqstdlib/)

set(SOURCES
src/Game.cpp src/main.cpp src/Actor.cpp src/Animation.cpp src/Costume.cpp src/CostumeAnimation.cpp
src/TextDatabase.cpp src/Engine.cpp src/Font.cpp src/CostumeLayer.cpp src/Object.cpp src/Room.cpp
src/Scripting/ScriptEngine.cpp src/TextureManager.cpp src/Walkbox.cpp src/TextObject.cpp src/RoomLayer.cpp src/Lip.cpp
src/SoundDefinition.cpp src/SpriteSheet.cpp src/Dialog/YackTokenReader.cpp src/Dialog/YackParser.cpp
src/Dialog/Ast.cpp src/Dialog/DialogManager.cpp src/Dialog/DialogVisitor.cpp src/FntFont.cpp src/Text.cpp
src/SoundManager.cpp src/ActorIcons.cpp src/Inventory.cpp src/Graph.cpp src/PathFinder.cpp src/GGPack.cpp
src/Cutscene.cpp src/Entity.cpp src/RoomScaling.cpp src/SoundTrigger.cpp src/SoundId.cpp src/JsonTokenReader.cpp
src/Light.cpp src/Thread.cpp src/_Util.cpp src/Camera.cpp src/Logger.cpp src/EngineSettings.cpp src/Preferences.cpp
src/Sentence.cpp src/_RoomTrigger.cpp
)

# Sources
add_subdirectory(src)
add_subdirectory(extlibs/squirrel)
add_executable(${PROJECT_NAME} ${SOURCES})
target_link_libraries(${PROJECT_NAME} squirrel_static sqstdlib_static sfml-graphics sfml-window sfml-system sfml-audio)
if (SFML_FOUND)
include_directories(${SFML_INCLUDE_DIR})
target_link_libraries(${PROJECT_NAME} ${SFML_LIBRARIES})
else()
message (FATAL_ERROR "Cannot find SFML")
endif()
target_link_libraries(${PROJECT_NAME} ImGui-SFML::ImGui-SFML)

# Install misc. files
install(FILES test.nut DESTINATION .)
install(FILES LICENSE DESTINATION .)

# Configure CPack
function(get_short_system_name variable)
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
set(${variable} "OSX" PARENT_SCOPE)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
set(${variable} "Win32" PARENT_SCOPE)
else()
set(${variable} "${CMAKE_SYSTEM_NAME}" PARENT_SCOPE)
endif()
endfunction()

set(CPACK_PACKAGE_NAME ${appName})
string(REPLACE " " "-" CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME}")
get_short_system_name(CPACK_SYSTEM_NAME)
set(CPACK_PACKAGE_VERSION_MAJOR ${appVersionMajor})
set(CPACK_PACKAGE_VERSION_MINOR ${appVersionMinor})
set(CPACK_PACKAGE_VERSION_PATCH ${appVersionPatch})
set(CPACK_PACKAGE_VERSION ${appVersion})
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}")
string(TOLOWER "${CPACK_PACKAGE_FILE_NAME}" CPACK_PACKAGE_FILE_NAME)
set(CPACK_GENERATOR ZIP)

# Run CPack
include(CPack)

6 changes: 6 additions & 0 deletions appInfo.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
set(appName "engge")
set(appVersionMajor 0)
set(appVersionMinor 1)
set(appVersionPatch 0)
set(appVersionSuffix "alpha")
set(appVersion "${appVersionMajor}.${appVersionMinor}.${appVersionPatch}-${appVersionSuffix}")
23 changes: 17 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: 1.0.{build}
image: Visual Studio 2017

platform: x64
Expand All @@ -15,7 +14,7 @@ init:
- cmd: cmake --version
- cmd: msbuild /version

before_build:
build_script:
- ps: echo $env:SFML_DIR
- ps: echo $env:IMGUI_DIR
- ps: echo $env:IMGUI_SFML_DIR
Expand All @@ -42,8 +41,20 @@ before_build:
- ps: mkdir install
- ps: cd build
- ps: cmake .. -G "Visual Studio 15 2017 Win64" -DSFML_DIR=$env:SFML_DIR -DImGui-SFML_DIR="/lib/cmake/ImGui-SFML" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install
- ps: dir
- ps: cmake --build . --config Release --target package
- ps: cd "$env:APPVEYOR_BUILD_FOLDER"

build:
parallel: true
project: build\engge.sln
artifacts:
- path: build\engge-*.zip

deploy:
- provider: GitHub
release: $(APPVEYOR_REPO_TAG_NAME)
auth_token:
secure: 4Fs9Shs13/CwcIHJDQAm+kNRZzsTSxsBi07gSfFHqK17nhlfwRGSYMA56XpRzeMM
repository: scemino/engge
artifact: /.*\.zip/
draft: true
prerelease: true
on:
appveyor_repo_tag: true
30 changes: 30 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
include("../appInfo.cmake")

include_directories(../include/ ../extlibs/squirrel/include/ ../extlibs/spdlog/include/)
link_directories(../extlibs/squirrel/squirrel/ ../extlibs/squirrel/sqstdlib/)

set(SOURCES
Game.cpp main.cpp Actor.cpp Animation.cpp Costume.cpp CostumeAnimation.cpp
TextDatabase.cpp Engine.cpp Font.cpp CostumeLayer.cpp Object.cpp Room.cpp
Scripting/ScriptEngine.cpp TextureManager.cpp Walkbox.cpp TextObject.cpp RoomLayer.cpp Lip.cpp
SoundDefinition.cpp SpriteSheet.cpp Dialog/YackTokenReader.cpp Dialog/YackParser.cpp
Dialog/Ast.cpp Dialog/DialogManager.cpp Dialog/DialogVisitor.cpp FntFont.cpp Text.cpp
SoundManager.cpp ActorIcons.cpp Inventory.cpp Graph.cpp PathFinder.cpp GGPack.cpp
Cutscene.cpp Entity.cpp RoomScaling.cpp SoundTrigger.cpp SoundId.cpp JsonTokenReader.cpp
Light.cpp Thread.cpp _Util.cpp Camera.cpp Logger.cpp EngineSettings.cpp Preferences.cpp
Sentence.cpp _RoomTrigger.cpp
)

add_executable(${PROJECT_NAME} ${SOURCES})

target_link_libraries(${PROJECT_NAME} squirrel_static sqstdlib_static sfml-graphics sfml-window sfml-system sfml-audio)
if (SFML_FOUND)
include_directories(${SFML_INCLUDE_DIR})
target_link_libraries(${PROJECT_NAME} ${SFML_LIBRARIES})
else()
message (FATAL_ERROR "Cannot find SFML")
endif()
target_link_libraries(${PROJECT_NAME} ImGui-SFML::ImGui-SFML)

# Install exe
install(TARGETS engge RUNTIME DESTINATION .)
13 changes: 11 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,17 @@ int main(int argc, char **argv)
scriptEngine->setEngine(*engine);
try
{
scriptEngine->executeScript("test.nut");
// scriptEngine->executeBootScript();
std::ifstream is("test.nut");
if (is.is_open())
{
ng::info("execute test.nut");
scriptEngine->executeScript("test.nut");
}
else
{
ng::info("execute boot script");
scriptEngine->executeBootScript();
}

game->getInputEventHandlers().push_back(std::make_unique<ng::DefaultInputEventHandler>(*engine, game->getWindow()));
game->run();
Expand Down

0 comments on commit 510ac96

Please sign in to comment.