# HG changeset patch # User Marc Davis # Date 1671737962 18000 # Node ID 95d4eb5bff0fe3bd6b9faf80b7353315236c3e55 # Parent da59b3f03c2c9a022484d7fd94c5ae6a205918c4 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. diff -r da59b3f03c2c -r 95d4eb5bff0f init70.gradle --- a/init70.gradle Wed Dec 21 15:23:12 2022 -0500 +++ b/init70.gradle Thu Dec 22 14:39:22 2022 -0500 @@ -216,13 +216,6 @@ if (localDir.exists()) { throw new org.gradle.api.GradleException("Unable to clean ${localDir}. Files may be locked by another process.") } - logger.info "removing local maven repo" - def localMaven = new File(System.getProperty('user.home') + "/.m2/repository/org/ssdt_ohio") - localMaven.deleteDir() - logger.info "verifying removal of local maven repo" - if (localMaven.exists()) { - throw new org.gradle.api.GradleException("Unable to clean ${localMaven}. File may be locked by another process.") - } } } } @@ -492,19 +485,17 @@ } logger.info "$thisProject configured repositories:\n" + thisProject.repositories.collect {"\t$it.name ${it.hasProperty('url') ? it.url : '' }" }.join('\n') - // This will not trigger anymore with the upgrade to grade 7 -// if (thisProject.repositories.find { it.name == 'local' } && thisProject.getTasksByName('uploadArchives', false)) { -// uploadArchives { -// repositories { -// add thisProject.repositories.local -// } -// } -// -// thisProject.tasks.create("publishLocal") { -// description = "Publishes this projects artifacts to developer's local repository" -// dependsOn = ["uploadArchives"] -// } -// } + /* + * Add a new task for local repos that declare an Ivy publish configuration + * This is a workaround for how the older versions handled the publishLocal + * task and the updateArchive option that was removed in gradle 7.0 + */ + if (thisProject.repositories.find { it.name == 'local' } && thisProject.getTasksByName('publishIvyPublicationToLocalRepository', false)) { + thisProject.tasks.create("publishLocal") { + description = "Publishes this projects artifacts to developer's local repository" + dependsOn = ["publishIvyPublicationToLocalRepository"] + } + } }