Skip to content

Commit

Permalink
Grace: update gradle build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
rainboyan committed Feb 29, 2024
1 parent c427646 commit 68374e7
Show file tree
Hide file tree
Showing 16 changed files with 266 additions and 102 deletions.
139 changes: 105 additions & 34 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,61 +1,132 @@
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven { url "https://repo.grails.org/grails/core" }
maven { url 'https://repo.gradle.org/gradle/libs-releases' }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "org.grails:grails-docs:$grailsVersion"
classpath "io.github.gradle-nexus:publish-plugin:1.3.0"
classpath "org.graceframework:grace-gradle-plugin:$graceVersion"
classpath "org.gradle:test-retry-gradle-plugin:1.4.0"
classpath "io.spring.gradle:dependency-management-plugin:$springDependencyManagementPluginVersion"
}
}

repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
version project.projectVersion

ext {
commonBuild = 'https://raw.githubusercontent.com/rainboyan/grails-common-build/22.0.x'
isReleaseVersion = !project.projectVersion.endsWith('-SNAPSHOT')
graceVersion = project.graceVersion
userOrg = "graceframework"
}

subprojects {

version project.projectVersion
version project.projectVersion

apply plugin:'idea'

ext {
userOrg = "grails"
isGrailsPlugin = name.startsWith('grails-plugin')
isBuildSnapshot = version.toString().endsWith("-SNAPSHOT")
apply plugin: 'maven-publish'
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
}
}
}

