From 35641ee3ca5c593d27d00785684b84ec97558453 Mon Sep 17 00:00:00 2001 From: TSR Berry <20988865+TSRBerry@users.noreply.github.com> Date: Fri, 21 Jul 2023 18:09:06 +0200 Subject: [PATCH] Only build LibRyujinx if source or project files changed --- src/RyujinxAndroid/libryujinx/build.gradle | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/RyujinxAndroid/libryujinx/build.gradle b/src/RyujinxAndroid/libryujinx/build.gradle index 26649e1b4..2bcb3f4a9 100644 --- a/src/RyujinxAndroid/libryujinx/build.gradle +++ b/src/RyujinxAndroid/libryujinx/build.gradle @@ -62,7 +62,24 @@ ext.publishTree = fileTree(publishDirectory) { // Tasks tasks.register('compileLibRyujinx', Exec) { - workingDir '../../LibRyujinx' + def projectName = "LibRyujinx" + + workingDir "../../${projectName}" + + def solutionFiles = fileTree("../../") { + include '**/*.cs' + include '**/*.csproj' + exclude '**/bin/**' + exclude '**/obj/**' + exclude '**/RyujinxAndroid/**' + } + + inputs.files(solutionFiles) + .withPropertyName('sourceFiles') + .withPathSensitivity(PathSensitivity.RELATIVE) + .ignoreEmptyDirectories() + + outputs.file("${publishDirectory}/${projectName.toLowerCase()}.so") OperatingSystem os = DefaultNativePlatform.currentOperatingSystem if (toolchainPath != null) { @@ -75,7 +92,7 @@ tasks.register('compileLibRyujinx', Exec) { } doFirst { - println "Building LibRyujinx in ${configuration} mode." + println "Building ${projectName} in ${configuration} mode." println "Configuration:" println "\tusing: ${dotnetExecutable}" println "\tStripSymbols: ${stripSymbols}"