Created
April 27, 2019 15:40
-
-
Save marchermans/d468fc30bfaea6f94736017f742367ce to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[15:08:45] : [Step 2/3] Starting: bash /opt/gradle/gradle-4.9/bin/gradle --init-script /opt/buildagent/plugins/gradle-runner/scripts/init.gradle -Pgradle.cache.push=true -Dorg.gradle.daemon=false -b build.gradle clean setupCiWorkspace --parallel --stacktrace | |
[15:08:45] : [Step 2/3] in directory: /opt/buildagent/work/e51ff2e42229af98 | |
[15:08:45]W: [Step 2/3] Picked up JAVA_TOOL_OPTIONS: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap | |
[15:08:49] : [Step 2/3] Pushing to build cache: true | |
[15:08:49] : [Step 2/3] Parallel execution is an incubating feature. | |
[15:08:51] : [Step 2/3] | |
[15:08:51] : [Step 2/3] > Configure project : | |
[15:08:51] : [Step 2/3] Starting Gradle in TeamCity build 1.0.11-ALPHA | |
[15:08:53] : [Step 2/3] | |
[15:08:53] : [Step 2/3] > Configure project :launcher:forge:1.12 | |
[15:08:53] : [Step 2/3] This mapping 'snapshot_20171003' was designed for MC 1.12! Use at your own peril. | |
[15:08:53] : [Step 2/3] ################################################# | |
[15:08:53] : [Step 2/3] ForgeGradle 2.3-SNAPSHOT-7764e3e | |
[15:08:53] : [Step 2/3] https://github.com/MinecraftForge/ForgeGradle | |
[15:08:53] : [Step 2/3] ################################################# | |
[15:08:53] : [Step 2/3] Powered by MCP | |
[15:08:53] : [Step 2/3] http://modcoderpack.com | |
[15:08:53] : [Step 2/3] by: Searge, ProfMobius, R4wk, ZeuX | |
[15:08:53] : [Step 2/3] Fesh0r, IngisKahn, bspkrs, LexManos | |
[15:08:53] : [Step 2/3] ################################################# | |
[15:08:53] : [Step 2/3] Found AccessTransformer: jvoxelizer_at.cfg | |
[15:08:55] : [Step 2/3] | |
[15:08:55]W: [Step 2/3] | |
[15:08:55] : [Step 2/3] > Configure project :launcher:forge:1.13 | |
[15:08:55] : [Step 2/3] New Dep: net.minecraftforge:forge:1.13.2-25.0.141_mapped_snapshot_20180921-1.13_at_b1f0361e95144c0d8730de5c400f414ac7110c35 | |
[15:08:55]W: [Step 2/3] FAILURE: Build failed with an exception. | |
[15:08:55]W: [Step 2/3] | |
[15:08:55]W: [Step 2/3] * Where: | |
[15:08:55]W: [Step 2/3] Initialization script '/opt/buildagent/plugins/gradle-runner/scripts/init.gradle' line: 159 | |
[15:08:55]W: [Step 2/3] | |
[15:08:55]W: [Step 2/3] * What went wrong: | |
[15:08:55]W: [Step 2/3] A problem occurred configuring project ':launcher:forge:1.13'. | |
[15:08:55]W: [Step 2/3] > Failed to notify project evaluation listener. | |
[15:08:55]W: [Step 2/3] > Could not create task 'extractSrg' (ExtractMCPData) | |
[15:08:55]W: [Step 2/3] > Could not create task 'createMcpToSrg' (GenerateSRG) | |
[15:08:55]W: [Step 2/3] | |
[15:08:55]W: [Step 2/3] * Try: | |
[15:08:55]W: [Step 2/3] Run with --info or --debug option to get more log output. Run with --scan to get full insights. | |
[15:08:55]W: [Step 2/3] | |
[15:08:55]W: [Step 2/3] * Exception is: | |
[15:08:55]W: [Step 2/3] org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':launcher:forge:1.13'. | |
[15:08:55]W: [Step 2/3] at org.gradle.configuration.project.LifecycleProjectEvaluator.wrapException(LifecycleProjectEvaluator.java:79) | |
[15:08:55]W: [Step 2/3] at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:73) | |
[15:08:55]W: [Step 2/3] at org.gradle.configuration.project.LifecycleProjectEvaluator.access$400(LifecycleProjectEvaluator.java:54) | |
[15:08:55]W: [Step 2/3] at org.gradle.configuration.project.LifecycleProjectEvaluator$NotifyAfterEvaluate.run(LifecycleProjectEvaluator.java:200) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) | |
[15:08:55]W: [Step 2/3] at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.run(LifecycleProjectEvaluator.java:110) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) | |
[15:08:55]W: [Step 2/3] at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:68) | |
[15:08:55]W: [Step 2/3] at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:682) | |
[15:08:55]W: [Step 2/3] at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:138) | |
[15:08:55]W: [Step 2/3] at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:35) | |
[15:08:55]W: [Step 2/3] at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:62) | |
[15:08:55]W: [Step 2/3] at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:41) | |
[15:08:55]W: [Step 2/3] at org.gradle.initialization.DefaultGradleLauncher$ConfigureBuild.run(DefaultGradleLauncher.java:266) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) | |
[15:08:55]W: [Step 2/3] at org.gradle.initialization.DefaultGradleLauncher.configureBuild(DefaultGradleLauncher.java:179) | |
[15:08:55]W: [Step 2/3] at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:138) | |
[15:08:55]W: [Step 2/3] at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:121) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:77) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:74) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:152) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:38) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:96) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:74) | |
[15:08:55]W: [Step 2/3] at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28) | |
[15:08:55]W: [Step 2/3] at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) | |
[15:08:55]W: [Step 2/3] at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32) | |
[15:08:55]W: [Step 2/3] at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.run(RunAsBuildOperationBuildActionRunner.java:47) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) | |
[15:08:55]W: [Step 2/3] at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:43) | |
[15:08:55]W: [Step 2/3] at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51) | |
[15:08:55]W: [Step 2/3] at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:50) | |
[15:08:55]W: [Step 2/3] at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:46) | |
[15:08:55]W: [Step 2/3] at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:74) | |
[15:08:55]W: [Step 2/3] at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:46) | |
[15:08:55]W: [Step 2/3] at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:32) | |
[15:08:55]W: [Step 2/3] at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39) | |
[15:08:55]W: [Step 2/3] at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25) | |
[15:08:55]W: [Step 2/3] at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:80) | |
[15:08:55]W: [Step 2/3] at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:53) | |
[15:08:55]W: [Step 2/3] at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:62) | |
[15:08:55]W: [Step 2/3] at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:34) | |
[15:08:55]W: [Step 2/3] at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36) | |
[15:08:55]W: [Step 2/3] at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25) | |
[15:08:55]W: [Step 2/3] at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43) | |
[15:08:55]W: [Step 2/3] at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29) | |
[15:08:55] : [Step 2/3] | |
[15:08:55]W: [Step 2/3] at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:59) | |
[15:08:55] : [Step 2/3] Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0. | |
[15:08:55]W: [Step 2/3] at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:31) | |
[15:08:55] : [Step 2/3] Use '--warning-mode all' to show the individual deprecation warnings. | |
[15:08:55]W: [Step 2/3] at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:59) | |
[15:08:55] : [Step 2/3] See https://docs.gradle.org/4.9/userguide/command_line_interface.html#sec:command_line_warnings | |
[15:08:55]W: [Step 2/3] at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:44) | |
[15:08:55]W: [Step 2/3] at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:46) | |
[15:08:55]W: [Step 2/3] at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30) | |
[15:08:55]E: [Step 2/3] java.lang.NullPointerException: null | |
[15:08:55]i: [Step 2/3] ##teamcity[buildProblem identity='956768178' description='java.lang.NullPointerException: null' type='gradleBuildProblem'] | |
[15:08:55]W: [Step 2/3] at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:52) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:207) | |
[15:08:55]W: [Step 2/3] at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:402) | |
[15:08:55]W: [Step 2/3] at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:375) | |
[15:08:55]W: [Step 2/3] at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:37) | |
[15:08:55]W: [Step 2/3] at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:23) | |
[15:08:55]W: [Step 2/3] at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:368) | |
[15:08:55]W: [Step 2/3] at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:298) | |
[15:08:55]W: [Step 2/3] at org.gradle.launcher.Main.doAction(Main.java:36) | |
[15:08:55]W: [Step 2/3] at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45) | |
[15:08:55]W: [Step 2/3] at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:60) | |
[15:08:55]W: [Step 2/3] at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37) | |
[15:08:55]W: [Step 2/3] at org.gradle.launcher.GradleMain.main(GradleMain.java:23) | |
[15:08:55]W: [Step 2/3] Caused by: org.gradle.internal.event.ListenerNotificationException: Failed to notify project evaluation listener. | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:86) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:324) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:234) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:140) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93) | |
[15:08:55]W: [Step 2/3] at com.sun.proxy.$Proxy33.afterEvaluate(Unknown Source) | |
[15:08:55]W: [Step 2/3] at org.gradle.configuration.project.LifecycleProjectEvaluator$NotifyAfterEvaluate$1.execute(LifecycleProjectEvaluator.java:187) | |
[15:08:55]W: [Step 2/3] at org.gradle.configuration.project.LifecycleProjectEvaluator$NotifyAfterEvaluate$1.execute(LifecycleProjectEvaluator.java:184) | |
[15:08:55]W: [Step 2/3] at org.gradle.api.internal.project.DefaultProject.stepEvaluationListener(DefaultProject.java:1398) | |
[15:08:55]W: [Step 2/3] at org.gradle.configuration.project.LifecycleProjectEvaluator$NotifyAfterEvaluate.run(LifecycleProjectEvaluator.java:193) | |
[15:08:55]W: [Step 2/3] ... 77 more | |
[15:08:55]W: [Step 2/3] Caused by: java.lang.IllegalStateException: Could not create task 'extractSrg' (ExtractMCPData) | |
[15:08:55]W: [Step 2/3] at org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreatingProvider.createIllegalStateException(DefaultTaskContainer.java:640) | |
[15:08:55]W: [Step 2/3] at org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreatingProvider.access$2400(DefaultTaskContainer.java:568) | |
[15:08:55]W: [Step 2/3] at org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreatingProvider$1.run(DefaultTaskContainer.java:621) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) | |
[15:08:55]W: [Step 2/3] at org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreatingProvider.getOrNull(DefaultTaskContainer.java:603) | |
[15:08:55]W: [Step 2/3] at org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreatingProvider.getOrNull(DefaultTaskContainer.java:568) | |
[15:08:55]W: [Step 2/3] at org.gradle.api.internal.provider.AbstractProvider.get(AbstractProvider.java:28) | |
[15:08:55]W: [Step 2/3] at org.gradle.api.internal.DefaultDomainObjectCollection$1.execute(DefaultDomainObjectCollection.java:60) | |
[15:08:55]W: [Step 2/3] at org.gradle.api.internal.DefaultDomainObjectCollection$1.execute(DefaultDomainObjectCollection.java:57) | |
[15:08:55]W: [Step 2/3] at org.gradle.api.internal.collections.DefaultPendingSource.realize(DefaultPendingSource.java:54) | |
[15:08:55]W: [Step 2/3] at org.gradle.api.internal.collections.DefaultPendingSource.realizePending(DefaultPendingSource.java:33) | |
[15:08:55]W: [Step 2/3] at org.gradle.api.internal.collections.SortedSetElementSource.iterator(SortedSetElementSource.java:57) | |
[15:08:55]W: [Step 2/3] at org.gradle.api.internal.collections.FilteredCollection.size(FilteredCollection.java:160) | |
[15:08:55]W: [Step 2/3] at org.gradle.api.internal.DefaultDomainObjectCollection.size(DefaultDomainObjectCollection.java:335) | |
[15:08:55]W: [Step 2/3] at org.gradle.api.internal.tasks.RealizableTaskCollection.size(RealizableTaskCollection.java:229) | |
[15:08:55]W: [Step 2/3] at TeamcityPropertiesListener.loadTestJvmArgs(/opt/buildagent/plugins/gradle-runner/scripts/init.gradle:159) | |
[15:08:55]W: [Step 2/3] at TeamcityPropertiesListener.afterEvaluate(/opt/buildagent/plugins/gradle-runner/scripts/init.gradle:152) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.event.DefaultListenerManager$ListenerDetails.dispatch(DefaultListenerManager.java:370) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.event.DefaultListenerManager$ListenerDetails.dispatch(DefaultListenerManager.java:352) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:58) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.event.DefaultListenerManager$EventBroadcast$ListenerDispatch.dispatch(DefaultListenerManager.java:340) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.event.DefaultListenerManager$EventBroadcast$ListenerDispatch.dispatch(DefaultListenerManager.java:327) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:42) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:230) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:149) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:140) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93) | |
[15:08:55]W: [Step 2/3] at com.sun.proxy.$Proxy33.afterEvaluate(Unknown Source) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:42) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:230) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:149) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:58) | |
[15:08:55]W: [Step 2/3] ... 87 more | |
[15:08:55]W: [Step 2/3] Caused by: java.lang.NullPointerException | |
[15:08:55]W: [Step 2/3] at net.minecraftforge.gradle.common.task.DownloadMavenArtifact.getOutput(DownloadMavenArtifact.java:72) | |
[15:08:55]W: [Step 2/3] at net.minecraftforge.gradle.common.task.DownloadMavenArtifact_Decorated.getOutput(Unknown Source) | |
[15:08:55]W: [Step 2/3] at net.minecraftforge.gradle.userdev.UserDevPlugin.lambda$apply$2(UserDevPlugin.java:133) | |
[15:08:55]W: [Step 2/3] at org.gradle.internal.ImmutableActionSet$SetWithManyActions.execute(ImmutableActionSet.java:327) | |
[15:08:55]W: [Step 2/3] at org.gradle.api.internal.DefaultDomainObjectCollection.doAdd(DefaultDomainObjectCollection.java:232) | |
[15:08:55]W: [Step 2/3] at org.gradle.api.internal.DefaultDomainObjectCollection.add(DefaultDomainObjectCollection.java:226) | |
[15:08:55]W: [Step 2/3] at org.gradle.api.internal.DefaultNamedDomainObjectCollection.add(DefaultNamedDomainObjectCollection.java:110) | |
[15:08:55]W: [Step 2/3] at org.gradle.api.internal.tasks.DefaultTaskContainer.access$2200(DefaultTaskContainer.java:69) | |
[15:08:55]W: [Step 2/3] at org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreatingProvider$1.run(DefaultTaskContainer.java:616) | |
[15:08:55]W: [Step 2/3] ... 125 more | |
[15:08:55]W: [Step 2/3] | |
[15:08:55]W: [Step 2/3] | |
[15:08:55]W: [Step 2/3] * Get more help at https://help.gradle.org | |
[15:08:55]W: [Step 2/3] | |
[15:08:55]W: [Step 2/3] BUILD FAILED in 9s | |
[15:08:55]W: [Step 2/3] Process exited with code 1 | |
[15:08:55]E: [Step 2/3] Process exited with code 1 (Step: Setup (Gradle)) | |
[15:08:55]E: [Step 2/3] Step Setup (Gradle) failed | |
[15:08:55]W: Step 3/3: Compile (Gradle) | |
[15:08:55]W: [Step 3/3] Build step Compile (Gradle) is skipped because the previous step has failed | |
[15:08:55] : Publishing internal artifacts (1s) | |
[15:08:56] : [Publishing internal artifacts] Publishing 1 file using [WebPublisher] | |
[15:08:56] : [Publishing internal artifacts] Publishing 1 file using [ArtifactsCachePublisher] | |
[15:08:55]W: Publishing artifacts (1s) | |
[15:08:55] : [Publishing artifacts] Collecting files to publish: [+:**\build\libs\*.jar => build\libs] | |
[15:08:55]W: [Publishing artifacts] Artifacts path '**/build/libs/*.jar' not found | |
[15:08:57] : Build finished |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jetbrains.buildServer.ComparisonFailureData | |
import jetbrains.buildServer.ComparisonFailureUtil | |
import jetbrains.buildServer.agent.AgentRuntimeProperties | |
import jetbrains.buildServer.gradle.GradleRunnerConstants | |
import jetbrains.buildServer.gradle.agent.GradleBuildProblem | |
import jetbrains.buildServer.messages.serviceMessages.* | |
import java.util.concurrent.ConcurrentHashMap | |
import java.util.concurrent.ConcurrentMap | |
import java.util.concurrent.atomic.AtomicBoolean | |
import java.util.concurrent.atomic.AtomicLong | |
/* | |
* Copyright 2000-2013 JetBrains s.r.o. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, | |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
* See the License for the specific language governing permissions and | |
* limitations under the License. | |
*/ | |
initscript { | |
dependencies { | |
def teamCityInitLib = System.getenv("TEAMCITY_BUILD_INIT_PATH") | |
logger.info "Init lib: ${teamCityInitLib}" | |
def classPathFiles = teamCityInitLib.split(File.pathSeparator) | |
classpath files(classPathFiles) | |
} | |
} | |
public class DependencyBasedTestRun { | |
def logger | |
public DependencyBasedTestRun(Logger logger) { | |
this.logger = logger | |
} | |
public def configureGradle(Gradle gradle) { | |
def rootProject = gradle.rootProject | |
def incrementalOption = System.getenv(GradleRunnerConstants.ENV_INCREMENTAL_PARAM); | |
logger.debug("Received following incremental setting: ${incrementalOption}") | |
switch(incrementalOption) { | |
case GradleRunnerConstants.ENV_INCREMENTAL_VALUE_SKIP: | |
logger.debug("Incremental building is enabled, but full rebuild is forced"); | |
gradle.startParameter.taskNames = ["build"]; | |
break; | |
case GradleRunnerConstants.ENV_INCREMENTAL_VALUE_PROCEED: | |
logger.debug("Will look for affected projects") | |
def modifiedProjects = findAffectedProjects(rootProject); | |
if (modifiedProjects.empty) { | |
logger.debug("No affected projects found. Running full build.") | |
gradle.startParameter.taskNames = ["build"] | |
} else { | |
gradle.startParameter.taskNames = modifiedProjects.collect { it + ":buildDependents" } | |
logger.debug("Will start with following tasks: ${gradle.startParameter.taskNames}") | |
} | |
break; | |
default: | |
logger.debug("Incremental building is not enabled"); | |
} | |
} | |
private def findAffectedProjects(Project project) { | |
if (project.teamcity.containsKey(AgentRuntimeProperties.CHANGED_FILES_FILE_PARAM)) { | |
def changedFiles = readChangedFiles(project.teamcity); | |
def sourceSetsToProject = readSourceSets(project); | |
logger.debug("Modified Files: ${changedFiles}") | |
logger.debug("SourceSets to Project: ${sourceSetsToProject}") | |
def changedProjects = [] | |
changedFiles.each { path -> | |
sourceSetsToProject.findAll({ | |
path.startsWith(it.key) | |
}).collect(changedProjects) {it.value} | |
} | |
logger.debug("Changes detected in following projects:") | |
logger.debug("${changedProjects}") | |
return changedProjects | |
} | |
} | |
private def readSourceSets(Project proj) { | |
def result = [:] | |
proj.allprojects { | |
def collectRelativePath = { File file -> | |
def path = proj.relativePath(file.getAbsolutePath()).replace('\\','/') | |
result[path] = project.getPath() | |
} | |
if (delegate.hasProperty("sourceSets")) { | |
sourceSets*.allSource.srcDirs*.each collectRelativePath | |
sourceSets*.resources.srcDirs*.each collectRelativePath | |
} | |
} | |
return result | |
} | |
private def readChangedFiles(Map TCProps) { | |
String filename = TCProps["teamcity.build.changedFiles.file"] | |
def lines = new File(filename).readLines() | |
def personalMatch = /(.*):(.*):<personal>/ | |
def allMatch = /(.*):(.*):(.*)/ | |
if (lines.any { it ==~ personalMatch }) { | |
return lines.grep(~personalMatch).collect { | |
(it =~ personalMatch)[0][1] | |
} | |
} else { | |
return lines.collect { | |
(it =~ allMatch)[0][1] | |
} | |
} | |
} | |
} | |
public class TeamcityPropertiesListener implements ProjectEvaluationListener { | |
AtomicBoolean initScriptStartReported = new AtomicBoolean(false); | |
def logger; | |
public TeamcityPropertiesListener(Logger log) { | |
logger = log | |
} | |
public void beforeEvaluate(Project project) { | |
loadProps(project); | |
// Marker for TeamCity listener that shows that init script started to execute successfully | |
if (initScriptStartReported.compareAndSet(false, true)) { | |
logger.lifecycle(GradleRunnerConstants.STARTING_TEAMCITY_BUILD_PREFIX + project.teamcity["build.number"]) | |
} | |
} | |
public void afterEvaluate(Project project, ProjectState projectState) { | |
if (project.hasProperty("teamcity")) { | |
loadTestJvmArgs(project); | |
} | |
} | |
private void loadTestJvmArgs(Project project) { | |
final String jvmargs = (String) project.teamcity["gradle.test.jvmargs"] | |
final String[] arguments = jvmargs == null ? new String[0] : jvmargs.split("\n") | |
project.tasks.withType(TestTaskWrapper.type) | |
.collect { def task -> new TestTaskWrapper(task) } | |
.each { TestTaskWrapper task -> | |
task.setTmpDirectory(project.teamcity["teamcity.build.tempDir"]) | |
.jvmArgs(arguments) | |
} | |
} | |
private void loadProps(Project p) { | |
String propsFilePath = System.getProperty(AgentRuntimeProperties.AGENT_BUILD_PARAMS_FILE_PROP); | |
if (null == propsFilePath) { | |
propsFilePath = System.getenv(AgentRuntimeProperties.AGENT_BUILD_PARAMS_FILE_ENV); | |
} | |
if (null != propsFilePath) { | |
File propsFile = p.file(propsFilePath); | |
Properties props = new Properties(); | |
InputStream inStream = null; | |
try { | |
inStream = new FileInputStream(propsFile); | |
props.load(inStream); | |
} catch (FileNotFoundException e) { | |
logger.error(e.getMessage(), e); | |
} catch (IOException e) { | |
logger.error(e.getMessage(), e); | |
} finally { | |
if (null != inStream) { | |
try { | |
inStream.close(); | |
} catch (IOException e) { | |
Logger.log(LogLevel.ERROR, "Failed to close file stream!", e); | |
} | |
} | |
} | |
addCustomProperties(p, props) | |
} else { | |
addCustomProperties(p, new HashMap()) | |
} | |
} | |
private void addCustomProperties(Project p, Map props) { | |
if (p.hasProperty("ext")) { | |
props.each { k,v -> p.ext.set(k, v)} | |
p.ext.teamcity = props | |
} else { | |
p.setProperty("teamcity", props) | |
} | |
} | |
} | |
public class TeamcityTaskListener implements TaskExecutionListener, TaskActionListener { | |
public static final String DEFAULT_FLOW_ID_PREFIX = "%%teamcity%%-" | |
def taskMessages = new ConcurrentHashMap<Task, TeamCityOutputListener>() | |
def blockOpenMessagesCache = new ConcurrentHashMap<Task, ServiceMessage>() | |
def logger | |
boolean isParallelExec | |
def flowIdPrefix = DEFAULT_FLOW_ID_PREFIX; | |
public TeamcityTaskListener(Logger log, boolean parallelExec) { | |
logger = log; | |
isParallelExec = parallelExec; | |
} | |
String getProjectFlowId(project) { | |
return String.valueOf(project.getPath().hashCode()); | |
} | |
public void beforeExecute(Task task) { | |
ServiceMessage message; | |
if (task instanceof AbstractCompile) { | |
TeamCityOutputListener errorListener = taskMessages.get(task); | |
if (null == errorListener) { | |
// during the tasks execution service messages generated by us can be caught by TeamCityOutputListener | |
// to prevent this we add flowIdPrefix to their flowId attribute and this allows TeamCityOutputListener class to exclude them | |
errorListener = new TeamCityOutputListener("flowId='" + flowIdPrefix); | |
taskMessages.put(task, errorListener); | |
} | |
errorListener.reset(); | |
task.getLogging().addStandardOutputListener(errorListener); | |
task.getLogging().addStandardErrorListener(errorListener); | |
message = addFlowId(task, new CompilationStarted(task.getPath())); | |
} else { | |
message = addFlowId(task, new BlockOpened(task.getPath())); | |
} | |
def oldMessage = popFromBlockOpenCache(task) | |
if (oldMessage != null) { | |
logger.debug("Unexpected BlockOpen message cache content: key=[${task.getPath()}] value=[${oldMessage}]"); | |
logger.lifecycle(message.asString()); | |
} | |
logger.debug("BeforeExecute: storing message: key=[${task.getPath()}] value=[${message.asString().substring(2)}]"); | |
blockOpenMessagesCache.put(task, message); | |
} | |
public void afterExecute(Task task, TaskState taskState) { | |
try { | |
if (handleTaskSkippedState(task, taskState)) { | |
return; | |
} | |
handleTaskFinishedState(task, taskState) | |
} finally { | |
taskMessages.remove(task); | |
} | |
} | |
private void handleTaskFinishedState(Task task, TaskState taskState) { | |
ServiceMessage blockCloseMessage; | |
if (task instanceof AbstractCompile) { | |
Throwable failure = taskState.getFailure(); | |
if (null != failure) { | |
final TeamCityOutputListener outputListener = taskMessages.get(task); | |
outputListener.getMessages().each { message -> | |
logger.lifecycle(addFlowId(task, new Message(message, "ERROR", null)).asString()); // compilation failure | |
} | |
} | |
blockCloseMessage = addFlowId(task, new CompilationFinished(task.getPath())); | |
} else { | |
blockCloseMessage = addFlowId(task, new BlockClosed(task.getPath())); | |
} | |
logger.lifecycle(blockCloseMessage.asString()); | |
} | |
/** | |
* Handle possible task up-to-date skip. | |
* Checks if task was skipped. If so, reposts sequence of BlockOpened-BlockClosed messages with proper text | |
* Otherwise, prints BlockOpened message, if it was not printed yet. | |
* @param task | |
* @param taskState | |
* @return true if task was skipped. | |
*/ | |
private boolean handleTaskSkippedState(Task task, TaskState taskState) { | |
def message = popFromBlockOpenCache(task); | |
def skipped = false; | |
if (message != null) { | |
if (taskState.getSkipped()) { | |
logger.debug("No actions were executed for task [${task}]. Task was skipped because [${taskState.getSkipMessage()}].") | |
def text; | |
if (message instanceof CompilationStarted) { | |
text = ((CompilationStarted)message).getCompilerName(); | |
} else { | |
text = ((BlockOpened)message).getBlockName(); | |
} | |
text += " ${taskState.getSkipMessage()}"; | |
if (message instanceof CompilationStarted) { | |
logger.lifecycle(addFlowId(task, new CompilationStarted(text)).asString()); | |
logger.lifecycle(addFlowId(task, new CompilationFinished(text)).asString()); | |
} else { | |
logger.lifecycle(addFlowId(task, new BlockOpened(text)).asString()); | |
logger.lifecycle(addFlowId(task, new BlockClosed(text)).asString()); | |
} | |
skipped = true; | |
} else { | |
logger.debug("No actions were executed for task [${task}]. But task was not skipped, sending blockOpenmessage [${message.asString().substring(2)}]") | |
logger.lifecycle(message.asString()) | |
} | |
} | |
skipped | |
} | |
private ServiceMessage popFromBlockOpenCache(Task task) { | |
ServiceMessage message = blockOpenMessagesCache.get(task); | |
blockOpenMessagesCache.remove(task); | |
return message | |
} | |
void beforeActions(final Task task) { | |
ServiceMessage message = popFromBlockOpenCache(task); | |
if (message != null) { | |
logger.debug("BeforeActions: task [${task}]. Sending blockOpen message [${message.asString().substring(2)}]") | |
logger.lifecycle(message.asString()); | |
} else { | |
logger.debug("BeforeActions: null message for task [${task}]. Will not send service message") | |
} | |
} | |
void afterActions(final Task task) { | |
// do nothing | |
} | |
ServiceMessage addFlowId(task, message) { | |
if (isParallelExec) { | |
message.setFlowId(flowIdPrefix + String.valueOf(task.getPath().hashCode())) | |
} | |
return message | |
} | |
private class TeamCityOutputListener implements StandardOutputListener { | |
private volatile StringBuffer text = new StringBuffer() | |
private String ignoreMarker | |
TeamCityOutputListener(final String ignoreMarker) { | |
this.ignoreMarker = ignoreMarker | |
} | |
public void onOutput(CharSequence chars) { | |
def str = chars.toString(); | |
if (str.contains(ignoreMarker)) return; | |
text.append(str) | |
} | |
public Collection<String> getMessages() { | |
def lines = text.toString().split('\\r?\\n'); | |
def res = [] | |
for (line in lines) { | |
def trimmed = line.trim(); | |
if (trimmed.length() > 0) { | |
res.add(line); | |
} | |
} | |
return res; | |
} | |
public void reset() { | |
text = new StringBuffer() | |
} | |
} | |
} | |
public class TeamcityTestListener { | |
private static final int MAX_MESSAGE_SIZE = Integer.getInteger("teamcity.gradle.stacktrace.maxLength", 18 * 1024) | |
private static final int MAX_TEST_NAME_LENGTH = Integer.getInteger("teamcity.gradle.testName.maxLength", 100) | |
private static final int MIN_ATTACHED_MESSAGE_SIZE = Integer.getInteger("teamcity.gradle.minAttachedTestException", MAX_MESSAGE_SIZE) | |
Logger logger | |
def baseTask | |
boolean isParallelBuild | |
private String projectFlowId | |
private ConcurrentMap<TestDescriptor, List> testOutputs = new ConcurrentHashMap() | |
private Map<String, Boolean> startedFlowIds = new ConcurrentHashMap(); | |
boolean skipStdErr = false | |
boolean skipStdOut = false | |
private final Project project | |
private final AtomicLong testCounter; | |
public TeamcityTestListener(Logger log, TestTaskWrapper task, boolean isParallel, Project project, AtomicLong testCounter) { | |
this.project = project | |
logger = log | |
isParallelBuild = isParallel | |
projectFlowId = TeamcityTaskListener.DEFAULT_FLOW_ID_PREFIX + String.valueOf(task.project.getPath().hashCode()) | |
this.testCounter = testCounter; | |
} | |
String getFlowId(TestDescriptor descriptor) { | |
return projectFlowId + "-" + System.identityHashCode(descriptor); | |
} | |
/** | |
* Called before a test suite is started. | |
* @param suite The suite whose tests are about to be executed. | |
*/ | |
public void beforeSuite(TestDescriptor suite) { | |
if (suite.getParent() == null) return; | |
if (shouldBeIgnored(suite)) return; | |
def flowId = getFlowId(suite); | |
startFlowIfNotStarted(flowId, suite); | |
ServiceMessage msg = new TestSuiteStarted(suite.getName()); | |
msg.setFlowId(flowId); | |
logger.lifecycle(msg.asString()); | |
} | |
private boolean shouldBeIgnored(TestDescriptor suite) { | |
suite.getName().startsWith("Gradle Test Executor") || suite.getName().startsWith("Gradle Test Run") | |
} | |
private void startFlowIfNotStarted(String flowId, TestDescriptor suite) { | |
if (startedFlowIds.put(flowId, true) == null) { | |
def parentFlowId = projectFlowId; | |
def parentSuite = suite.getParent() | |
if (parentSuite != null && !shouldBeIgnored(parentSuite)) { | |
parentFlowId = getFlowId(parentSuite); | |
} | |
logger.lifecycle("##teamcity[flowStarted flowId='${flowId}' parent='${parentFlowId}']"); | |
} | |
} | |
/** | |
* Called after a test suite is finished. | |
* @param suite The suite whose tests have finished being executed. | |
* @param result The aggregate result for the suite. | |
*/ | |
public void afterSuite(TestDescriptor suite, TestResult result) { | |
if (suite.getParent() == null) return; | |
if (shouldBeIgnored(suite)) return; | |
def flowId = getFlowId(suite); | |
ServiceMessage msg = new TestSuiteFinished(suite.getName()); | |
msg.setFlowId(flowId); | |
logger.lifecycle(msg.asString()); | |
finishStartedFlow(flowId); | |
} | |
private void finishStartedFlow(String flowId) { | |
if (startedFlowIds.remove(flowId) != null) { | |
logger.lifecycle("##teamcity[flowFinished flowId='${flowId}']"); | |
} | |
} | |
/** | |
* Called before a test is started. | |
* @param testDescriptor The test which is about to be executed. | |
*/ | |
public void beforeTest(TestDescriptor testDescriptor) { | |
def flowId = getFlowId(testDescriptor); | |
startFlowIfNotStarted(flowId, testDescriptor); | |
String testName = getTestName(testDescriptor) | |
ServiceMessage msg = new TestStarted(testName, false, null); | |
msg.setFlowId(flowId); | |
logger.lifecycle(msg.asString()); | |
} | |
/** | |
* Called after a test is finished. | |
* @param testDescriptor The test which has finished executing. | |
* @param result The test result. | |
*/ | |
public void afterTest(TestDescriptor testDescriptor, TestResult result) { | |
String testName = getTestName(testDescriptor); | |
def flowId = getFlowId(testDescriptor); | |
def outputs = testOutputs.remove(testDescriptor); | |
if (outputs != null) { | |
synchronized (outputs) { | |
flushOutputs(testDescriptor, outputs); | |
} | |
} | |
ServiceMessage msg; | |
switch (result.getResultType()) { | |
case org.gradle.api.tasks.testing.TestResult.ResultType.FAILURE: | |
WrappedException exception = new WrappedException(result.getException(), MAX_MESSAGE_SIZE) | |
msg = exception.getServiceMessage(testName) | |
attacheBigFailTestMessage(testName, exception, flowId); | |
msg.setFlowId(flowId); | |
logger.lifecycle(msg.asString()); | |
break; | |
case org.gradle.api.tasks.testing.TestResult.ResultType.SKIPPED: | |
msg = new TestIgnored(testName, ""); | |
msg.setFlowId(flowId); | |
logger.lifecycle(msg.asString()); | |
break; | |
}; | |
final int duration = (int) (result.getEndTime() - result.getStartTime()); | |
msg = new TestFinished(testName, duration); | |
msg.setFlowId(flowId); | |
logger.lifecycle(msg.asString()); | |
finishStartedFlow(flowId); | |
} | |
private String getProjectProperty(String propertyName) { | |
if (project.hasProperty("ext")) { | |
return project.ext.teamcity[propertyName] | |
} else { | |
return project.property(propertyName) | |
} | |
} | |
private setProjectProperty(String propertyName, String propertyValue) { | |
if (project.hasProperty("ext")) { | |
project.ext.teamcity[propertyName] = propertyValue | |
} else { | |
Map props = project.property("teamcity") | |
props[propertyName] = propertyValue | |
project.setProperty("teamcity", props) | |
} | |
} | |
synchronized private File createBigStacktracesDir() { | |
String path = null; | |
if ((path = getProjectProperty("teamcity.build.stacktraceLogDir")) != null) { | |
return new File(path) | |
} | |
final String rootTmpDirectory = getProjectProperty("teamcity.build.tempDir") ?: project.getBuildDir().path | |
File resultDir = new File("${rootTmpDirectory}${File.separator}.teamcity${File.separator}testFailMessages${File.separator}${System.nanoTime()}") | |
if (resultDir.mkdirs()) { | |
setProjectProperty("teamcity.build.stacktraceLogDir", resultDir.path) | |
return resultDir | |
} | |
return null | |
} | |
private void attacheBigFailTestMessage(String testName, WrappedException exception, String flowId) { | |
if (MIN_ATTACHED_MESSAGE_SIZE == -1) return | |
if (MIN_ATTACHED_MESSAGE_SIZE > exception.size) return | |
if (exception.equalsOrigin) return | |
File artifactDir = createBigStacktracesDir() | |
if (artifactDir == null) { | |
return | |
} | |
String fileName = "${testCounter.incrementAndGet()}.log" | |
File artifactPath = new File(fileName, artifactDir) | |
PrintStream logFilePrint | |
try { | |
artifactPath.delete() | |
logFilePrint = new PrintStream(new FileOutputStream(artifactPath)) | |
exception.th.printStackTrace(logFilePrint) | |
} finally { | |
logFilePrint?.close() | |
} | |
String artifactName = ".teamcity/gradle/${artifactDir.name}" | |
def artifact = new PublishArtifacts("${artifactPath.canonicalPath} => ${artifactName}") | |
artifact.setFlowId(flowId) | |
logger.lifecycle(artifact.toString()) | |
ServiceMessage metadata = new ServiceMessage(ServiceMessageTypes.TEST_METADATA, [testName: testName, | |
type : 'artifact', | |
value : "${artifactName}/${fileName}" as String, | |
name : 'teamcity.test.output']) | |
metadata.setFlowId(flowId) | |
logger.lifecycle(metadata.toString()) | |
} | |
public void onOutput(testDescriptor, outputEvent) { | |
if (testDescriptor.getClassName() == null) { | |
// this is not a real test output | |
return; | |
} | |
def outputs = testOutputs.get(testDescriptor); | |
if (outputs == null) { | |
outputs = []; | |
def prev = testOutputs.putIfAbsent(testDescriptor, outputs) | |
if (prev != null) { | |
outputs = prev | |
} | |
} | |
synchronized (outputs) { | |
outputs.add(outputEvent); | |
if (outputs.size() > 100) { | |
flushOutputs(testDescriptor, outputs) | |
outputs.clear(); | |
} | |
} | |
} | |
private void flushOutputs(TestDescriptor testDescriptor, List outputs) { | |
def testName = getTestName(testDescriptor) | |
def flowId = getFlowId(testDescriptor) | |
StringBuilder stdout = new StringBuilder() | |
StringBuilder stderr = new StringBuilder() | |
for (oe in outputs) { | |
switch (oe.getDestination()) { | |
case TestOutputEvent.Destination.StdErr: | |
if (!skipStdErr) stderr.append(oe.message); | |
break | |
case TestOutputEvent.Destination.StdOut: | |
if (!skipStdOut) stdout.append(oe.message); | |
break | |
} | |
} | |
if (stdout.length() > 0) { | |
def msg = new TestStdOut(testName, stdout.toString() - ~/\r?\n\z/) | |
msg.addTag(ServiceMessage.PARSE_SERVICE_MESSAGES_INSIDE_TAG) | |
msg.setFlowId(flowId) | |
logger.lifecycle(msg.asString()) | |
} | |
if (stderr.length() > 0) { | |
def msg = new TestStdErr(testName, stderr.toString() - ~/\r?\n\z/) | |
msg.addTag(ServiceMessage.PARSE_SERVICE_MESSAGES_INSIDE_TAG) | |
msg.setFlowId(flowId) | |
logger.lifecycle(msg.asString()) | |
} | |
} | |
private String getTestName(TestDescriptor testDescriptor) { | |
return testDescriptor.getClassName() + "." + testDescriptor.getName() | |
} | |
def testListenerDelegate = [ | |
beforeSuite: { suite -> | |
this.beforeSuite(suite) | |
}, | |
afterSuite: { suite, result -> | |
this.afterSuite(suite, result) | |
}, | |
beforeTest: { testDescriptor -> | |
this.beforeTest(testDescriptor) | |
}, | |
afterTest: { testDescriptor, result -> | |
this.afterTest(testDescriptor, result) | |
}] | |
def testOutputDelegate = [ | |
onOutput: { testDescriptor, outputEvent -> | |
this.onOutput(testDescriptor, outputEvent) | |
}] | |
} | |
public class TeamcityExceptionsListener extends BuildAdapter { | |
def logger | |
public TeamcityExceptionsListener(Logger log) { | |
logger = log | |
} | |
void buildFinished(BuildResult result) { | |
def failure = result.getFailure() | |
if (failure != null) { | |
while (!(failure instanceof org.gradle.api.tasks.TaskExecutionException) && failure != failure.getCause() && failure.getCause() != null) { | |
failure = failure.getCause() | |
} | |
def message; | |
if (failure instanceof org.gradle.api.tasks.TaskExecutionException && failure.getCause() != null) { | |
message = "${failure.getMessage()} ${failure.getCause().getClass().getName()}: ${failure.getCause().getMessage()}" | |
} else { | |
message = "${failure.getClass().getName()}: ${failure.getMessage()}" | |
} | |
if (message.contains("There were failing tests") || message.contains("Compilation failed") || message.contains("Compilation error")) { | |
// do not report tests and compilation failures as build problems, as they are logged separately | |
return | |
} | |
logger.warn(new GradleBuildProblem(message).asString()); | |
} | |
} | |
} | |
/** | |
* Use WrappedException if you need to make a error message shorter | |
*/ | |
class WrappedException extends Exception { | |
final Throwable th | |
private final int length | |
private final String DELIMITER | |
private final String message; | |
/** | |
* @param th original exception | |
* @param length max message length | |
*/ | |
WrappedException(Throwable th, int length) { | |
this.th = th | |
this.length = length | |
int size = length / 1024 | |
DELIMITER = "***** A part of the stacktrace was cut by TeamCity build agent because the stacktrace size exceeded ${size} KB *****" | |
message = trim(th.toString(), length) | |
} | |
public boolean isEqualsOrigin() { | |
return size <= length | |
} | |
public int getSize() { | |
return th.toString().length() | |
} | |
@Override | |
public String toString() { | |
return trim(th.toString(), length) | |
} | |
public ServiceMessage getServiceMessage(String testName) { | |
ComparisonFailureData cfd = ComparisonFailureUtil.extractComparisonFailure(th) | |
if (cfd != null) { | |
return new TestFailed(testName, this, trim(cfd.getActual(), length), trim(cfd.getExpected(), length)); | |
} else { | |
return new TestFailed(testName, this); | |
} | |
} | |
/** | |
* Print StackTrace from the delegate object but a message from current current | |
*/ | |
@Override | |
void printStackTrace(final PrintStream s) { | |
Throwable exc = this; | |
PrintStream stream = new PrintStream(s) { | |
@Override | |
void println(final Object obj) { | |
super.println(th.is(obj) ? exc : obj) | |
} | |
} | |
th.printStackTrace(stream) | |
} | |
/** | |
* Split the message into 2 parts, if its size is large | |
* @param str original message | |
* @param length max length | |
* @return original message if str.length < length or split message with delimiter | |
*/ | |
private String trim(String str, int length) { | |
if (str.length() <= length) return str | |
return """${str.substring(0, (int)(length / 2))} ... | |
${DELIMITER} | |
... ${str.substring(str.length() - (int)(length / 2))}""" | |
} | |
} | |
class TestTaskWrapper { | |
final static Class type | |
static { | |
try { | |
type = Class.forName("org.gradle.api.tasks.testing.AbstractTestTask") | |
} catch (ClassNotFoundException ignore) { | |
type = Test.class | |
} | |
} | |
private final def testTask | |
TestTaskWrapper(def testTask) { this.testTask = testTask } | |
void addTestListener(def listener) { testTask.addTestListener(listener) } | |
void addTestOutputListener(def listener) { testTask.addTestOutputListener(listener) } | |
Project getProject() { testTask.project } | |
TestTaskWrapper jvmArgs(Object... arguments) { | |
if (testTask instanceof Test) { | |
testTask.jvmArgs(arguments) | |
} | |
return this | |
} | |
TestTaskWrapper setTmpDirectory(String path) { | |
if (testTask instanceof Test && | |
path != null && path != "") { | |
testTask.systemProperty("java.io.tmpdir", path) | |
} | |
return this | |
} | |
} | |
def isParallelExec = (gradle.startParameter.hasProperty("parallelThreadCount") && gradle.startParameter.parallelThreadCount != 0) || | |
(gradle.startParameter.hasProperty("parallelProjectExecutionEnabled") && gradle.startParameter.parallelProjectExecutionEnabled); | |
def testOutputListenerClass = null | |
try { | |
testOutputListenerClass = Class.forName("org.gradle.api.tasks.testing.TestOutputListener", false, getClass().getClassLoader()); | |
} catch (ClassNotFoundException e) { | |
logger.debug("Could not load TestOutputListener class. Test output will not be available") | |
} | |
final AtomicLong testCounter = new AtomicLong(0); | |
gradle.addListener(new TeamcityPropertiesListener(logger)) | |
gradle.addListener(new TeamcityExceptionsListener(logger)) | |
gradle.useLogger(new TeamcityTaskListener(logger, isParallelExec)) | |
gradle.projectsEvaluated { Gradle gradle -> | |
new DependencyBasedTestRun(logger).configureGradle(gradle) | |
gradle.rootProject.allprojects { Project project -> | |
project.tasks.withType(TestTaskWrapper.type) | |
.collect { new TestTaskWrapper(it) } | |
.each { TestTaskWrapper testTask -> | |
def testListener = new TeamcityTestListener(logger, testTask, isParallelExec, project, testCounter) | |
testTask.addTestListener(testListener.testListenerDelegate as TestListener) | |
if (testOutputListenerClass != null) { | |
testTask.addTestOutputListener(testListener.testOutputDelegate.asType(testOutputListenerClass)) | |
testListener.skipStdOut = Boolean.valueOf(System.properties["teamcity.ignoreTestStdOut"]) | |
testListener.skipStdErr = Boolean.valueOf(System.properties["teamcity.ignoreTestStdErr"]) | |
} | |
} | |
} | |
gradle.rootProject.allprojects.each { project -> | |
project.getTasks().findByName("junitPlatformTest").each { task -> | |
task.outputs.files.each { file -> | |
def message = new ServiceMessage("importData", [ "type" : "junit", "path": "$file.absolutePath/*.xml".toString()]) | |
println(message.asString()) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment