Skip to content
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 19 commits into from
Oct 19, 2024
Merged
Show file tree
Hide file tree
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 Oct 15, 2024
d5b0308
grails-156: Commit paritally working code for help
amondel2 Oct 15, 2024
9da6685
grails-156: Commit partially working code for help
amondel2 Oct 15, 2024
8ee5b6a
grails-156: Fix the example application so it runs and all the test a…
amondel2 Oct 16, 2024
b3d1917
grails-156: Update Project Version of the example to be the same as t…
amondel2 Oct 16, 2024
e3d46ef
grails-156: Update Project Version of the example to be the same as t…
amondel2 Oct 16, 2024
fbd180e
grails-156: Update Project Version of the example to be the same as t…
amondel2 Oct 16, 2024
b85897c
grails-156: Update Project Version of the example to be the same as t…
amondel2 Oct 16, 2024
bf1df8c
grails-156: Update Project Version of the example to be the same as t…
amondel2 Oct 16, 2024
efc9cb7
grails-156: Update Project Version of the example to be the same as t…
amondel2 Oct 16, 2024
a567995
grails-156: Update Project Version of the example to be the same as t…
amondel2 Oct 16, 2024
97d0c4f
grails-156: Update Project Version of the example to be the same as t…
amondel2 Oct 16, 2024
83d5d6e
grails-156: Put the Keys back
amondel2 Oct 17, 2024
22c6df4
Merge pull request #1 from amondel2/grails-156
amondel2 Oct 17, 2024
df8c7fc
grails-156: Update H2 version to latest (#2)
amondel2 Oct 17, 2024
767557c
Grails 156 (#3)
amondel2 Oct 18, 2024
6f183dd
Merge remote-tracking branch 'no-forking/5.0.x' into 5.0.x
amondel2 Oct 19, 2024
04a1fb3
Grails 156 (#4)
amondel2 Oct 19, 2024
5aaf7d3
Merge branch '5.0.x' into 5.0.x
jamesfredley Oct 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 29 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@

plugins {
id "java-library"
id "org.grails.internal.grails-plugin-publish"
id "org.grails.grails-gsp"
id "org.grails.grails-plugin"
id 'maven-publish'
id 'io.github.gradle-nexus.publish-plugin'
}

version = project.projectVersion
group = 'org.grails.plugins'

ext.set('isSnapshot', projectVersion.endsWith('-SNAPSHOT'))
ext.set('isReleaseVersion', !isSnapshot)

ext.set('signing.keyId', project.findProperty('signing.keyId') ?: System.getenv('SIGNING_KEY'))
ext.set('signing.secretKeyRingFile', project.findProperty('signing.secretKeyRingFile') ?: System.getenv('SIGNING_PASSPHRASE') ?: "${System.properties['user.home']}${File.separator}.gnupg${File.separator}secring.gpg")
ext.set('signing.password', project.findProperty("signing.password") ?: System.getenv('SIGNING_PASSPHRASE'))




allprojects {

repositories {
Expand All @@ -23,13 +34,21 @@ allprojects {
}
}

grailsPublish {
userOrg = 'grails'
githubSlug = 'grails/redis'
license {
name = 'Apache-2.0'
if (isReleaseVersion) {
apply plugin: "io.github.gradle-nexus.publish-plugin"

nexusPublishing {
repositories {
sonatype {
def ossUser = System.getenv("SONATYPE_USERNAME") ?: project.hasProperty("sonatypeOssUsername") ? project.sonatypeOssUsername : ''
def ossPass = System.getenv("SONATYPE_PASSWORD") ?: project.hasProperty("sonatypeOssPassword") ? project.sonatypeOssPassword : ''
def ossStagingProfileId = System.getenv("SONATYPE_STAGING_PROFILE_ID") ?: project.hasProperty("sonatypeOssStagingProfileId") ? project.sonatypeOssStagingProfileId : ''
nexusUrl = uri("https://s01.oss.sonatype.org/service/local/")
snapshotRepositoryUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
username = ossUser
password = ossPass
stagingProfileId = ossStagingProfileId
}
}
title = 'Grails Redis Plugin'
desc = 'This Plugin provides access to Redis and various utilities(service, annotations, etc) for caching.'
developers = [puneetbehl: 'Puneet Behl']
}
}
}
9 changes: 9 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ jredisVersion=5.2.0
scaffoldingVersion=6.0.0-SNAPSHOT
xmlBindApiVersion=4.0.2

title=Grails Redis Plugin
authors=Puneet Behl
projectDesc=This Plugin provides access to Redis and various utilities(service, annotations, etc) for caching.
projectUrl=https://github.com/grails/grails-redis
githubSlug=/grails/grails-redis
githubBranch=5.0.x
developers=Christian Oestreich, Puneet Behl


org.gradle.caching=true
org.gradle.daemon=true
org.gradle.parallel=true
Expand Down
92 changes: 92 additions & 0 deletions plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ plugins {
id "eclipse"
id "idea"
id "org.grails.grails-plugin"
id 'signing'
id 'maven-publish'
}

version = project.projectVersion
Expand All @@ -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"
Expand Down Expand Up @@ -55,6 +89,10 @@ dependencies {
}
}

groovydoc {
Copy link
Contributor Author

@amondel2 amondel2 Oct 19, 2024

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.

groovyClasspath += configurations.documentation
}

test {
useJUnitPlatform()
}
Expand All @@ -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 }
}
35 changes: 17 additions & 18 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@

plugins {
id "com.gradle.develocity" version "3.18.1"
id "com.gradle.enterprise" version '3.16.2'
id 'com.gradle.common-custom-user-data-gradle-plugin' version '2.0.2'
}

def isCI = System.getenv('CI') != null
def isLocal = !isCI
def isAuthenticated = System.getenv('DEVELOCITY_ACCESS_KEY') != null
def isBuildCacheAuthenticated =
System.getenv('DEVELOCITY_BUILD_CACHE_NODE_USER') != null &&
System.getenv('DEVELOCITY_BUILD_CACHE_NODE_KEY') != null

develocity {
gradleEnterprise {
server = 'https://ge.grails.org'
buildScan {
publishing.onlyIf { isAuthenticated }
uploadInBackground = isLocal
publishAlwaysIf(System.getenv('CI') == 'true')
publishIfAuthenticated()
uploadInBackground = System.getenv('CI') == null
capture {
taskInputFiles = true
}
}
}

buildCache {
local { enabled = isLocal }
remote(develocity.buildCache) {
push = isCI && isBuildCacheAuthenticated
local { enabled = System.getenv('CI') != 'true' }
remote(HttpBuildCache) {
push = System.getenv('CI') == 'true'
enabled = true
usernameAndPassword(
System.getenv('DEVELOCITY_BUILD_CACHE_NODE_USER') ?: '',
System.getenv('DEVELOCITY_BUILD_CACHE_NODE_KEY') ?: ''
)
url = 'https://ge.grails.org/cache/'
credentials {
username = System.getenv('GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER')
password = System.getenv('GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY')
}
}
}

rootProject.name = "grails-redis"

include "examples-redis-demo"
Expand Down
Loading