johnuopini / gradle-getlocalization-plugin

A Gradle plugin for managing translations through GetLocalization.
MIT License
6 stars 2 forks source link

NoSuchFileException multiple files #1

Closed RSenApps closed 10 years ago

RSenApps commented 10 years ago

This plugin seems awesome! Unfortunately I am having an issue and the plugin throws an exception. Please let me know what I can do to help... I think it may be caused by my getlocalization project having multiple files?

> java.nio.file.NoSuchFileException: C:\Users\Ryan\AppData\Local\Temp\getlocalization.2965610262660507664.xml -> C:\Users\Ryan\Dev\Andro
idStudioProjects\commandr-for-google-now\CommandrForGoogleNow\res\values-it\it\strings.xml

* Try:         
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':downloadTranslations'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:289)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
        at org.gradle.execution.taskgraph.ParallelTaskPlanExecutor.process(ParallelTaskPlanExecutor.java:51)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:86)
        at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
        at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
        at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
        at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:166)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64)
        at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
        at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
        at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
        at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
        at org.gradle.launcher.Main.doAction(Main.java:46)
        at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
        at org.gradle.launcher.Main.main(Main.java:37)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
        at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
        at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:33)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: org.gradle.internal.UncheckedException: java.nio.file.NoSuchFileException: C:\Users\Ryan\AppData\Local\Temp\getlocalization.2
965610262660507664.xml -> C:\Users\Ryan\Dev\AndroidStudioProjects\commandr-for-google-now\CommandrForGoogleNow\res\values-it\it\strings.
xml
        at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:39)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:66)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessing
TaskFactory.java:219)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTa
skFactory.java:212)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTa
skFactory.java:201)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:533)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:516)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
        ... 46 more
Caused by: java.nio.file.NoSuchFileException: C:\Users\Ryan\AppData\Local\Temp\getlocalization.2965610262660507664.xml -> C:\Users\Ryan\
Dev\AndroidStudioProjects\commandr-for-google-now\CommandrForGoogleNow\res\values-it\it\strings.xml
        at org.zooper.gradle.GetLocalizationDownloadTask$_downloadTranslation_closure3.doCall(GetLocalizationDownloadTask.groovy:75)
        at org.zooper.gradle.GetLocalizationDownloadTask.downloadTranslation(GetLocalizationDownloadTask.groovy:64)
        at org.zooper.gradle.GetLocalizationDownloadTask$_dowloadTranslations_closure1.doCall(GetLocalizationDownloadTask.groovy:25)
        at org.zooper.gradle.GetLocalizationDownloadTask.dowloadTranslations(GetLocalizationDownloadTask.groovy:23)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
        ... 53 more

BUILD FAILED   
johnuopini commented 10 years ago

For some reason the plugin is trying to store the file in "values-it\it\" instead of just "values-it\", it might be related to the fact that you are using a Windows ENV, i will check, thanks for reporting!

RSenApps commented 10 years ago

Thanks! I think it also has to do with there being multiple files on get localization where all files are put in a folder so you have to remove this structure instead of just copying...

flabbamann commented 10 years ago

I got the same Problem with the duplicate language code. I'm on Windows too. I tried to manually map the IANA codes, but it didn't help. I have only one strings.xml resource file.

Okay, I think I found it:

I think it should work if you use t.master_file in line 74: File targetFile = new File(targetDir, t.filename)

because filename also stores the iana_code: [{"progress": 100.0, "iana_code": "de", "filename": "de/strings.xml", "master_file": "strings.xml", "format": "Android"}]

davidvavra commented 10 years ago

Wow this plugin is just what I need!

I'm having the same problem, also on Windows. Any updates?

johnuopini commented 10 years ago

Fixed in 1.1, uploaded to maven now