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

Update plugin to grails 3.3.0 #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
grailsVersion=3.2.3
grailsVersion=3.3.0
gradleWrapperVersion=3.0
8 changes: 4 additions & 4 deletions grails-app/controllers/umlclassdiagram/UmlController.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ package umlclassdiagram
import grails.validation.Validateable
import groovy.util.logging.Slf4j

@Slf4j
class UmlController {

grails.core.GrailsApplication grailsApplication

def umlService

def index() {

def instance = new ConfigurationCommand()
bindData(instance, params)
render(view: 'index', model: [configurationCommandInstance: instance, pluginVersion: pluginVersion])
Expand Down Expand Up @@ -63,11 +63,11 @@ class UmlController {
/**
* Mitigation for issue #7, and GRAILS-5582
* @see https://github.com/igorrosenberg/grails-plugin-uml-class-diagram/issues/7
* @see https://jira.grails.org/browse/GRAILS-5582, fixed in grails 2.3
* @see https://jira.grails.org/browse/GRAILS-5582, fixed in grails 2.3
*/
private void extraBindData(configurationCommandInstance, params) {
private void extraBindData(configurationCommandInstance, params) {
def oldVersion = grailsApplication.metadata['app.grails.version']
if (!oldVersion)
if (!oldVersion)
return
def version = oldVersion.split('\\.')
if (version[0].toInteger() < 2 || (version[0].toInteger() == 2 && version[1].toInteger() < 3))
Expand Down
3 changes: 3 additions & 0 deletions grails-app/services/umlclassdiagram/PlantUmlService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ package umlclassdiagram
import net.sourceforge.plantuml.*
import com.nafiux.grails.classdomainuml.*
import org.grails.core.DefaultGrailsDomainClass
import groovy.util.logging.Slf4j

/**
* Generate diagrams from a Model.
*/

@Slf4j
class PlantUmlService {

/*
Expand Down
7 changes: 5 additions & 2 deletions grails-app/services/umlclassdiagram/UmlService.groovy
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
package umlclassdiagram

import groovy.util.logging.Slf4j

/**
* Generate UML diagrams (as images) from application structure.
*/

@Slf4j
class UmlService {

def modelGeneratorService
Expand All @@ -29,5 +33,4 @@ class UmlService {
def model = modelGeneratorService.makeModel(configurationCommand.diagramType)
plantUmlService.modelToScript(model, configurationCommand)
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ import static umlclassdiagram.Constants.*

import com.nafiux.grails.classdomainuml.*
import org.grails.core.DefaultGrailsDomainClass
import groovy.util.logging.Slf4j

/**
* Generate UML diagrams from grails domains.
*/

@Slf4j
class DomainModelGeneratorService extends GrailsArtefactGeneratorService {

def grailsApplication
Expand All @@ -30,7 +33,8 @@ class DomainModelGeneratorService extends GrailsArtefactGeneratorService {
def c = grailsApplication.classLoader.loadClass("${model.fullName}")
log.debug "Introspect artefact data for ${model.fullName}"
// FIXME really need an object ? already got a class...
def instance = new DefaultGrailsDomainClass(c)
def instance = new DefaultGrailsDomainClass(c, grailsApplication.mappingContext)
instance.setGrailsApplication(grailsApplication)
[
packageName : model.packageName,
className : model.name,
Expand All @@ -47,7 +51,7 @@ class DomainModelGeneratorService extends GrailsArtefactGeneratorService {
properties.collect {
def name = it.getName()
def type = it.getType().name
def ref = it.getReferencedPropertyType().name
def ref = it.getReferencedPropertyType()?.name
if (ref == type) {
ref = null
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package umlclassdiagram.generator

import static umlclassdiagram.Constants.*
import groovy.util.logging.Slf4j

@Slf4j
class LayersModelGeneratorService extends GrailsArtefactGeneratorService {

def grailsApplication
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import grails.plugins.*
class UmlClassDiagramGrailsPlugin extends Plugin {

// the version or versions of Grails the plugin is designed for
def grailsVersion = "3.2.3 > *"
def grailsVersion = "3.3.0 > *"
// resources that are excluded from plugin packaging
def pluginExcludes = [
"grails-app/views/error.gsp"
]

def profiles = ['web']

def title = "Uml Class Diagram" // Headline display name of the plugin
def author = "Igor Rosenberg"
def description = 'Generate UML class diagrams from your Grails app source code.'
Expand Down