-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
* #160 and #156: Fix Publishing #161
Merged
Merged
Changes from 18 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
acba56d
grails-156: Commit paritally working code for help
amondel2 d5b0308
grails-156: Commit paritally working code for help
amondel2 9da6685
grails-156: Commit partially working code for help
amondel2 8ee5b6a
grails-156: Fix the example application so it runs and all the test a…
amondel2 b3d1917
grails-156: Update Project Version of the example to be the same as t…
amondel2 e3d46ef
grails-156: Update Project Version of the example to be the same as t…
amondel2 fbd180e
grails-156: Update Project Version of the example to be the same as t…
amondel2 b85897c
grails-156: Update Project Version of the example to be the same as t…
amondel2 bf1df8c
grails-156: Update Project Version of the example to be the same as t…
amondel2 efc9cb7
grails-156: Update Project Version of the example to be the same as t…
amondel2 a567995
grails-156: Update Project Version of the example to be the same as t…
amondel2 97d0c4f
grails-156: Update Project Version of the example to be the same as t…
amondel2 83d5d6e
grails-156: Put the Keys back
amondel2 22c6df4
Merge pull request #1 from amondel2/grails-156
amondel2 df8c7fc
grails-156: Update H2 version to latest (#2)
amondel2 767557c
Grails 156 (#3)
amondel2 6f183dd
Merge remote-tracking branch 'no-forking/5.0.x' into 5.0.x
amondel2 04a1fb3
Grails 156 (#4)
amondel2 5aaf7d3
Merge branch '5.0.x' into 5.0.x
jamesfredley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed I deleted this in original PR but I think we might want it.