yuzu-emu
/
yuzu-android
Archived
1
0
Fork 0

Merge pull request #2943 from DarkLordZach/azure-titlebars-v2

ci: Add custom titlebars for mainline and patreon
This commit is contained in:
bunnei 2019-10-05 19:29:35 -04:00 committed by GitHub
commit 6f511c8006
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 62 additions and 13 deletions

View File

@ -5,7 +5,7 @@ cd /yuzu
ccache -s ccache -s
mkdir build || true && cd build mkdir build || true && cd build
cmake .. -G Ninja -DYUZU_USE_BUNDLED_UNICORN=ON -DYUZU_USE_QT_WEB_ENGINE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++ -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DUSE_DISCORD_PRESENCE=ON cmake .. -G Ninja -DDISPLAY_VERSION=$1 -DYUZU_USE_BUNDLED_UNICORN=ON -DYUZU_USE_QT_WEB_ENGINE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++ -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DUSE_DISCORD_PRESENCE=ON
ninja ninja

View File

@ -2,4 +2,4 @@
mkdir -p "ccache" || true mkdir -p "ccache" || true
chmod a+x ./.ci/scripts/linux/docker.sh chmod a+x ./.ci/scripts/linux/docker.sh
docker run -e ENABLE_COMPATIBILITY_REPORTING -e CCACHE_DIR=/yuzu/ccache -v $(pwd):/yuzu yuzuemu/build-environments:linux-fresh /bin/bash /yuzu/.ci/scripts/linux/docker.sh docker run -e ENABLE_COMPATIBILITY_REPORTING -e CCACHE_DIR=/yuzu/ccache -v $(pwd):/yuzu yuzuemu/build-environments:linux-fresh /bin/bash /yuzu/.ci/scripts/linux/docker.sh $1

View File

@ -13,7 +13,7 @@ echo '' >> /bin/cmd
chmod +x /bin/cmd chmod +x /bin/cmd
mkdir build || true && cd build mkdir build || true && cd build
cmake .. -G Ninja -DCMAKE_TOOLCHAIN_FILE="$(pwd)/../CMakeModules/MinGWCross.cmake" -DUSE_CCACHE=ON -DYUZU_USE_BUNDLED_UNICORN=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DCMAKE_BUILD_TYPE=Release cmake .. -G Ninja -DDISPLAY_VERSION=$1 -DCMAKE_TOOLCHAIN_FILE="$(pwd)/../CMakeModules/MinGWCross.cmake" -DUSE_CCACHE=ON -DYUZU_USE_BUNDLED_UNICORN=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DCMAKE_BUILD_TYPE=Release
ninja ninja
# Clean up the dirty hacks # Clean up the dirty hacks

View File

@ -2,4 +2,4 @@
mkdir -p "ccache" || true mkdir -p "ccache" || true
chmod a+x ./.ci/scripts/windows/docker.sh chmod a+x ./.ci/scripts/windows/docker.sh
docker run -e CCACHE_DIR=/yuzu/ccache -v $(pwd):/yuzu yuzuemu/build-environments:linux-mingw /bin/bash -ex /yuzu/.ci/scripts/windows/docker.sh docker run -e CCACHE_DIR=/yuzu/ccache -v $(pwd):/yuzu yuzuemu/build-environments:linux-mingw /bin/bash -ex /yuzu/.ci/scripts/windows/docker.sh $1

View File

@ -1,9 +1,10 @@
parameters: parameters:
artifactSource: 'true' artifactSource: 'true'
cache: 'false' cache: 'false'
version: ''
steps: steps:
- script: mkdir build && cd build && set DATE=`date '+%Y.%m.%d'` && set CI=true && set AZURE_REPO_NAME=yuzu-emu/yuzu-$(BuildName) && set AZURE_REPO_TAG=$(BuildName)-$DATE && cmake -G "Visual Studio 15 2017 Win64" --config Release -DYUZU_USE_BUNDLED_QT=1 -DYUZU_USE_BUNDLED_SDL2=1 -DYUZU_USE_BUNDLED_UNICORN=1 -DYUZU_USE_QT_WEB_ENGINE=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${COMPAT} -DUSE_DISCORD_PRESENCE=ON .. && cd .. - script: mkdir build && cd build && cmake -G "Visual Studio 15 2017 Win64" --config Release -DYUZU_USE_BUNDLED_QT=1 -DYUZU_USE_BUNDLED_SDL2=1 -DYUZU_USE_BUNDLED_UNICORN=1 -DYUZU_USE_QT_WEB_ENGINE=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${COMPAT} -DUSE_DISCORD_PRESENCE=ON -DDISPLAY_VERSION=${{ parameters['version'] }} .. && cd ..
displayName: 'Configure CMake' displayName: 'Configure CMake'
- task: MSBuild@1 - task: MSBuild@1
displayName: 'Build' displayName: 'Build'

View File

