comparison init70.gradle @ 298:95d4eb5bff0f

remove code that was removing the ssdt_ohio dir in maven local. add publish local task if the project is a local repo and publish ivy is available.
author Marc Davis <marc.davis@mcoecn.org>
date Thu, 22 Dec 2022 14:39:22 -0500
parents ca537e63716d
children 69213629de0f
comparison
equal deleted inserted replaced
297:da59b3f03c2c 298:95d4eb5bff0f
213 def localDir = new File(gradle.ivyUserDir + "/local") 213 def localDir = new File(gradle.ivyUserDir + "/local")
214 localDir.deleteDir() 214 localDir.deleteDir()
215 logger.info "verifying removal of local repo" 215 logger.info "verifying removal of local repo"
216 if (localDir.exists()) { 216 if (localDir.exists()) {
217 throw new org.gradle.api.GradleException("Unable to clean ${localDir}. Files may be locked by another process.") 217 throw new org.gradle.api.GradleException("Unable to clean ${localDir}. Files may be locked by another process.")
218 }
219 logger.info "removing local maven repo"
220 def localMaven = new File(System.getProperty('user.home') + "/.m2/repository/org/ssdt_ohio")
221 localMaven.deleteDir()
222 logger.info "verifying removal of local maven repo"
223 if (localMaven.exists()) {
224 throw new org.gradle.api.GradleException("Unable to clean ${localMaven}. File may be locked by another process.")
225 } 218 }
226 } 219 }
227 } 220 }
228 } 221 }
229 222
490 thisProject.repositories.addLast(it) 483 thisProject.repositories.addLast(it)
491 } 484 }
492 } 485 }
493 logger.info "$thisProject configured repositories:\n" + thisProject.repositories.collect {"\t$it.name ${it.hasProperty('url') ? it.url : '' }" }.join('\n') 486 logger.info "$thisProject configured repositories:\n" + thisProject.repositories.collect {"\t$it.name ${it.hasProperty('url') ? it.url : '' }" }.join('\n')
494 487
495 // This will not trigger anymore with the upgrade to grade 7 488 /*
496 // if (thisProject.repositories.find { it.name == 'local' } && thisProject.getTasksByName('uploadArchives', false)) { 489 * Add a new task for local repos that declare an Ivy publish configuration
497 // uploadArchives { 490 * This is a workaround for how the older versions handled the publishLocal
498 // repositories { 491 * task and the updateArchive option that was removed in gradle 7.0
499 // add thisProject.repositories.local 492 */
500 // } 493 if (thisProject.repositories.find { it.name == 'local' } && thisProject.getTasksByName('publishIvyPublicationToLocalRepository', false)) {
501 // } 494 thisProject.tasks.create("publishLocal") {
502 // 495 description = "Publishes this projects artifacts to developer's local repository"
503 // thisProject.tasks.create("publishLocal") { 496 dependsOn = ["publishIvyPublicationToLocalRepository"]
504 // description = "Publishes this projects artifacts to developer's local repository" 497 }
505 // dependsOn = ["uploadArchives"] 498 }
506 // }
507 // }
508 499
509 } 500 }
510 501
511 root.subprojects { p -> 502 root.subprojects { p ->
512 if (root.useIndy()) { 503 if (root.useIndy()) {