Ant to gradle : wlcompile


(Nishant Agarwal) #1

I am trying to convert ant task wlcompile into gradle but getting an error

A problem occurred evaluating project ‘:pabuild’. > Problem: failed to create task or type wlcompile

Cause: The name is undefined.

Action: Check the spelling.

Action: Check that any custom tasks/types have been declared.

Action: Check that any / declarations have taken place.

Ant:

<wlcompile
    srcdir="${src.dir}"
     destdir="${dest.dir}"
                includes="${includes.dir}">
   <javac
     classpathref="build.lib"
    verbose="${javac.verbose}"
     deprecation="${javac.deprecation}"
    source="${javac.target}"
    target="${javac.target}"
     debug="${javac.debug}"
     debuglevel="${javac.debugLevel}"
    failonerror="true" />
   </wlcompile>

Gradle:

ant.wlcompile(
    srcdir:src_dir,
    destdir:dest_dir,
                includes:includes_dir){
    javac(
     classpath: ant.references['build_lib'],
     verbose:javac_verbose ,
     deprecation:javac_deprecation,
     source:javac_target,
     target:javac_target ,
     debug:javac_debug ,
     debuglevel:javac_debugLevel,
     failonerror:'true')
   }

Can you please point out the mistake?


(Nishant Agarwal) #2

Alright, my taskdef declaration was incorrect. Now I have correctly declared taskdef and it detects the command ‘wlcompile’. However, it throws another error.

  • What went wrong: A problem occurred evaluating project ‘:pabuild’. > com.sun.tools.javac.code.Symbol$CompletionFailure: class file for sun.awt.util .IdentityArrayList not found

Stacktrace – * Exception is: org.gradle.api.GradleScriptException: A problem occurred evaluating project ‘:pa build’.

at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptR unnerImpl.run(DefaultScriptRunnerFactory.java:54)

at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl. apply(DefaultScriptPluginFactory.java:127)

at org.gradle.configuration.BuildScriptProcessor.execute(BuildScriptProc essor.java:36)

at org.gradle.configuration.BuildScriptProcessor.execute(BuildScriptProc essor.java:23)

at org.gradle.configuration.ConfigureActionsProjectEvaluator.evaluate(Co nfigureActionsProjectEvaluator.java:34)

at org.gradle.configuration.LifecycleProjectEvaluator.evaluate(Lifecycle ProjectEvaluator.java:55)

at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProj ect.java:465)

at org.gradle.api.internal.project.AbstractProject.evaluationDependsOn(A bstractProject.java:569)

at org.gradle.api.internal.project.AbstractProject.evaluationDependsOn(A bstractProject.java:561)

at build_53o2gt489u7ftbuj7mdtfvfr$_run_closure1.doCall(C:\Gradle_build\P AProjects_01\custom\extension\build.gradle:6)

at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedActi on.java:58)

at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:133)

at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:94)

at org.gradle.api.internal.project.AbstractProject.project(AbstractProje ct.java:849)

at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMeth od(BeanDynamicObject.java:216)

at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObj ect.java:122)

at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(Composite DynamicObject.java:147)

at org.gradle.groovy.scripts.BasicScript.methodMissing(BasicScript.java: 83)

at build_53o2gt489u7ftbuj7mdtfvfr.run(C:\Gradle_build\PAProjects_01\cust om\extension\build.gradle:4)

at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptR unnerImpl.run(DefaultScriptRunnerFactory.java:52)

at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl. apply(DefaultScriptPluginFactory.java:127)

at org.gradle.configuration.BuildScriptProcessor.execute(BuildScriptProc essor.java:36)

at org.gradle.configuration.BuildScriptProcessor.execute(BuildScriptProc essor.java:23)

at org.gradle.configuration.ConfigureActionsProjectEvaluator.evaluate(Co nfigureActionsProjectEvaluator.java:34)

at org.gradle.configuration.LifecycleProjectEvaluator.evaluate(Lifecycle ProjectEvaluator.java:55)

at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProj ect.java:465)

at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProj ect.java:76)

at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuil dConfigurer.java:31)

at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(Default GradleLauncher.java:142)

at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradle Launcher.java:113)

at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLaun cher.java:81)

at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildCon troller.run(InProcessBuildActionExecuter.java:64)

at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.jav a:33)

at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.jav a:24)

at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce ssBuildActionExecuter.java:35)

at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce ssBuildActionExecuter.java:26)

at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)

at org.gradle.api.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(ExceptionRep ortingAction.java:33)

at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionRep ortingAction.java:22)

at org.gradle.launcher.Main.doAction(Main.java:48)

at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)

at org.gradle.launcher.Main.main(Main.java:39)

at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBoots trap.java:50)

at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.j ava:32)

at org.gradle.launcher.GradleMain.main(GradleMain.java:26) Caused by: : com.sun.tools.javac.code.Symbol$CompletionFailure: class file for s un.awt.util.IdentityArrayList not found

at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav a:116)

at org.gradle.api.internal.project.ant.BasicAntBuilder.nodeCompleted(Bas icAntBuilder.java:71)

