comparison init.gradle @ 123:6f1918544f7f

Add test to cleanLocal to ensure local repo was removed
author smith@nwoca.org
date Wed, 06 Feb 2013 19:58:34 +0000
parents 8ddd1a6fa4ea
children 81a8ecfbc8fa
comparison
equal deleted inserted replaced
122:01dd7d9c930a 123:6f1918544f7f
36 36
37 def local = project.repositories.find { it.name == 'local' } 37 def local = project.repositories.find { it.name == 'local' }
38 if ( local ) { 38 if ( local ) {
39 logger.info "removing local repo: $it" 39 logger.info "removing local repo: $it"
40 new File(System.properties['user.home'] + "/.ssdt/local-repo").deleteDir() 40 new File(System.properties['user.home'] + "/.ssdt/local-repo").deleteDir()
41 new File(gradle.ivyUserDir + "/local").deleteDir() 41 def localDir = new File(gradle.ivyUserDir + "/local")
42 localDir.deleteDir()
43 logger.info "verifying removal of local repo"
44 if (localDir.exists()) {
45 throw new org.gradle.api.GradleException("Unable to clean ${localDir}. Files may be locked by another process.")
46 }
42 } 47 }
43 } 48 }
44 49
45 cleanLocal.onlyIf { 50 cleanLocal.onlyIf {
46 project.repositories.any { it.name == 'local' } 51 project.repositories.any { it.name == 'local' }