-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #164 from jdaugherty/5.0.x
Updating for grails-publish changes
- Loading branch information
Showing
5 changed files
with
23 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,51 +3,19 @@ plugins { | |
id "eclipse" | ||
id "idea" | ||
id "org.grails.grails-plugin" | ||
id 'signing' | ||
id 'maven-publish' | ||
} | ||
|
||
version = project.projectVersion | ||
group = "org.grails.plugins" | ||
|
||
apply plugin: 'org.grails.grails-publish' | ||
|
||
java { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(17) | ||
} | ||
} | ||
|
||
def isGrailsPlugin = project.group == 'org.grails.plugins' | ||
def pomInfo = { | ||
delegate.name project.title | ||
delegate.description project.projectDesc | ||
delegate.url 'https://github.com/grails/grails-redis' | ||
|
||
delegate.licenses { | ||
delegate.license { | ||
delegate.name 'Apache-2.0' | ||
delegate.url 'https://www.apache.org/licenses/LICENSE-2.0.txt' | ||
delegate.distribution 'repo' | ||
} | ||
} | ||
|
||
delegate.scm { | ||
delegate.url "scm:[email protected]:${githubSlug}.git" | ||
delegate.connection "https://github.com${githubSlug}" | ||
delegate.developerConnection "scm:git:ssh://github.com:${githubSlug}.git" | ||
} | ||
|
||
if (developers) { | ||
delegate.developers { | ||
for (dev in developers.split(',')) { | ||
delegate.developer { | ||
delegate.id dev.toLowerCase().replace(' ', '') | ||
delegate.name dev.strip() | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
dependencyManagement { | ||
imports { | ||
mavenBom "org.grails:grails-bom:$grailsVersion" | ||
|
@@ -102,56 +70,16 @@ jar { | |
exclude "src/test/projects/**" | ||
} | ||
|
||
publishing { | ||
|
||
if (isSnapshot) { | ||
repositories { | ||
maven { | ||
credentials { | ||
def u = System.getenv("ARTIFACTORY_USERNAME") ?: project.findProperty("artifactoryPublishUsername") ?: '' | ||
def p = System.getenv("ARTIFACTORY_PASSWORD") ?: project.findProperty("artifactoryPublishPassword") ?: '' | ||
username = u | ||
password = p | ||
} | ||
url = isGrailsPlugin ? | ||
uri('https://repo.grails.org/grails/plugins3-snapshots-local') : | ||
uri('https://repo.grails.org/grails/libs-snapshots-local') | ||
} | ||
} | ||
grailsPublish { | ||
githubSlug = 'grails/grails-redis' | ||
license { | ||
name = 'Apache-2.0' | ||
} | ||
|
||
publications { | ||
maven(MavenPublication) { | ||
|
||
groupId = project.group | ||
version = project.version | ||
|
||
from components.java | ||
|
||
artifact sourcesJar | ||
artifact javadocJar | ||
|
||
pom.withXml { | ||
|
||
def pomNode = asNode() | ||
pomNode.children().last() + pomInfo | ||
|
||
// dependency management shouldn't be included | ||
try { pomNode.dependencyManagement.replaceNode({}) } catch (Throwable ignore) {} | ||
} | ||
} | ||
} | ||
} | ||
|
||
if (isReleaseVersion) { | ||
afterEvaluate { | ||
signing { | ||
required = { isReleaseVersion && gradle.taskGraph.hasTask('publish') } | ||
sign(publishing.publications.maven) | ||
} | ||
} | ||
} | ||
|
||
tasks.withType(Sign) { | ||
onlyIf { isReleaseVersion } | ||
} | ||
title = 'Grails Redis Plugin' | ||
desc = 'This Plugin provides access to Redis and various utilities (service, annotations, etc) for caching.' | ||
developers = ['tednaleid': 'Ted Naleid', 'burtbeckwith': 'Burt Beckwith', 'christianoestreich': 'Christian Oestreich', | ||
'briancoles': 'Brian Coles', 'michaelcameron': 'Michael Cameron', 'johnengelman': 'John Engelman', | ||
'davidseiler': 'David Seiler', 'jordonsaardchit': 'Jordon Saardchit', 'florianlangenhahn': 'Florian Langenhahn', | ||
'germansancho': 'German Sancho', 'johnmulhern': 'John Mulhern', 'shaunjurgemeyer': 'Shaun Jurgemeyer', | ||
'puneetbehl': 'Puneet Behl'] | ||
} |