Hi Myklebust,

You can appear to have your class imported automatically by creating a
project property (e.g. project.ERTSync = ERTSync). It's hacky but will
currently work.

Or perhaps you can even sidestep the issue altogether and define the
tasks for the user? Then the user need only configure them.

Cheers,
Merlyn

On Mon, Oct 3, 2011 at 4:38 AM, Runar Myklebust <[email protected]> wrote:
> Hi.
>
> I have created a custom plugin, with a number of defined tasks. The plugin is 
> packed as a jar, and I apply it to the build.gradle file from where I'd like 
> to use the tasks:
>
> apply plugin: 'ert'
>
> buildscript {
>        repositories {
>        mavenCentral()
>        flatDir(dirs: file('libs'))
>        }
>
>        dependencies {
>                classpath 'com.enonic.ert:ert-gradle-plugin:1.0'
>        }
> }
>
>
> Then, I define the tasks:
>
> task syncLocalhost(type: ERTSync) {
>    source = "local"
>    target = "localhost"
> }
>
> But this will fail with the exception:
>
> Cause: Could not find property 'ERTSync' on root project 'testDist'.
>
> I have to to the explicit import of the groovy tasks in the plugin, e.g:
>
> import com.enonic.ert.tasks.*
>
> Then everything works as expected, but I guess this should not be neccessary 
> - so how shall I avoid this?
>
> --
>
>
> Vennlig hilsen,
> Enonic AS
>
> Runar Myklebust
> Senior Utvikler
>
> Mobil - 977 73 223
>
> www.enonic.com/ex - Enonic Xperience 2011 - register today !
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

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

    http://xircles.codehaus.org/manage_email


Reply via email to