f2prateek/dart

Annotation processor option for generation Henson

Closed this issue · 8 comments

In README.md it is said that:
"The Henson annotation processor will generate the Henson navigator class (used above) in a package that is :
either the package specified by the dart.henson.package annotation processor option"

Would you be so kind to show some example for two activities in different packages? ?

You can add this into you build.gradle

apt {
    arguments {
        "dart.henson.package" "your.package.name"
    }
}

This will generate Henson class inside the specified package.

Thx @aardouin . Does it answer your question @ExtroNovosib ?

I agree that it would be nice to have an example somewhere though. Ideally dart and henson would be switched to gradle, and the sample would also show how to use annotation processor options properly...

We would love a PR doing just that... ;)

Thx @aardouin.
@stephanenicolas, yes, it the answer, thanks.

apt {
   arguments {
       "dart.henson.package" "your.package.name"
   }
}

Do you happen to know how to apply this configuration when using an annotationProcessor instead of apt?

http://tools.android.com/tech-docs/jackandjill

android {
...
    defaultConfig {
    ...
        javaCompileOptions { 
            annotationProcessorOptions {
                className 'com.example.MyProcessor'

		// Arguments are optional.
                arguments = [ foo : 'bar' ]
            }
        }
    }
    ...
}

@stephanenicolas thanks, that helped. I wasn't aware this feature was described in jack docs (I do not use jack currently).

You should probably add this option in README.md for those others wondering while using built-in annotation processor.

defaultConfig {
    javaCompileOptions {
        annotationProcessorOptions {
            arguments = [ 'dart.henson.package' : 'your.package.name' ]
        }
    }
}

We are updating the readme.