Griffon
  1. Griffon
  2. GRIFFON-297

Dependency problem with a plugin including an addon if it is named camelcased (or contains hyphen ?)

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.2-beta-3
    • Fix Version/s: 0.9.2-beta-3
    • Component/s: rt
    • Labels:
      None
    • Environment:
      all
    • Number of attachments :
      0

      Description

      If you do the following:

      griffon create-plugin myPlugin
      cd myPlugin
      griffon create-addon myPlugin
      griffon package-plugin
      

      And now you install the zip into an App,
      The MyPluginGriffonAddon class could not be found in the classpath.

      Doing the same with myplugin instead of myPlugin works fine.

      I suspect it has something to do with the dependencyManager DSL.

        Activity

        Hide
        Andres Almiray added a comment -

        There's a problem indeed, though I believe it's caused by evaluating the name using the wrong convention.
        Creating a plugin/addon with a hyphenated name does work, as well as a plugin without camel case (2 out 3 scenarios).
        Let's schedule the fix for the next release.

        Show
        Andres Almiray added a comment - There's a problem indeed, though I believe it's caused by evaluating the name using the wrong convention. Creating a plugin/addon with a hyphenated name does work, as well as a plugin without camel case (2 out 3 scenarios). Let's schedule the fix for the next release.
        Hide
        Alexander Klein added a comment -

        Hmmm,

        after I wanted to circumvent the problem and created a new plugin/addon with another name
        the _Events.groovy looks different.
        old plugin resourceManager:

        def eventClosure1 = binding.variables.containsKey('eventSetClasspath') ? eventSetClasspath : {cl->}
        eventSetClasspath = { cl ->
            eventClosure1(cl)
            if(compilingPlugin('resource-manager')) return
            griffonSettings.dependencyManager.flatDirResolver name: 'griffon-resource-manager-plugin', dirs: "${resource-managerPluginDir}/addon"
            griffonSettings.dependencyManager.addPluginDependency('resource-manager', [
                conf: 'compile',
                name: 'griffon-resource-manager-addon',
                group: 'org.codehaus.griffon.plugins',
                version: resource-managerPluginVersion
            ])
        }
        

        new plugin resources:

        def eventClosure1 = binding.variables.containsKey('eventCopyLibsEnd') ? eventCopyLibsEnd : {jardir->}
        eventCopyLibsEnd = { jardir ->
            eventClosure1(jardir)
            if (!isPluginProject) {
                def pluginDir = getPluginDirForName('resources')
                if(pluginDir?.file?.exists()) {
                    ant.fileset(dir: "${pluginDir.file}/lib/", includes: '*.jar').each {
                        griffonCopyDist(it.toString(), jardir)
                    }
                }
            }
        }
        

        I did a git pull in the meantime.

        Just to note ...

        Show
        Alexander Klein added a comment - Hmmm, after I wanted to circumvent the problem and created a new plugin/addon with another name the _Events.groovy looks different. old plugin resourceManager: def eventClosure1 = binding.variables.containsKey('eventSetClasspath') ? eventSetClasspath : {cl->} eventSetClasspath = { cl -> eventClosure1(cl) if (compilingPlugin('resource-manager')) return griffonSettings.dependencyManager.flatDirResolver name: 'griffon-resource-manager-plugin', dirs: "${resource-managerPluginDir}/addon" griffonSettings.dependencyManager.addPluginDependency('resource-manager', [ conf: 'compile', name: 'griffon-resource-manager-addon', group: 'org.codehaus.griffon.plugins', version: resource-managerPluginVersion ]) } new plugin resources: def eventClosure1 = binding.variables.containsKey('eventCopyLibsEnd') ? eventCopyLibsEnd : {jardir->} eventCopyLibsEnd = { jardir -> eventClosure1(jardir) if (!isPluginProject) { def pluginDir = getPluginDirForName('resources') if (pluginDir?.file?.exists()) { ant.fileset(dir: "${pluginDir.file}/lib/" , includes: '*.jar').each { griffonCopyDist(it.toString(), jardir) } } } } I did a git pull in the meantime. Just to note ...
        Hide
        Andres Almiray added a comment -

        Actually the 'old' is from GRIFFON_0.9.X (hence the latest) while the 'new' is the real old one from master

        Show
        Andres Almiray added a comment - Actually the 'old' is from GRIFFON_0.9.X (hence the latest) while the 'new' is the real old one from master

          People

          • Assignee:
            Andres Almiray
            Reporter:
            Alexander Klein
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: