forked from grails/grails-redis
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
grails#160 and grails#156: Update code to hopefully deploy. Modeled a…
…fter the async plugin.
- Loading branch information
Showing
4 changed files
with
147 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ plugins { | |
id "eclipse" | ||
id "idea" | ||
id "org.grails.grails-plugin" | ||
id 'signing' | ||
id 'maven-publish' | ||
} | ||
|
||
version = project.projectVersion | ||
|
@@ -14,6 +16,38 @@ java { | |
} | ||
} | ||
|
||
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" | ||
|
@@ -55,6 +89,10 @@ dependencies { | |
} | ||
} | ||
|
||
groovydoc { | ||
groovyClasspath += configurations.documentation | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} | ||
|
@@ -63,3 +101,57 @@ jar { | |
exclude "application.groovy" | ||
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') | ||
} | ||
} | ||
} | ||
|
||
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 } | ||
} |
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