at org.gradle.api.internal.project.ant.BasicAntBuilder.doInvokeMethod(Ba sicAntBuilder.java:86)

at org.gradle.api.internal.project.DefaultAntBuilder.super$3$invokeMetho d(DefaultAntBuilder.groovy)

at org.gradle.api.internal.project.DefaultAntBuilder.invokeMethod(Defaul tAntBuilder.groovy:37)

at build_3lv9savp5bv037m8kh5ith47kn$_run_closure1_closure17.doCall(C:\Gr adle_build\PAProjects_01\custom\pabuild\build.gradle:138)

at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedActi on.java:58)

at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:133)

at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:113)

at org.gradle.api.internal.AbstractTask.configure(AbstractTask.java:432)

at org.gradle.api.internal.project.AbstractProject.task(AbstractProject. java:892)

at build_3lv9savp5bv037m8kh5ith47kn$_run_closure1.doCall(C:\Gradle_build \PAProjects_01\custom\pabuild\build.gradle:133)

at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedActi on.java:58)

at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:133)

at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:94)

at org.gradle.api.internal.project.AbstractProject.project(AbstractProje ct.java:849)

at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMeth od(BeanDynamicObject.java:216)

at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObj ect.java:122)

at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(Composite DynamicObject.java:147)

at org.gradle.groovy.scripts.BasicScript.methodMissing(BasicScript.java: 83)

at build_3lv9savp5bv037m8kh5ith47kn.run(C:\Gradle_build\PAProjects_01\cu stom\pabuild\build.gradle:9)

at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptR unnerImpl.run(DefaultScriptRunnerFactory.java:52)

at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl. apply(DefaultScriptPluginFactory.java:128)

at org.gradle.configuration.BuildScriptProcessor.execute(BuildScriptProc essor.java:36)

at org.gradle.configuration.BuildScriptProcessor.execute(BuildScriptProc essor.java:23)

at org.gradle.configuration.ConfigureActionsProjectEvaluator.evaluate(Co nfigureActionsProjectEvaluator.java:34)

at org.gradle.configuration.LifecycleProjectEvaluator.evaluate(Lifecycle ProjectEvaluator.java:55)

at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProj ect.java:466)

at org.gradle.api.internal.project.AbstractProject.evaluationDependsOn(A bstractProject.java:569)

at org.gradle.api.internal.project.AbstractProject.evaluationDependsOn(A bstractProject.java:561)

at build_53o2gt489u7ftbuj7mdtfvfr$_run_closure1.doCall(C:\Gradle_build\P AProjects_01\custom\extension\build.gradle:9)

at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedActi on.java:58)

at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:133)

at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:94)

at org.gradle.api.internal.project.AbstractProject.project(AbstractProje ct.java:849)

at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMeth od(BeanDynamicObject.java:216)

at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObj ect.java:122)

at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(Composite DynamicObject.java:147)

at org.gradle.groovy.scripts.BasicScript.methodMissing(BasicScript.java: 83)

at build_53o2gt489u7ftbuj7mdtfvfr.run(C:\Gradle_build\PAProjects_01\cust om\extension\build.gradle:4)

at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptR unnerImpl.run(DefaultScriptRunnerFactory.java:52)

at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl. apply(DefaultScriptPluginFactory.java:128)

at org.gradle.configuration.BuildScriptProcessor.execute(BuildScriptProc essor.java:36)

at org.gradle.configuration.BuildScriptProcessor.execute(BuildScriptProc essor.java:23)

at org.gradle.configuration.ConfigureActionsProjectEvaluator.evaluate(Co nfigureActionsProjectEvaluator.java:34)

at org.gradle.configuration.LifecycleProjectEvaluator.evaluate(Lifecycle ProjectEvaluator.java:55)

at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProj ect.java:466)

at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProj ect.java:76)

at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuil dConfigurer.java:31)

at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(Default GradleLauncher.java:144)

at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradle Launcher.java:113)

at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLaun cher.java:81)

at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildCon troller.run(InProcessBuildActionExecuter.java:64)

at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.jav a:34)

at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.jav a:24)

at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce ssBuildActionExecuter.java:35)

at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce ssBuildActionExecuter.java:26)

at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:53)

at org.gradle.api.internal.Actions$RunnableActionAdapter.execute(Actions .java:172)

at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction. execute(CommandLineActionFactory.java:202)

at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction. execute(CommandLineActionFactory.java:174)

at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute( CommandLineActionFactory.java:171)

at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute( CommandLineActionFactory.java:139)

at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionRep ortingAction.java:33)

at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionRep ortingAction.java:22)

at org.gradle.launcher.Main.doAction(Main.java:49)

at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)

at org.gradle.launcher.Main.main(Main.java:40)

at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBoots trap.java:51)

at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.j ava:33)

at org.gradle.launcher.GradleMain.main(GradleMain.java:27) Caused by: com.sun.tools.javac.code.Symbol$CompletionFailure: class file for sun .awt.util.IdentityArrayList not found

Any suggestions, please.

I a trying to solve this since 2 days. Any help would be appreciated.

Thanks.