import org.junit.Assert

task checkGradleUserHomeViaSystemEnv << {
    Assert.assertEquals(file('customUserHome').absolutePath, gradle.gradleUserHomeDir.absolutePath)
}

task checkDefaultGradleUserHome<< {
    Assert.assertEquals(new File(System.properties['user.home'], ".gradle").absolutePath, gradle.gradleUserHomeDir.absolutePath)
}

task checkSystemPropertyGradleUserHomeHasPrecedence << {
    Assert.assertEquals(file('systemPropCustomUserHome').absolutePath, gradle.gradleUserHomeDir.absolutePath)
}
