Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/2.1.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
puneetbehl committed Jan 5, 2021
2 parents 2f10d89 + fd17fb7 commit 6a4ebf2
Show file tree
Hide file tree
Showing 24 changed files with 148 additions and 30 deletions.
11 changes: 11 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
name-template: $NEXT_PATCH_VERSION
tag-template: v$NEXT_PATCH_VERSION
version-resolver:
major:
labels:
- 'type: major'
minor:
labels:
- 'type: minor'
patch:
labels:
- 'type: patch'
default: patch
categories:
- title: 🚀 Features
labels:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ on:
push:
branches:
- master
- '[2-9]+.[2-9]+.x'
- '[2-9]+.[1-9]+.x'
pull_request:
branches:
- master
- '[2-9]+.[2-9]+.x'
- '[2-9]+.[1-9]+.x'
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -33,7 +33,7 @@ jobs:
run: |
[ -f ./setup.sh ] && ./setup.sh || true
- name: Run Tests
run: ./gradlew check
run: ./gradlew classes check --no-daemon
- name: Publish Test Report
uses: scacap/action-surefire-report@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
branches:
- master
- '[2-9]+.[2-9]+.x'
- '[2-9]+.[1-9]+.x'
jobs:
release_notes:
runs-on: ubuntu-latest
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Release
on:
release:
types: [published]
jobs:
release:
runs-on: ubuntu-latest
strategy:
matrix:
java: ['8']
env:
GIT_USER_NAME: puneetbehl
GIT_USER_EMAIL: [email protected]
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
token: ${{ secrets.GH_TOKEN }}
- uses: gradle/wrapper-validation-action@v1
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Set the current release version
id: release_version
run: echo ::set-output name=release_version::${GITHUB_REF:11}
- name: Run pre-release
uses: micronaut-projects/github-actions/pre-release@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish, Upload to Bintray
env:
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
run: |
echo "Publishing Artifacts"
./gradlew bintrayUpload
echo "Publishing Docs..."
./gradlew docs
- name: Export Gradle Properties
uses: micronaut-projects/github-actions/export-gradle-properties@master
- name: Publish to Github Pages
if: success()
uses: micronaut-projects/github-pages-deploy-action@master
env:
BETA: ${{ contains(steps.release_version.outputs.release_version, 'M') || contains(steps.release_version.outputs.release_version, 'RC') }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
BRANCH: gh-pages
FOLDER: build/docs
VERSION: ${{ steps.release_version.outputs.release_version }}
COMMIT_EMAIL: ${{ env.GIT_USER_EMAIL }}
COMMIT_NAME: ${{ env.GIT_USER_NAME }}
- name: Run post-release
if: success()
uses: micronaut-projects/github-actions/post-release@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
env:
SNAPSHOT_SUFFIX: .BUILD-SNAPSHOT
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: groovy
branches:
only:
- 7.0.x
- 6.1.x
- 1.1.x
- 2.0.x
jdk:
- openjdk8
- openjdk11
Expand Down
3 changes: 3 additions & 0 deletions apps/demo33/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
grailsVersion=4.1.0.BUILD-SNAPSHOT
gormVersion=7.1.0.BUILD-SNAPSHOT
gradleWrapperVersion=6.5
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx1024M
3 changes: 3 additions & 0 deletions apps/demo33/grails-app/conf/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,6 @@ environments:
testOnReturn: false
jdbcInterceptors: ConnectionState
defaultTransactionIsolation: 2 # TRANSACTION_READ_COMMITTED
---
demo:
foo: bar
5 changes: 4 additions & 1 deletion apps/demo33/grails-app/init/demo/Application.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ package demo
import grails.boot.GrailsApp
import grails.boot.config.GrailsAutoConfiguration

import groovy.transform.CompileStatic

@CompileStatic
class Application extends GrailsAutoConfiguration {
static void main(String[] args) {
GrailsApp.run(Application, args)
}
}
}
7 changes: 3 additions & 4 deletions apps/demo33/grails-app/services/demo/CarService.groovy
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package demo

import grails.gorm.services.Service