@ -1,6 +1,7 @@
parameters: parameters:
artifactSource: 'true' artifactSource: 'true'
cache: 'false' cache: 'false'
version: ''
steps: steps:
- task: DockerInstaller@0 - task: DockerInstaller@0
@ -13,7 +14,7 @@ steps:
key: yuzu-v1-$(BuildName)-$(BuildSuffix)-$(CacheSuffix) key: yuzu-v1-$(BuildName)-$(BuildSuffix)-$(CacheSuffix)
path: $(System.DefaultWorkingDirectory)/ccache path: $(System.DefaultWorkingDirectory)/ccache
cacheHitVar: CACHE_RESTORED cacheHitVar: CACHE_RESTORED
- script: export DATE=`date '+%Y.%m.%d'` && export CI=true && export AZURE_REPO_NAME=yuzu-emu/yuzu-$(BuildName) && export AZURE_REPO_TAG=$(BuildName)-$DATE && chmod a+x ./.ci/scripts/$(ScriptFolder)/exec.sh && ./.ci/scripts/$(ScriptFolder)/exec.sh - script: chmod a+x ./.ci/scripts/$(ScriptFolder)/exec.sh && ./.ci/scripts/$(ScriptFolder)/exec.sh ${{ parameters['version'] }}
displayName: 'Build' displayName: 'Build'
- script: chmod a+x ./.ci/scripts/$(ScriptFolder)/upload.sh && RELEASE_NAME=$(BuildName) ./.ci/scripts/$(ScriptFolder)/upload.sh - script: chmod a+x ./.ci/scripts/$(ScriptFolder)/upload.sh && RELEASE_NAME=$(BuildName) ./.ci/scripts/$(ScriptFolder)/upload.sh
displayName: 'Package Artifacts' displayName: 'Package Artifacts'

View File

@ -1,3 +1,6 @@
parameters:
version: ''
jobs: jobs:
- job: build - job: build
displayName: 'standard' displayName: 'standard'
@ -21,3 +24,4 @@ jobs:
parameters: parameters:
artifactSource: 'false' artifactSource: 'false'
cache: $(parameters.cache) cache: $(parameters.cache)
version: $(parameters.version)

View File

@ -1,3 +1,6 @@
parameters:
version: ''
jobs: jobs:
- job: build_test - job: build_test
displayName: 'testing' displayName: 'testing'
@ -31,3 +34,4 @@ jobs:
parameters: parameters:
artifactSource: 'false' artifactSource: 'false'
cache: 'false' cache: 'false'
version: $(parameters.version)

View File

@ -1,6 +1,9 @@
trigger: trigger:
- master - master
variables:
DisplayVersion: $[counter(variables['DisplayPrefix'], 1)]
stages: stages:
- stage: format - stage: format
displayName: 'format' displayName: 'format'
@ -34,6 +37,7 @@ stages:
parameters: parameters:
artifactSource: 'false' artifactSource: 'false'
cache: 'true' cache: 'true'
version: $(DisplayVersion)
- stage: build_win - stage: build_win
dependsOn: format dependsOn: format
displayName: 'build-windows' displayName: 'build-windows'
@ -51,6 +55,7 @@ stages:
parameters: parameters:
artifactSource: 'false' artifactSource: 'false'
cache: 'true' cache: 'true'
version: $(DisplayVersion)
- stage: release - stage: release
displayName: 'Release' displayName: 'Release'
dependsOn: dependsOn:

View File

@ -1,6 +1,9 @@
trigger: trigger:
- master - master
variables:
DisplayVersion: $[counter(variables['DisplayPrefix'], 1)]
stages: stages:
- stage: format - stage: format
displayName: 'format' displayName: 'format'
@ -28,3 +31,4 @@ stages:
parameters: parameters:
artifactSource: 'false' artifactSource: 'false'
cache: $(parameters.cache) cache: $(parameters.cache)
version: $(DisplayVersion)

View File

