xpipe/gradle/gradle_scripts/extension_test.gradle

70 lines
2.6 KiB
Groovy
Raw Normal View History

2023-01-20 12:36:42 +13:00
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
2022-12-19 06:04:51 +13:00
apply from: "$buildscript.sourceFile/../junit.gradle"
dependencies {
testImplementation project(':api')
testImplementation project(':core')
2023-02-20 22:49:10 +13:00
testImplementation project(':app')
2022-12-19 06:04:51 +13:00
2023-10-26 03:20:49 +13:00
testImplementation "org.openjfx:javafx-base:${javafxVersion}:win"
testImplementation "org.openjfx:javafx-controls:${javafxVersion}:win"
testImplementation "org.openjfx:javafx-graphics:${javafxVersion}:win"
2022-12-19 06:04:51 +13:00
}
def attachDebugger = System.getProperty('idea.debugger.dispatch.addr') != null
def daemonCommand = attachDebugger ? ':app:runAttachedDebugger' : ':app:run'
test {
workingDir = rootDir
jvmArgs += ["--enable-preview", "-Xmx2g"]
// Daemon properties
2023-01-27 15:34:46 +13:00
systemProperty "io.xpipe.beacon.daemonArgs",
2023-09-27 13:47:51 +13:00
" -Dio.xpipe.beacon.port=21725" +
2023-02-20 22:49:10 +13:00
" -Dio.xpipe.app.mode=tray" +
2022-12-19 06:04:51 +13:00
" -Dio.xpipe.app.dataDir=$projectDir/local/" +
" -Dio.xpipe.storage.persist=false" +
" -Dio.xpipe.app.writeSysOut=true" +
" -Dio.xpipe.app.writeLogs=false" +
" -Dio.xpipe.beacon.printMessages=false" +
" -Dio.xpipe.app.logLevel=trace"
2023-01-20 12:36:42 +13:00
// Use cmd window for tests
2023-01-27 15:34:46 +13:00
if (!rootProject.ci && DefaultNativePlatform.currentOperatingSystem.isWindows()) {
2023-01-20 12:36:42 +13:00
systemProperty "io.xpipe.beacon.customDaemonCommand",
2023-05-21 02:23:36 +12:00
"cmd.exe /c start \"\"XPipe Debug\"\" /i \"$rootDir\\gradlew.bat\" --console=plain $daemonCommand"
2022-12-19 06:04:51 +13:00
}
// Client properties
// systemProperty 'io.xpipe.beacon.printMessages', "true"
systemProperty 'io.xpipe.beacon.printDaemonOutput', "false"
2023-09-27 13:47:51 +13:00
systemProperty "io.xpipe.beacon.port", "21725"
2022-12-19 06:04:51 +13:00
systemProperty "io.xpipe.beacon.launchDebugDaemon", "true"
systemProperty "io.xpipe.beacon.attachDebuggerToDaemon", "$daemonCommand"
2023-01-27 15:34:46 +13:00
}
task productionTest(type: Test) {
classpath = sourceSets.test.runtimeClasspath
useJUnitPlatform()
workingDir = rootDir
jvmArgs += ["--enable-preview", "-Xmx2g"]
// Daemon properties
systemProperty "io.xpipe.beacon.daemonArgs",
2023-09-27 13:47:51 +13:00
" -Dio.xpipe.beacon.port=21725" +
2023-01-27 15:34:46 +13:00
" -Dio.xpipe.app.dataDir=$projectDir/local/" +
" -Dio.xpipe.storage.persist=false" +
" -Dio.xpipe.app.writeSysOut=true" +
" -Dio.xpipe.app.writeLogs=false" +
" -Dio.xpipe.beacon.printMessages=false" +
" -Dio.xpipe.app.logLevel=trace"
// Client properties
systemProperty 'io.xpipe.beacon.printMessages', "true"
systemProperty 'io.xpipe.beacon.printDaemonOutput', "true"
2023-09-27 13:47:51 +13:00
systemProperty "io.xpipe.beacon.port", "21725"
2022-12-19 06:04:51 +13:00
}