build: fix error handling in build.gradle
@@ -53,6 +53,11 @@ clean.doLast {
task setDockerProvider {
doLast {
project.ext.useDockerProvider = true
+
+ def vboxDir = new File('.vagrant/machines/builder-debian/virtualbox')
+ if (vboxDir.exists()) {
+ throw new GradleException('Cannot build with Docker without removing VirtualBox builder first!')
+ }
}
}
@@ -60,11 +65,6 @@ task buildDocker {
group 'Ockam'
description 'Build with Docker'
- def vboxDir = new File('.vagrant/machines/builder-debian/virtualbox')
- if (vboxDir.exists()) {
- throw new GradleException('Cannot build with Docker without removing VirtualBox builder first!')
- }
-
dependsOn setDockerProvider
dependsOn build
tasks.findByName('build').mustRunAfter 'setDockerProvider'