@Service(Car)
class CarService{
List<Car> list(){
class CarService {

List<Car> list() {
Car.list()
}
}
9 changes: 9 additions & 0 deletions apps/demo33/grails-app/services/demo/TestService.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package demo

import org.springframework.beans.factory.annotation.Value

class TestService {

@Value('${demo.foo}')
String foo
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import grails.testing.web.controllers.ControllerUnitTest
class PersonControllerHibernateSpec extends HibernateSpec implements ControllerUnitTest<PersonController> {

void "test action which invokes GORM method"() {

setup:
new Person(firstName: 'Robert', lastName: 'Fripp').save()
new Person(firstName: 'Adrian', lastName: 'Belew').save()
Expand Down
22 changes: 22 additions & 0 deletions apps/demo33/src/test/groovy/demo/TestServiceSpec.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package demo

import grails.testing.services.ServiceUnitTest
import spock.lang.Specification

class TestServiceSpec extends Specification implements ServiceUnitTest<TestService> {

@Override
boolean getLocalOverride() {
return true
}

@Override
Closure doWithConfig() {{ config->
config.demo = ["foo": "test"]
} }

void "when local-override is set then the service picks the update config value"() {
expect:
service.foo == "test"
}
}
Empty file modified gradlew.bat
100644 → 100755
Empty file.
Binary file not shown.

This file was deleted.

1 change: 1 addition & 0 deletions grails-testing-support/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ dependencies {
}
api("org.grails.plugins:async:$asyncVersion") {
exclude module: 'grails-plugin-controllers'
exclude module: 'grails-core'
}
api "org.grails:grails-datastore-gorm:$gormVersion"
api("org.grails:grails-test:$grailsVersion")
Expand Down
Binary file not shown.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ import grails.util.Metadata
import groovy.transform.CompileDynamic
import io.micronaut.context.ApplicationContextConfiguration
import io.micronaut.context.DefaultApplicationContext
import io.micronaut.core.order.Ordered
import io.micronaut.spring.context.factory.MicronautBeanFactoryConfiguration
import org.grails.plugins.IncludingPluginFilter
import org.grails.spring.context.support.GrailsPlaceholderConfigurer
import org.grails.spring.context.support.MapBasedSmartPropertyOverrideConfigurer
import org.grails.transaction.TransactionManagerPostProcessor
import org.springframework.beans.BeansException
import org.springframework.beans.MutablePropertyValues
import org.springframework.beans.factory.config.BeanDefinition
import org.springframework.beans.factory.config.ConfigurableBeanFactory
Expand All @@ -28,6 +30,7 @@ import org.springframework.boot.test.context.ConfigFileApplicationContextInitial
import org.springframework.context.ConfigurableApplicationContext
import org.springframework.context.annotation.AnnotationConfigUtils
import org.springframework.context.support.ConversionServiceFactoryBean
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer
import org.springframework.context.support.StaticMessageSource
import org.springframework.core.convert.ConversionService
import org.springframework.core.env.ConfigurableEnvironment
Expand All @@ -48,6 +51,7 @@ class GrailsApplicationBuilder {
Closure doWithConfig
Set<String> includePlugins
boolean loadExternalBeans
boolean localOverride = false

GrailsApplication grailsApplication
Object servletContext
Expand Down Expand Up @@ -226,6 +230,7 @@ class GrailsApplicationBuilder {
constructorArgumentValues.addIndexedArgumentValue(1, includePlugins ?: DEFAULT_INCLUDED_PLUGINS)

MutablePropertyValues values = new MutablePropertyValues()
values.add('localOverride', localOverride)
values.add('loadExternalBeans', loadExternalBeans)
values.add('customizeGrailsApplicationClosure', customizeGrailsApplicationClosure)

Expand All @@ -237,6 +242,7 @@ class GrailsApplicationBuilder {
static class TestRuntimeGrailsApplicationPostProcessor extends GrailsApplicationPostProcessor {
Closure customizeGrailsApplicationClosure
Set includedPlugins
boolean localOverride = false

TestRuntimeGrailsApplicationPostProcessor(Closure doWithSpringClosure, Set includedPlugins) {
super([doWithSpring: { -> doWithSpringClosure }] as GrailsApplicationLifeCycle, null, null)
Expand All @@ -254,5 +260,13 @@ class GrailsApplicationBuilder {
protected void customizeGrailsApplication(GrailsApplication grailsApplication) {
customizeGrailsApplicationClosure?.call(grailsApplication)
}

@Override
void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException {
super.postProcessBeanDefinitionRegistry(registry)
PropertySourcesPlaceholderConfigurer propertySourcePlaceholderConfigurer = (PropertySourcesPlaceholderConfigurer) grailsApplication.mainContext.getBean('grailsPlaceholderConfigurer')
propertySourcePlaceholderConfigurer.order = Ordered.HIGHEST_PRECEDENCE
propertySourcePlaceholderConfigurer.setLocalOverride(localOverride)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ trait GrailsUnitTest {
private static GrailsApplication _grailsApplication
private static Object _servletContext

boolean getLocalOverride() {
false
}

/**
* @return the servlet context
*/
Expand All @@ -65,7 +69,8 @@ trait GrailsUnitTest {
doWithSpring: doWithSpring(),
doWithConfig: doWithConfig(),
includePlugins: getIncludePlugins(),
loadExternalBeans: loadExternalBeans()
loadExternalBeans: loadExternalBeans(),
localOverride: localOverride
).build()
_grailsApplication = builder.grailsApplication
_servletContext = builder.servletContext
Expand Down
Binary file not shown.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import groovy.transform.CompileStatic
import groovy.transform.TypeCheckingMode
import org.grails.testing.ParameterizedGrailsUnitTest
import org.grails.web.pages.GroovyPagesUriSupport
import org.grails.web.servlet.mvc.GrailsWebRequest
import org.grails.web.util.GrailsApplicationAttributes
import javassist.util.proxy.ProxyFactory
import org.grails.testing.runtime.support.ActionSettingMethodHandler
Expand Down
Binary file added grails-wrapper.jar
Binary file not shown.

0 comments on commit 6a4ebf2

Please sign in to comment.