Skip to content

Commit

Permalink
added a new MicronautGrailsApp, ensure only one MicronautContext is c…
Browse files Browse the repository at this point in the history
…reated per application
  • Loading branch information
musketyr committed Nov 24, 2020
1 parent 25c0781 commit bd3c2c1
Show file tree
Hide file tree
Showing 93 changed files with 26,471 additions and 14 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ subprojects { Project subproject ->
dependencyManagement {
imports {
mavenBom "io.micronaut:micronaut-bom:$micronautVersion"
mavenBom "org.grails:grails-bom:${grailsVersion}"
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Vladimir Orany.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.agorapulse.micronaut.grails.domain

import grails.compiler.GrailsCompileStatic
import grails.gorm.annotation.Entity

/**
* Test entity.
*/
@Entity
@GrailsCompileStatic
@SuppressWarnings([
'GrailsDomainHasEquals',
'GrailsDomainHasToString',
'FieldTypeRequired',
])
class Manager {

static constraints = {
name maxSize: 255
}

String name

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Vladimir Orany.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
apply plugin:"groovy"

sourceSets {
main {
groovy {
srcDir 'grails-app/domain'
}
}
}

dependencies {
compile 'org.grails:grails-datastore-gorm-hibernate5'

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

compile 'io.micronaut.configuration:micronaut-hibernate-gorm'

compileOnly "org.grails:grails-core:$grailsVersion"

compile "org.grails:grails-bootstrap:$grailsVersion"

annotationProcessor "io.micronaut:micronaut-inject-java"
compile "io.micronaut:micronaut-runtime-groovy"
compile "io.micronaut:micronaut-validation"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020 Vladimir Orany.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.agorapulse.micronaut.grails.domain

import grails.gorm.services.Service
import groovy.transform.CompileStatic

/**
* Test data service.
*/
@CompileStatic
@Service(Manager)
abstract class ManagerService {

abstract Manager get(Long id)
abstract List<Manager> findAllByName(String name)

}
5 changes: 5 additions & 0 deletions examples/micronaut-grails-example/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
grailsVersion=4.0.4
gorm.version=7.0.6.RELEASE
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx1024M
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit bd3c2c1

Please sign in to comment.