Quantcast

Best way to get the install directory for a plugin

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Best way to get the install directory for a plugin

Dan Durkin
Is there a way to get the install directory for a plugin during it's
initialization?

Say in the doWithSpring closure

I was looking for something like getPluginDir()  that's on
DefaultGrailsPlugin but this doesn't seem to be initialized at this
point.

Thanks for any pointers

--
Dan Durkin
Principal Software Engineer
Chemical Biology Informatics Platform
Broad Institute of Harvard &  MIT

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Best way to get the install directory for a plugin

Dan Durkin
In case it helps anyone else, I ended up using the GrailsPluginUtils class

Wanted to have the changelogs for the database-migration plugin
associated with a domain model plugin, not in the top level app
including the plugin.

def doWithSpring = {
    File someDomainModelPluginDir =
GrailsPluginUtils.getPluginDirForName('some-domain-model').getFile()
    String changelogLocationPath = new File(bardDomainModelPluginDir,
MigrationUtils.changelogLocation).path
    migrationResourceAccessor(FileSystemResourceAccessor, changelogLocationPath)
}

If there's an easier or better way let me know.

Dan

On Fri, Jun 22, 2012 at 10:39 AM, Dan Durkin <[hidden email]> wrote:

> Is there a way to get the install directory for a plugin during it's
> initialization?
>
> Say in the doWithSpring closure
>
> I was looking for something like getPluginDir()  that's on
> DefaultGrailsPlugin but this doesn't seem to be initialized at this
> point.
>
> Thanks for any pointers
>
> --
> Dan Durkin
> Principal Software Engineer
> Chemical Biology Informatics Platform
> Broad Institute of Harvard &  MIT



--
Dan Durkin
Principal Software Engineer
Chemical Biology Informatics Platform
Broad Institute of Harvard &  MIT

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Loading...