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

create henson plugin #185

Merged

Conversation

stephanenicolas
Copy link
Collaborator

@stephanenicolas stephanenicolas commented Nov 23, 2017

#164 : this is the first PR to create the henson-plugin: it should work. There is a functional test, but really not so precise yet.

The plugin allows to add a new source set that will contain the models for dart&henson 3 navigation.

The navigation source set is located in 'src/navigation/java/'.
Each build type, flavor and variant can use a specific navigation source set. The source set should contain models only and will be processed by the dart & henson APs. It will expose a navigationApi configuration for a module using the plugin. This artifact will be a jar containing intent builders and the henson class, the extra binder, and the model class itself.

The plugin also adds automatically the navigation jar to the dependencies of the main source set.

See https://github.groupondev.com/snicolas/Henson_structure for an example

The plugin also manages the dependencies to dart, using the right annotation processors on the new navigation source set. The only things users have to do are :

  • to use the plugin
  • create the directory folder src/navigation/java (or any variant aware equivalent such as src/navigation/red/java or src/navigation/debug/java or src/navigation/red/debug/java.
  • create a model, annotate it
  • add if needed dependencies to compile their model using configurations such as navigationApi, redNavigationApi, debugNavigationApi, redDebugNavigationApi. All android scopes are supported: Api, Implementation, compileOnly and annotationProcessor.

The plugin is roughly unit tested for now.

@stephanenicolas stephanenicolas added this to the 3.0.0 milestone Nov 23, 2017
…rs, variants + add custom dependencies to each configuration. The navigation api is compiled correctly, jared correctly, it contains the model, the intent builder and henson (for now). The main source set itself dependsn on the api. All artifacts related to dart and henson are handled automatically
@stephanenicolas stephanenicolas force-pushed the sni/create-henson-plugin branch 6 times, most recently from 310df87 to 8123766 Compare November 30, 2017 23:54
@stephanenicolas stephanenicolas changed the title Sni/create henson plugin create henson plugin Dec 1, 2017
Copy link
Collaborator

@dlemures dlemures left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛳 it, not very familiar with groovy though...

…generate a henson navigator class. Some details need to be enhanced like the generated file location, the variant. But it works. Do we need a third source set to generate into ?
…uilders

the principle woks. I can detect the navigation api dependencies and …
Copy link
Collaborator

@kshirsagarps kshirsagarps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that most of the files do not end with a new line. Can you please add a new line.
Everything else looks good.

//it will be used later by the plugin to add the proper version of
//dependencies to the project that uses the plugin
def prop = new Properties()
def propFile = new File("${project.rootDir}/henson-plugin/src/main/resources/build.properties")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the D&H version go here? If so, would be nice to use it for the composite builds needed for D&H sample.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, if there is no better way to do it.


//the main source set
def suffix = ""
def pathSuffix = "main/"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can some of this be constants?

@stephanenicolas stephanenicolas merged commit 35b79cb into f2prateek:master Dec 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants