stanfy / spoon-gradle-plugin

Gradle plugin for Spoon.
Apache License 2.0
353 stars 79 forks source link

spoon gradle plugin is not working with Android Studio 2.2 Preview 1 with com.android.tools.build:gradle:2.2.0-alpha1 #107

Closed radzio closed 8 years ago

radzio commented 8 years ago

I'm getting

A dependency must not be empty

error message during project sync.

balysv commented 8 years ago

Usage:

apply plugin: 'spoon'

spoon {
    debug = true
    noAnimations = true
    adbTimeout = 60
}

Example stack trace:

org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':app'.
        at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:79)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:74)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:61)
        at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:510)
        at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:90)
        at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:47)
        at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)
        at org.gradle.initialization.DefaultGradleLauncher$2.run(DefaultGradleLauncher.java:125)
        at org.gradle.internal.Factories$1.create(Factories.java:22)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:122)
        at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99)
        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94)
        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
        at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)
        at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:48)
        at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51)
        at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
        at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
        at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:170)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
        at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
        at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
        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:33)
        at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
        at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
        at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: org.gradle.api.InvalidUserDataException: A dependency must not be empty
        at org.gradle.api.internal.tasks.DefaultTaskDependency.addValue(DefaultTaskDependency.java:122)
        at org.gradle.api.internal.tasks.DefaultTaskDependency.add(DefaultTaskDependency.java:115)
        at org.gradle.api.internal.AbstractTask$11.run(AbstractTask.java:323)
        at org.gradle.api.internal.tasks.TaskMutator.mutate(TaskMutator.java:37)
        at org.gradle.api.internal.AbstractTask.dependsOn(AbstractTask.java:321)
        at com.stanfy.spoon.gradle.SpoonPlugin$_createTask_closure4$_closure13.doCall(SpoonPlugin.groovy:150)
        at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:67)
        at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:130)
        at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:110)
        at org.gradle.api.internal.AbstractTask.configure(AbstractTask.java:488)
        at org.gradle.api.internal.AbstractTask.configure(AbstractTask.java:58)
        at org.gradle.util.Configurable$configure.call(Unknown Source)
        at com.stanfy.spoon.gradle.SpoonPlugin$_createTask_closure4.doCall(SpoonPlugin.groovy:99)
        at com.stanfy.spoon.gradle.SpoonPlugin.createTask(SpoonPlugin.groovy:97)
        at com.stanfy.spoon.gradle.SpoonPlugin$_apply_closure2.doCall(SpoonPlugin.groovy:38)
        at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:67)
        at org.gradle.listener.ActionBroadcast.execute(ActionBroadcast.java:39)
        at org.gradle.api.internal.DefaultDomainObjectCollection.doAdd(DefaultDomainObjectCollection.java:165)
        at org.gradle.api.internal.DefaultDomainObjectCollection.add(DefaultDomainObjectCollection.java:159)
        at com.android.build.gradle.internal.ApiObjectFactory.create(ApiObjectFactory.java:92)
        at com.android.build.gradle.BasePlugin$12.call(BasePlugin.java:691)
        at com.android.build.gradle.BasePlugin$12.call(BasePlugin.java:684)
        at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:55)
        at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:47)
        at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.java:683)
        at com.android.build.gradle.BasePlugin$10$1.call(BasePlugin.java:602)
        at com.android.build.gradle.BasePlugin$10$1.call(BasePlugin.java:599)
        at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:55)
        at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:47)
        at com.android.build.gradle.BasePlugin$10.execute(BasePlugin.java:598)
        at com.android.build.gradle.BasePlugin$10.execute(BasePlugin.java:595)
        at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:93)
        at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:82)
        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:44)
        at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:79)
        at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:30)
        at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
        at com.sun.proxy.$Proxy11.afterEvaluate(Unknown Source)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:67)
        ... 44 more
cooperkong commented 8 years ago

got the same problems, looks like dependsOn is depending some tasks that is not available yet. Maybe the order has changed in 2.2 alpha 1?

dev4mobile commented 8 years ago

I've got this problem

waynemcfadden commented 8 years ago

Also at https://code.google.com/p/android/issues/detail?id=210444&q=spoon&colspec=ID%20Status%20Priority%20Owner%20Summary%20Stars%20Reporter%20Opened

roman-mazur commented 8 years ago

Created a branch with a dependency on 2.2.0-alpha1 to reproduce the issue and updated https://code.google.com/p/android/issues/detail?id=210444

Quite possible we won't need any changes in this plugin.

cooperkong commented 8 years ago

It seems applicationVariants are still returning the correct assemble tasks, but testVariants is getting null assemble tasks

roman-mazur commented 8 years ago

On my test branch, it's throwing at https://github.com/stanfy/spoon-gradle-plugin/blob/roman/test-new-android-plugin/src/main/groovy/com/stanfy/spoon/gradle/SpoonPlugin.groovy#L155

so, the application variant has a null task

Assemble task is not provided for tested variant freeDebug
cooperkong commented 8 years ago

Hey, just submit a #113 . It maybe a temporary workaround to re-assign the assemble task from other variants.

roman-mazur commented 8 years ago

According to the last comments on https://code.google.com/p/android/issues/detail?id=210444 it's an Android plugin bug and it will be fixed with the next release.

Closing this ticket.