diff --git a/shared/javacpp/setupBuild.gradle b/shared/javacpp/setupBuild.gradle index 04086ad4e5..8d994c242a 100644 --- a/shared/javacpp/setupBuild.gradle +++ b/shared/javacpp/setupBuild.gradle @@ -1,3 +1,5 @@ +import org.gradle.internal.os.OperatingSystem + apply plugin: 'cpp' apply plugin: 'google-test-test-suite' apply plugin: 'visual-studio' @@ -125,12 +127,23 @@ model { test.dependsOn it.tasks.install test.systemProperty 'java.library.path', filePath test.environment 'LD_LIBRARY_PATH', filePath + + // Workaround for Azure issue + if (OperatingSystem.current().isWindows() && System.getenv('AGENT_ID') != null) { + test.environment 'PATH', filePath + } + test.workingDir filePath run.dependsOn it.tasks.install run.systemProperty 'java.library.path', filePath run.environment 'LD_LIBRARY_PATH', filePath run.workingDir filePath + // Workaround for Azure issue + if (OperatingSystem.current().isWindows() && System.getenv('AGENT_ID') != null) { + run.environment 'PATH', filePath + } + found = true } } diff --git a/shared/jni/setupBuild.gradle b/shared/jni/setupBuild.gradle index 6c6148cfe4..8bdd8585c4 100644 --- a/shared/jni/setupBuild.gradle +++ b/shared/jni/setupBuild.gradle @@ -1,3 +1,5 @@ +import org.gradle.internal.os.OperatingSystem + apply plugin: 'cpp' apply plugin: 'google-test-test-suite' apply plugin: 'visual-studio' @@ -259,12 +261,22 @@ model { test.dependsOn it.tasks.install test.systemProperty 'java.library.path', filePath test.environment 'LD_LIBRARY_PATH', filePath + + // Workaround for Azure issue + if (OperatingSystem.current().isWindows() && System.getenv('AGENT_ID') != null) { + test.environment 'PATH', filePath + } test.workingDir filePath run.dependsOn it.tasks.install run.systemProperty 'java.library.path', filePath run.environment 'LD_LIBRARY_PATH', filePath run.workingDir filePath + // Workaround for Azure issue + if (OperatingSystem.current().isWindows() && System.getenv('AGENT_ID') != null) { + run.environment 'PATH', filePath + } + found = true } } diff --git a/wpilibj/build.gradle b/wpilibj/build.gradle index b2e22fb39d..95ec3c357d 100644 --- a/wpilibj/build.gradle +++ b/wpilibj/build.gradle @@ -1,3 +1,5 @@ +import org.gradle.internal.os.OperatingSystem + evaluationDependsOn(':hal') evaluationDependsOn(':ntcore') evaluationDependsOn(':cscore') @@ -142,12 +144,23 @@ model { test.dependsOn it.tasks.install test.systemProperty 'java.library.path', filePath test.environment 'LD_LIBRARY_PATH', filePath + + // Workaround for Azure issue + if (OperatingSystem.current().isWindows() && System.getenv('AGENT_ID') != null) { + test.environment 'PATH', filePath + } + test.workingDir filePath run.dependsOn it.tasks.install run.systemProperty 'java.library.path', filePath run.environment 'LD_LIBRARY_PATH', filePath run.workingDir filePath + // Workaround for Azure issue + if (OperatingSystem.current().isWindows() && System.getenv('AGENT_ID') != null) { + run.environment 'PATH', filePath + } + found = true } }