@ -15,11 +15,23 @@ if (DEFINED ENV{CI})
set(BUILD_TAG $ENV{AZURE_REPO_TAG}) set(BUILD_TAG $ENV{AZURE_REPO_TAG})
endif() endif()
endif() endif()
if (DEFINED ENV{TITLEBARFORMATIDLE})
set(TITLE_BAR_FORMAT_IDLE $ENV{TITLEBARFORMATIDLE})
endif ()
if (DEFINED ENV{TITLEBARFORMATRUNNING})
set(TITLE_BAR_FORMAT_RUNNING $ENV{TITLEBARFORMATRUNNING})
endif ()
if (DEFINED ENV{DISPLAYVERSION})
set(DISPLAY_VERSION $ENV{DISPLAYVERSION})
endif ()
add_custom_command(OUTPUT scm_rev.cpp add_custom_command(OUTPUT scm_rev.cpp
COMMAND ${CMAKE_COMMAND} COMMAND ${CMAKE_COMMAND}
-DSRC_DIR="${CMAKE_SOURCE_DIR}" -DSRC_DIR="${CMAKE_SOURCE_DIR}"
-DBUILD_REPOSITORY="${BUILD_REPOSITORY}" -DBUILD_REPOSITORY="${BUILD_REPOSITORY}"
-DTITLE_BAR_FORMAT_IDLE="${TITLE_BAR_FORMAT_IDLE}"
-DTITLE_BAR_FORMAT_RUNNING="${TITLE_BAR_FORMAT_RUNNING}"
-DBUILD_TAG="${BUILD_TAG}" -DBUILD_TAG="${BUILD_TAG}"
-DBUILD_ID="${DISPLAY_VERSION}"
-P "${CMAKE_SOURCE_DIR}/CMakeModules/GenerateSCMRev.cmake" -P "${CMAKE_SOURCE_DIR}/CMakeModules/GenerateSCMRev.cmake"
DEPENDS DEPENDS
# WARNING! It was too much work to try and make a common location for this list, # WARNING! It was too much work to try and make a common location for this list,

View File

@ -11,6 +11,9 @@
#define BUILD_DATE "@BUILD_DATE@" #define BUILD_DATE "@BUILD_DATE@"
#define BUILD_FULLNAME "@BUILD_FULLNAME@" #define BUILD_FULLNAME "@BUILD_FULLNAME@"
#define BUILD_VERSION "@BUILD_VERSION@" #define BUILD_VERSION "@BUILD_VERSION@"
#define BUILD_ID "@BUILD_ID@"
#define TITLE_BAR_FORMAT_IDLE "@TITLE_BAR_FORMAT_IDLE@"
#define TITLE_BAR_FORMAT_RUNNING "@TITLE_BAR_FORMAT_RUNNING@"
#define SHADER_CACHE_VERSION "@SHADER_CACHE_VERSION@" #define SHADER_CACHE_VERSION "@SHADER_CACHE_VERSION@"
namespace Common { namespace Common {
@ -22,6 +25,9 @@ const char g_build_name[] = BUILD_NAME;
const char g_build_date[] = BUILD_DATE; const char g_build_date[] = BUILD_DATE;
const char g_build_fullname[] = BUILD_FULLNAME; const char g_build_fullname[] = BUILD_FULLNAME;
const char g_build_version[] = BUILD_VERSION; const char g_build_version[] = BUILD_VERSION;
const char g_build_id[] = BUILD_ID;
const char g_title_bar_format_idle[] = TITLE_BAR_FORMAT_IDLE;
const char g_title_bar_format_running[] = TITLE_BAR_FORMAT_RUNNING;
const char g_shader_cache_version[] = SHADER_CACHE_VERSION; const char g_shader_cache_version[] = SHADER_CACHE_VERSION;
} // namespace } // namespace

View File

@ -13,6 +13,9 @@ extern const char g_build_name[];
extern const char g_build_date[]; extern const char g_build_date[];
extern const char g_build_fullname[]; extern const char g_build_fullname[];
extern const char g_build_version[]; extern const char g_build_version[];
extern const char g_build_id[];
extern const char g_title_bar_format_idle[];
extern const char g_title_bar_format_running[];
extern const char g_shader_cache_version[]; extern const char g_shader_cache_version[];
} // namespace Common } // namespace Common

View File

@ -1889,15 +1889,24 @@ void GMainWindow::OnCaptureScreenshot() {
} }
void GMainWindow::UpdateWindowTitle(const QString& title_name) { void GMainWindow::UpdateWindowTitle(const QString& title_name) {
const QString full_name = QString::fromUtf8(Common::g_build_fullname); const auto full_name = std::string(Common::g_build_fullname);
const QString branch_name = QString::fromUtf8(Common::g_scm_branch); const auto branch_name = std::string(Common::g_scm_branch);
const QString description = QString::fromUtf8(Common::g_scm_desc); const auto description = std::string(Common::g_scm_desc);
const auto build_id = std::string(Common::g_build_id);
const auto date =
QDateTime::currentDateTime().toString(QStringLiteral("yyyy-MM-dd")).toStdString();
if (title_name.isEmpty()) { if (title_name.isEmpty()) {
setWindowTitle(QStringLiteral("yuzu %1| %2-%3").arg(full_name, branch_name, description)); const auto fmt = std::string(Common::g_title_bar_format_idle);
setWindowTitle(QString::fromStdString(fmt::format(fmt.empty() ? "yuzu {0}| {1}-{2}" : fmt,
full_name, branch_name, description,
std::string{}, date, build_id)));
} else { } else {
setWindowTitle(QStringLiteral("yuzu %1| %4 | %2-%3") const auto fmt = std::string(Common::g_title_bar_format_idle);
.arg(full_name, branch_name, description, title_name)); setWindowTitle(QString::fromStdString(
fmt::format(fmt.empty() ? "yuzu {0}| {3} | {1}-{2}" : fmt, full_name, branch_name,
description, std::string{}, date, build_id)));
} }
} }