lukin0110 / poeditor-gradle

Gradle plugin to manage translations with POEditor
https://poeditor.com
Apache License 2.0
26 stars 7 forks source link

languages are generated relative to the execution point #8

Open eyal-rounds opened 9 years ago

eyal-rounds commented 9 years ago

for android project you can access the absolute location using android.srouceSets.main.res.srcDirs[0]. In your plugin if i use this dir (absolute path) extra invalid dirs will be created.

I think it's better to access the project soucrce sets and use that dir' i can give you a "map" of poeditor langs to android langcodes so actually all that needs to be specified is the lang itself that you want to use.

eyal-rounds commented 9 years ago

another nice feature would be after export to run a closure on the file, so if i ned to make search and replace on the file i can, in my current position we do it using python and i wanted to move the use to your plugin.

lukin0110 commented 8 years ago

I agree :). How would your configuration look like if you work with android.sourceSets?

Can you move the second feature to a different ticket so we can discuss it there.

eyal-rounds commented 8 years ago
  1. the code i wrote above should get you the absolute path of the res dir of the project you are in, sourceSets is a map and main is the main sourceset i would not support all sourcesets since it's too complicated. srcDirs is an array but defaults to only one dir, you can always grub the first one for 90% of the projects it will do the trick.

I looked at the java library code and the plugin, strangely enough your code should have worked fine! but apparently if i run your plugin directly from studio's gradle settings it doesn't export anything, if i run from the command line it takes relative path, even though you create a File using the path i provide which should have been absolute! something is very strange here.

Please tell me when you work on the plugin do you join the two projects (java + the plugin) so you wont have to publish to local maven all the time ? if i'll have the time i will work and try to solve this.

also i have no idea how to move the ticket, copy paste ? :-)

10x.