@@ -78,7 +78,6 @@ artifacts {
7878}
7979
8080lateinit var publication: MavenPublication
81- lateinit var snapshotRepository: ArtifactRepository
8281lateinit var releaseRepository: NexusRepository
8382
8483publishing {
@@ -92,14 +91,14 @@ publishing {
9291 name.set(provider { " $groupId :$artifactId " })
9392 description.set(" Convert between different string notations commonly found in programming" )
9493 inceptionYear.set(" 2020" )
95- url.set(" https://github.com/jGleitz/string-notation " )
94+ url.set(" https://github.com/$githubRepository " )
9695 ciManagement {
9796 system.set(" GitHub Actions" )
98- url.set(" https://github.com/jGleitz/string-notation /actions" )
97+ url.set(" https://github.com/$githubRepository /actions" )
9998 }
10099 issueManagement {
101100 system.set(" GitHub Issues" )
102- url.set(" https://github.com/jGleitz/string-notation /issues" )
101+ url.set(" https://github.com/$githubRepository /issues" )
103102 }
104103 developers {
105104 developer {
@@ -108,9 +107,9 @@ publishing {
108107 }
109108 }
110109 scm {
111- connection.set(" scm:git:https://github.com/jGleitz/string-notation .git" )
112- developerConnection.set(
" scm:git:git://[email protected] :jGleitz/string-notation .git" )
113- url.set(" https://github.com/jGleitz/string-notation " )
110+ connection.set(" scm:git:https://github.com/$githubRepository .git" )
111+ developerConnection.set(
" scm:git:git://[email protected] :$githubRepository .git" )
112+ url.set(" https://github.com/$githubRepository " )
114113 }
115114 licenses {
116115 license {
@@ -122,15 +121,6 @@ publishing {
122121 }
123122 }
124123 }
125- repositories {
126- snapshotRepository = maven(" https://maven.pkg.github.com/$githubRepository " ) {
127- name = " GitHubPackages"
128- credentials {
129- username = githubOwner
130- password = githubToken
131- }
132- }
133- }
134124}
135125
136126nexusPublishing {
@@ -155,20 +145,12 @@ nexusStaging {
155145}
156146
157147val closeAndReleaseRepository by project.tasks
158- val publish by tasks
159-
160- task(" publishSnapshot" ) {
161- group = " publishing"
162- description = " Publishes a snapshot of the project to GitHub Packages"
163- dependsOn(snapshotRepository.publishTask)
164- }
148+ closeAndReleaseRepository.mustRunAfter(releaseRepository.publishTask)
165149
166150task(" release" ) {
167151 group = " release"
168152 description = " Releases the project to Maven Central"
169- dependsOn(releaseRepository.publishTask)
170- dependsOn(closeAndReleaseRepository)
171- closeAndReleaseRepository.mustRunAfter(releaseRepository.publishTask)
153+ dependsOn(releaseRepository.publishTask, closeAndReleaseRepository)
172154}
173155
174156idea {
@@ -185,6 +167,4 @@ fun String.drop(prefix: String) = if (this.startsWith(prefix)) this.drop(prefix.
185167val Project .versionDetails
186168 get() = (this .extra[" versionDetails" ] as groovy.lang.Closure <* >)() as com.palantir.gradle.gitversion.VersionDetails
187169
188-
189- val ArtifactRepository .publishTask get() = tasks[" publishAllPublicationsTo${this .name} Repository" ]
190170val NexusRepository .publishTask get() = tasks[" publishTo${this .name.capitalize()} " ]
0 commit comments