if(isGrailsPlugin) {
group "org.grails.plugins"
subprojects { project->
if (project.name.startsWith('grace-plugin')) {
group "org.graceframework.plugins"
}
else {
group "org.grails"
group "org.graceframework"
}
version project.projectVersion

repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
if (project.name.startsWith('examples') || project.name.endsWith('docs')) {
return
}

if (it.projectDir.path.endsWith("examples/${it.name}".toString())) {
apply plugin:"org.grails.grails-web"
}
else if (isGrailsPlugin) {
apply from: resources.text.fromInsecureUri("${commonBuild}/common-plugin.gradle")
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'java-library'
apply plugin: 'groovy'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: "org.gradle.test-retry"
apply plugin: "io.spring.dependency-management"

sourceCompatibility = 11
targetCompatibility = 11

repositories {
mavenCentral()
maven { url 'https://repo.gradle.org/gradle/libs-releases' }
}
else {
apply from: resources.text.fromInsecureUri("${commonBuild}/common-project.gradle")

dependencyManagement {
imports {
mavenBom "org.graceframework:grace-bom:$graceVersion"
}
applyMavenExclusions false
}

dependencies {
compileOnly 'javax.annotation:javax.annotation-api:1.3.2'
apply from: '../publishing/mavenCentral.gradle'


if (project.name.startsWith('grace-')) {

configurations {
documentation
}

dependencies {
api "org.codehaus.groovy:groovy:$groovyVersion"
api "org.slf4j:slf4j-api:$slf4jVersion"
api "javax.inject:javax.inject:1"
api "javax.annotation:javax.annotation-api:1.3.2"
documentation "org.fusesource.jansi:jansi:$jansiVersion"
documentation "org.codehaus.groovy:groovy-dateutil:$groovyVersion"
documentation "info.picocli:picocli:4.6.3"
documentation "com.github.javaparser:javaparser-core:$javaParserCoreVersion"

testImplementation "org.spockframework:spock-core:$spockVersion"
testImplementation "net.bytebuddy:byte-buddy:1.14.5"
testImplementation "org.objenesis:objenesis:3.2"
testImplementation "org.codehaus.groovy:groovy-test-junit5:${groovyVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-api:5.8.2"
testImplementation "org.junit.platform:junit-platform-runner:1.8.2"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.8.2"
}

java {
withJavadocJar()
withSourcesJar()
}

tasks.withType(Test) {
useJUnitPlatform()
testLogging {
showStandardStreams = true
exceptionFormat = 'full'
}
configure {
retry {
maxRetries = 2
maxFailures = 20
failOnPassedAfterRetry = true
}
}
}

groovydoc.classpath = configurations.documentation
}
}

apply from:"${commonBuild}/common-publishing.gradle"
apply from:"${commonBuild}/common-docs.gradle"
}
42 changes: 21 additions & 21 deletions examples/pubsub-demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ dependencies {
implementation "org.springframework.boot:spring-boot-starter-actuator"
implementation "org.springframework.boot:spring-boot-starter-web"
implementation "org.springframework.boot:spring-boot-starter-tomcat"
implementation "org.grails:grails-boot"
implementation "org.grails:grails-core"
implementation "org.grails:grails-plugin-codecs"
implementation "org.grails:grails-plugin-controllers"
implementation "org.grails:grails-plugin-datasource"
implementation "org.grails:grails-plugin-databinding"
implementation "org.grails:grails-plugin-domain-class"
implementation "org.grails:grails-plugin-i18n"
implementation "org.grails:grails-plugin-interceptors"
implementation "org.grails:grails-plugin-rest"
implementation "org.grails:grails-plugin-services"
implementation "org.grails:grails-plugin-url-mappings"
implementation project(":grails-plugin-async")
runtimeOnly project(":grails-events-rxjava")
// runtimeOnly project(":grails-async-rxjava")
implementation "org.grails:grails-web-boot"
implementation "org.grails:grails-logging"
implementation "org.graceframework:grace-boot"
implementation "org.graceframework:grace-core"
implementation "org.graceframework:grace-plugin-codecs"
implementation "org.graceframework:grace-plugin-controllers"
implementation "org.graceframework:grace-plugin-datasource"
implementation "org.graceframework:grace-plugin-databinding"
implementation "org.graceframework:grace-plugin-domain-class"
implementation "org.graceframework:grace-plugin-i18n"
implementation "org.graceframework:grace-plugin-interceptors"
implementation "org.graceframework:grace-plugin-rest"
implementation "org.graceframework:grace-plugin-services"
implementation "org.graceframework:grace-plugin-url-mappings"
implementation project(":grace-plugin-async")
runtimeOnly project(":grace-events-rxjava")
// runtimeOnly project(":grace-async-rxjava")
implementation "org.graceframework:grace-web-boot"
implementation "org.graceframework:grace-logging"
implementation "org.grails.plugins:cache", {
exclude module:'asset-pipeline-grails'
}
Expand All @@ -43,14 +43,14 @@ dependencies {
implementation "org.hibernate:hibernate-ehcache:$hibernateCoreVersion"
implementation "org.grails.plugins:views-json"
implementation "org.grails.plugins:views-json-templates"
console "org.grails:grails-console"
console "org.graceframework:grace-console"
profile "org.grails.profiles:rest-api"
runtimeOnly "com.h2database:h2"
runtimeOnly "org.apache.tomcat:tomcat-jdbc"

testImplementation "org.grails:grails-plugin-testing"
testImplementation "org.grails:grails-gorm-testing-support"
testImplementation "org.grails:grails-web-testing-support"
testImplementation "org.graceframework:grace-plugin-testing"
testImplementation "org.graceframework:grace-gorm-testing-support"
testImplementation "org.graceframework:grace-web-testing-support"
testImplementation "io.micronaut:micronaut-http-client:$micronautVersion"
}

Expand Down
2 changes: 1 addition & 1 deletion grace-async-gpars/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dependencies {
api project(":grails-async")
api project(":grace-async")
implementation 'org.codehaus.gpars:gpars:1.2.1', {
exclude group:'org.multiverse', module:'multiverse-core'
exclude group:'org.codehaus.groovy', module: 'groovy-all'
Expand Down
2 changes: 1 addition & 1 deletion grace-async-rxjava/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dependencies {
api project(":grails-async")
api project(":grace-async")
implementation "io.reactivex:rxjava:$rxJavaVersion"
}

Expand Down
2 changes: 1 addition & 1 deletion grace-async-rxjava2/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dependencies {
api project(":grails-async")
api project(":grace-async")
implementation "io.reactivex.rxjava2:rxjava:$rxJava2Version"
}
2 changes: 1 addition & 1 deletion grace-events-compat/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dependencies {
api project(":grails-events"), project(":grails-events-transform")
api project(":grace-events"), project(":grace-events-transform")
}
2 changes: 1 addition & 1 deletion grace-events-gpars/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dependencies {
api project(":grails-events")
api project(":grace-events")
implementation 'org.codehaus.gpars:gpars:1.2.1', {
exclude group:'org.multiverse', module:'multiverse-core'
exclude group:'org.codehaus.groovy', module: 'groovy-all'
Expand Down
8 changes: 4 additions & 4 deletions grace-events-rxjava/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
dependencies {
api project(":grails-events")
api project(":grace-events")
implementation "io.reactivex:rxjava:$rxJavaVersion"

testImplementation project(":grails-events-transform")
testImplementation "org.grails:grails-datastore-gorm-test:$gormVersion", {
exclude group:'org.grails', module:'grails-datastore-gorm-validation'
testImplementation project(":grace-events-transform")
testImplementation "org.graceframework:grace-datastore-gorm-test:$gormVersion", {
exclude group:'org.graceframework', module:'grace-datastore-gorm-validation'
}
}
2 changes: 1 addition & 1 deletion grace-events-rxjava2/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dependencies {
api project(":grails-events")
api project(":grace-events")
implementation "io.reactivex.rxjava2:rxjava:$rxJava2Version"
}
2 changes: 1 addition & 1 deletion grace-events-spring/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dependencies {
api project(":grails-events")
api project(":grace-events")
implementation "org.springframework:spring-context:$springVersion"
}
10 changes: 5 additions & 5 deletions grace-events-transform/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
dependencies {
api project(":grails-events")
compileOnly "org.grails:grails-datastore-gorm:$gormVersion", {
exclude group:'org.grails', module:'grails-datastore-gorm-validation'
api project(":grace-events")
compileOnly "org.graceframework:grace-datastore-gorm:$gormVersion", {
exclude group:'org.graceframework', module:'grace-datastore-gorm-validation'
}

testRuntimeOnly "org.springframework:spring-aop:$springVersion"
testRuntimeOnly "org.springframework:spring-expression:$springVersion"
testImplementation "org.grails:grails-datastore-gorm-test:$gormVersion", {
exclude group:'org.grails', module:'grails-datastore-gorm-validation'
testImplementation "org.graceframework:grace-datastore-gorm-test:$gormVersion", {
exclude group:'org.graceframework', module:'grace-datastore-gorm-validation'
}
}
8 changes: 4 additions & 4 deletions grace-plugin-async/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
dependencies {
compileOnly "javax.servlet:javax.servlet-api:$servletApiVersion"
implementation "org.grails:grails-plugin-controllers:$grailsVersion"
api project(':grails-plugin-events')
api project(':grails-async')
implementation "org.graceframework:grace-plugin-controllers:$graceVersion"
api project(':grace-plugin-events')
api project(':grace-async')

testImplementation "javax.servlet:javax.servlet-api:$servletApiVersion"
testImplementation "org.grails:grails-test:$grailsVersion"
testImplementation "org.graceframework:grace-test:$graceVersion"
testImplementation "org.springframework:spring-test:$springVersion"
}
6 changes: 3 additions & 3 deletions grace-plugin-events/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dependencies {
api "org.grails:grails-core:$grailsVersion"
api project(":grails-events"), project(":grails-events-transform")
api project(":grails-events-compat")
api "org.graceframework:grace-core:$graceVersion"
api project(":grace-events"), project(":grace-events-transform")
api project(":grace-events-compat")
}
19 changes: 11 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
title=Grails Async Framework
authors=Graeme Rocher
title=Grace Async Framework
authors=Michael Yan
projectVersion=5.2.0-SNAPSHOT
projectDesc=Grails Async Libraries
projectUrl=https://github.com/grails/grails-async
githubSlug=grails/grails-async
projectDesc=Grace Async Libraries
projectUrl=https://github.com/graceframework/grace-async
githubSlug=graceframework/grace-async
githubBranch=master
developers=Graeme Rocher
grailsVersion=2022.1.2
developers=Michael Yan
graceVersion=2022.1.2
groovyVersion=3.0.16
gormVersion=2022.2.0
gormVersion=2022.1.2
jansiVersion=1.18
javaParserCoreVersion=3.15.14
servletApiVersion=4.0.1
spockVersion=2.3-groovy-3.0
springDependencyManagementPluginVersion=1.0.15.RELEASE
springVersion=5.3.25
slf4jVersion=1.7.36
rxJavaVersion=1.3.8
Expand Down
Loading

0 comments on commit 68374e7

Please sign in to comment.