GradleUp/auto-manifest

Add alternative option for modules with dash character in their name

mateuszkwiecinski opened this issue ยท 4 comments

Would you consider adding thrid option to transform modules with dashes - to simply join parts of the module name?

Current behavior is: For module named: fixture-module-name replaceDashesWithDot=true will generate com.example.package.fixture.module.name. replaceDashesWithDot=false would use underscores: com.example.package.fixture_module_name.

To make the migration for my $workProject smoother I'd want to have com.example.package.fixturemodulename. Unless my expectations are somewhere utterly wrong and the two ways plugin currently exposes are the only feasible alternative ๐Ÿค”

I should be able to help with the implementation, but I don't have any idea for the API. Normally I'd use an enum, but with Gradle DSL it wouldn't be the most convenient way of doing so. I saw plugins exposing "factory methods", I saw plugins with strings, I saw plugins with multiple boolean properties (๐Ÿ˜… )

Actually, it seems like the workaround is to apply the plugin to each project with applyRecursively=false, and set custom packageName generated from project.path. I'll test it later and will close the issue if it works :)

Hi, thanks for reaching out. Applying separately works fine but if you have too many, it might make sense to support this idea.

Enums in configurations are kind of messy. They work better with Groovy actually. With Kotlin, it can be weird. I'm also not sure what is the best one. If you would like to contribute, I would love to review a PR.

And yes, an enum would be much better than having a boolean anyways.

Setting exact packageName with applyRecursively=false works like a charm, so I'll close the issue for now :)

I expect that for most projects, existing config options are flexible enough hence I don't think it makes sense to make the config unnecessarily complex.
Thank's again for the plugin and your assistance ๐Ÿ™

Thanks a lot for the feedbacks. I agree about the complexity of configuration.