How do you support a Gradle Exec task for both Mac and PC?

You can conditionally set the commandLine property based on the value of a system property.

if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
    commandLine 'cmd', '/c', 'stop.cmd'
} else {
    commandLine './stop.sh'
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)