Skip to content

Commit

Permalink
Merge pull request #6 from gpc/matrei/grails6
Browse files Browse the repository at this point in the history
Update project to Grails 6.1.0
  • Loading branch information
matrei committed Nov 7, 2023
2 parents cc5a967 + 7c7b2f9 commit becdd80
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 94 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: Build

on:
push:
branches: [ master ]
branches: [ master, 6.x.x ]
pull_request:
branches: [ master ]
branches: [ master, 6.x.x ]

jobs:
build:
Expand All @@ -16,10 +16,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '8'
java-version: '11'
distribution: 'adopt'
cache: gradle
- name: Grant execute permission for gradlew
Expand Down
144 changes: 60 additions & 84 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,89 +1,62 @@
buildscript {
repositories {
maven { url "https://repo.grails.org/grails/core" }
maven { url "https://plugins.gradle.org/m2" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion"
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:3.3.4"
classpath "org.grails.plugins:hibernate5:7.2.0"
classpath "io.github.gradle-nexus:publish-plugin:1.0.0"
}
plugins {
id 'eclipse'
id 'idea'
id 'org.grails.grails-plugin'
id 'com.bertramlabs.asset-pipeline'
id 'org.grails.grails-gsp'
id 'maven-publish'
id 'signing'
}

group "io.github.gpc"

apply plugin: "eclipse"
apply plugin: "idea"
apply plugin: "org.grails.grails-plugin"
apply plugin: "asset-pipeline"
apply plugin: "org.grails.grails-gsp"
apply plugin: "maven-publish"
apply plugin: "signing"
apply plugin: "io.github.gradle-nexus.publish-plugin"
group = 'io.github.gpc'

repositories {
maven { url "https://repo.grails.org/grails/core" }
mavenCentral()
maven { url 'https://repo.grails.org/grails/core' }
}

configurations {
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
configureEach {
resolutionStrategy.force 'org.codehaus.groovy:groovy-xml:3.0.13'
}
}

dependencies {

compileOnly "io.micronaut:micronaut-inject-groovy"

implementation "org.grails:grails-logging"
implementation "org.grails:grails-plugin-rest"
implementation "org.grails:grails-plugin-databinding"
implementation "org.grails:grails-plugin-i18n"
implementation "org.grails:grails-plugin-services"
implementation "org.grails.plugins:async"
implementation "org.grails.plugins:scaffolding"
implementation "org.grails.plugins:hibernate5"
implementation "org.hibernate:hibernate-core:5.6.15.Final"
implementation "org.grails.plugins:gsp"
implementation "org.grails.plugins:mail:3.0.0"
compileOnly 'io.micronaut:micronaut-inject-groovy'

implementation 'org.grails:grails-logging'
implementation 'org.grails:grails-plugin-rest'
implementation 'org.grails:grails-plugin-databinding'
implementation 'org.grails:grails-plugin-i18n'
implementation 'org.grails:grails-plugin-services'
implementation 'org.grails.plugins:async'
implementation 'org.grails.plugins:scaffolding'
implementation 'org.grails.plugins:hibernate5'
implementation 'org.hibernate:hibernate-core:5.6.15.Final'
implementation 'org.grails.plugins:gsp'
implementation 'org.grails.plugins:mail:3.0.0'
// This is needed for the quartz-plugin on grails >= 4.0.x, https://github.com/grails-plugins/grails-quartz/issues/107#issuecomment-575951471
implementation("org.quartz-scheduler:quartz:2.3.2") {
exclude group: 'slf4j-api', module: 'c3p0'
}
implementation "org.grails.plugins:quartz:2.0.13"

profile "org.grails.profiles:web-plugin"

runtimeOnly "com.h2database:h2"
runtimeOnly "org.apache.tomcat:tomcat-jdbc"

testImplementation "org.springframework.boot:spring-boot-starter-tomcat"
testImplementation "ch.qos.logback:logback-classic:1.2.12"
testImplementation "ch.qos.logback:logback-core:1.2.12"
testImplementation "io.micronaut:micronaut-inject-groovy"
testImplementation "org.grails:grails-gorm-testing-support"
testImplementation "org.grails:grails-web-testing-support"
}

bootRun {
ignoreExitValue true
jvmArgs(
'-Dspring.output.ansi.enabled=always',
'-noverify',
'-XX:TieredStopAtLevel=1',
'-Xmx1024m')
sourceResources sourceSets.main
String springProfilesActive = 'spring.profiles.active'
systemProperty springProfilesActive, System.getProperty(springProfilesActive)
implementation('org.quartz-scheduler:quartz:2.3.2') { exclude group: 'slf4j-api', module: 'c3p0' }
implementation 'org.grails.plugins:quartz:2.0.13'

testRuntimeOnly 'com.h2database:h2'
testRuntimeOnly 'org.apache.tomcat:tomcat-jdbc'

testImplementation 'org.springframework.boot:spring-boot-starter-tomcat'
//testImplementation "ch.qos.logback:logback-classic:1.2.12"
//testImplementation "ch.qos.logback:logback-core:1.2.12"
testImplementation 'io.micronaut:micronaut-inject-groovy'
testImplementation 'org.grails:grails-gorm-testing-support'
testImplementation 'org.grails:grails-web-testing-support'
}


tasks.withType(GroovyCompile).configureEach {
configure(groovyOptions) {
forkOptions.jvmArgs = ['-Xmx1024m']
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
withSourcesJar()
withJavadocJar()
}

tasks.withType(Test).configureEach {
Expand Down Expand Up @@ -194,7 +167,7 @@ ext."signing.keyId" = project.findProperty('signing.keyId') ?: System.getenv('SI
ext."signing.password" = project.findProperty('signing.password') ?: System.getenv('SIGNING_PASSPHRASE')
ext."signing.secretKeyRingFile" = project.findProperty('signing.secretKeyRingFile') ?: (System.getenv('SIGNING_PASSPHRASE') ?: "${System.getProperty('user.home')}/.gnupg/secring.gpg")

ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
ext.isReleaseVersion = !version.toString().endsWith("SNAPSHOT")

afterEvaluate {
signing {
Expand All @@ -207,25 +180,28 @@ tasks.withType(Sign).configureEach {
onlyIf { isReleaseVersion }
}

nexusPublishing {
repositories {
sonatype {
def ossUser = System.getenv("SONATYPE_USERNAME") ?: project.findProperty('sonatypeOss2Username') ?: ''
def ossPass = System.getenv("SONATYPE_PASSWORD") ?: project.findProperty("sonatypeOss2Password") ?: ''
def ossStagingProfileId = System.getenv("SONATYPE_STAGING_PROFILE_ID") ?: project.findProperty("sonatypeOssStagingProfileIdJms") ?: ''

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
if(project.hasProperty('release')) {
apply plugin: 'io.github.gradle-nexus.publish-plugin'
nexusPublishing {
repositories {
sonatype {
def ossUser = System.getenv("SONATYPE_USERNAME") ?: project.findProperty('sonatypeOss2Username') ?: ''
def ossPass = System.getenv("SONATYPE_PASSWORD") ?: project.findProperty("sonatypeOss2Password") ?: ''
def ossStagingProfileId = System.getenv("SONATYPE_STAGING_PROFILE_ID") ?: project.findProperty("sonatypeOssStagingProfileIdJms") ?: ''

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
}
}
}
}

tasks.register('snapshotVersion') {
doLast {
if (!project.version.endsWith('-SNAPSHOT')) {
if (!project.version.toString().endsWith('-SNAPSHOT')) {
ant.propertyfile(file: "gradle.properties") {
entry(key: "version", value: "${project.version}-SNAPSHOT")
}
Expand Down
10 changes: 10 additions & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
repositories {
mavenCentral()
maven { url 'https://repo.grails.org/grails/core' }
}
dependencies {
implementation 'org.grails:grails-gradle-plugin:6.1.0'
implementation 'org.grails.plugins:hibernate5:8.0.1'
implementation 'io.github.gradle-nexus:publish-plugin:1.3.0'
implementation 'com.bertramlabs.plugins:asset-pipeline-gradle:4.4.0'
}
5 changes: 1 addition & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
grailsVersion=5.3.3
grailsGradlePluginVersion=5.3.0
version=4.0.0-SNAPSHOT
groovyVersion=3.0.14
gorm.version=7.3.3
grailsVersion=6.1.0
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx1024M
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
12 changes: 12 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
pluginManagement {
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core/" }
gradlePluginPortal()
}
plugins {
id "org.grails.grails-web" version "6.1.0"
id "org.grails.grails-gsp" version "6.1.0"
}
}

rootProject.name = 'asynchronous-mail'
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import org.quartz.TriggerKey
@SuppressWarnings('unused')
class AsynchronousMailGrailsPlugin extends Plugin {

def grailsVersion = "5.0.0 > *"
def grailsVersion = "6.0.0 > *"
def loadAfter = ['mail', 'quartz', 'hibernate', 'hibernate3', 'hibernate4', 'hibernate5', 'mongodb']

@Override
Expand Down

0 comments on commit becdd80

Please sign in to comment.