Skip to content

Commit 4d083a7

Browse files
committed
Add small method for printing PlatformHelper results
1 parent 4349dc1 commit 4d083a7

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

build.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ tasks.test {
9090
}
9191
}
9292

93+
tasks.register("runParameterTest", JavaExec::class.java) {
94+
classpath = sourceSets["main"].runtimeClasspath
95+
main = "com.github.gradle.node.util.PlatformHelperKt"
96+
}
97+
9398
tasks.jacocoTestReport {
9499
reports {
95100
xml.isEnabled = true

src/main/kotlin/com/github/gradle/node/util/PlatformHelper.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,13 @@ open class PlatformHelper constructor(private val props: Properties = System.get
4444
var INSTANCE = PlatformHelper()
4545
}
4646
}
47+
48+
fun main(args: Array<String>) {
49+
println("Your os.name is: '${System.getProperty("os.name")}' and is parsed as: ${PlatformHelper.INSTANCE.osName}")
50+
println("Your os.arch is: '${System.getProperty("os.arch")}' and is parsed as: ${PlatformHelper.INSTANCE.osArch}")
51+
if (PlatformHelper.INSTANCE.isWindows) {
52+
println("You're on windows (isWindows == true)")
53+
} else {
54+
println("You're not on windows (isWindows == false)")
55+
}
56+
}

0 commit comments

Comments
 (0)