I'm encountering issue with a custom gradle task. Seems like gradle refuse to start a command line process.
Here is the custom task:
task generateAllure(type: Exec) {
workingDir "$projectDir/allure/bin"
if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
commandLine 'cmd', '/c', 'allure.bat', 'generate', '-c', '../../integration/build/allure-results'
} else {
commandLine 'bash', '-c', 'allure', 'generate', '-c',"$projectDir/integration/build/allure-results"
}
}
tasks.withType(Test)*.finalizedBy generateAllure
With the appropriate dependency:
compile group: 'ru.yandex.qatools.allure', name: 'allure-commandline', version: '1.4.18'
After using gradle clean test execution fails on:
2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':generateAllure'.
> A problem occurred starting process 'command 'cmd''
Any thoughts about that? Thanks!
UPD:
This is the stacktrace i'm getting after performing gradle -S clean test:
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':generateAllure'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:77)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.run(EventFiringTaskExecuter.java:51)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$ExecuteTaskAction.execute(DefaultTaskExecutionGraph.java:262)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$ExecuteTaskAction.execute(DefaultTaskExecutionGraph.java:246)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:136)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:130)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.execute(DefaultTaskPlanExecutor.java:201)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.executeWithTask(DefaultTaskPlanExecutor.java:192)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:130)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.gradle.process.internal.ExecException: A problem occurred starting process 'command 'cmd''
at org.gradle.process.internal.DefaultExecHandle.execExceptionFor(DefaultExecHandle.java:231)
at org.gradle.process.internal.DefaultExecHandle.setEndStateInfo(DefaultExecHandle.java:209)
at org.gradle.process.internal.DefaultExecHandle.failed(DefaultExecHandle.java:355)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:85)
at org.gradle.internal.operations.CurrentBuildOperationPreservingRunnable.run(CurrentBuildOperationPreservingRunnable.java:42)
... 6 more
Caused by: net.rubygrapefruit.platform.NativeException: Could not start 'cmd'
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:27)
at net.rubygrapefruit.platform.internal.WindowsProcessLauncher.start(WindowsProcessLauncher.java:22)
at net.rubygrapefruit.platform.internal.WrapperProcessLauncher.start(WrapperProcessLauncher.java:36)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:67)
... 7 more
Caused by: java.io.IOException: Cannot run program "cmd" (in directory "D:\Git\rozetka-test-automation\allure\bin"): CreateProcess error=267, The directory name is invalid
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
... 10 more
Caused by: java.io.IOException: CreateProcess error=267, The directory name is invalid
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
at java.lang.ProcessImpl.start(ProcessImpl.java:137)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 11 more
Now with the stacktrace the problem is pretty much clear.
In the task you defined
task generateAllure(type: Exec) {
workingDir "$projectDir/allure/bin"
if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
commandLine 'cmd', '/c', 'allure.bat', 'generate', '-c', '../../integration/build/allure-results'
} else {
commandLine 'bash', '-c', 'allure', 'generate', '-c',"$projectDir/integration/build/allure-results"
}
}
tasks.withType(Test)*.finalizedBy generateAllure
You've set the working directory to "$projectDir/allure/bin" this value get interpolated into "D:\Git\rozetka-test-automation\allure\bin" which apparently doesn't exist on your system
Keep in mind that "doesn't exist" might also mean "doesn't exist yet", it depends on what you're doing in the rest of your build.
Under the assumption the allure\bin is not created by the build - something is wrong with your path.
Related
I am experimenting with kotlin multiplatform in this chess app. I have c++ code for the chess engines in the app. For each engine, I want to create a kmm module. Since kotlin native does not yet interop with c++, I have to create wrappers around the c++ code. In each androidMain, I have the JNI class that interface with c++, and this works. ios is where I am not clear. I believe I have to create an obj-c++ wrapper (.mm file) around the c++ code, then do cinterop for the wrapper.
iosTarget("ios") {
compilations.getByName("main") {
val jwtc by cinterops.creating {
defFile(project.file("src/iosMain/cpp/jwtc.def"))
packageName("com.cinterop.jwtc")
}
}
}
Is this right? When I try to build it, gradle sync fails with this error:
Execution failed for task ':jwtc:cinteropJwtcIos'.
> Process 'command '/Applications/Android Studio Preview.app/Contents/jre/Contents/Home/bin/java'' finished with non-zero exit value 1
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':jwtc:cinteropJwtcIos'. <36 internal calls>
Caused by: org.gradle.process.internal.ExecException: Process 'command '/Applications/Android Studio Preview.app/Contents/jre/Contents/Home/bin/java'' finished with non-zero exit value 1
at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:414)
at org.gradle.process.internal.DefaultJavaExecAction.execute(DefaultJavaExecAction.java:52)
at org.gradle.process.internal.DefaultExecActionFactory.javaexec(DefaultExecActionFactory.java:198)
at org.gradle.api.internal.project.DefaultProject.javaexec(DefaultProject.java:1145)
at org.jetbrains.kotlin.compilerRunner.KotlinToolRunner.runViaExec(KotlinToolRunner.kt:98)
at org.jetbrains.kotlin.compilerRunner.KotlinToolRunner.run(KotlinToolRunner.kt:73)
at org.jetbrains.kotlin.gradle.tasks.CInteropProcess.processInterop(KotlinNativeTasks.kt:1035) <122 internal calls>
I have cleaned and restarted android studio severally, and also tried java 8 instead of 11.
I would also appreciate links to more info about the def file. There is not much about it in the kotlin docs.
My jwtc.def:
headers = GameWrapper.h
headerFilter = GameWrapper.h
GameWrapper.h:
#interface GameWrapper
- (void) getBestMove;
#end
GameWrapper.mm:
#include "GameWrapper.h"
#include "Game.h"
#implementation GameWrapper
- (void) getBestMove {
Game game;
game.getBestMove();
}
#end
I finally found that the real error message:
Exception in thread "main" java.lang.Error: /var/folders/17/14lmpq652zn5h_cy_h51z7yr0000gr/T/8492320185156128475.c:1:10: fatal error: 'GameWrapper.h' file not found
and fixed it by adding compilerOpts to point to the location of my src files:
iosTarget("ios") {
compilations.getByName("main") {
val jwtc by cinterops.creating {
defFile(project.file("src/iosMain/cpp/jwtc.def"))
packageName("com.cinterop.jwtc")
compilerOpts ("-Isrc/iosMain/cpp/")
}
}
}
Based on other answers here I am using this Gradle build to create a fat/uber/shaded Jar with my command line tool and a number of JDBC drivers:
import org.gradle.jvm.tasks.Jar
dependencies {
api(project(":db2xls"))
api("ch.qos.logback:logback-classic:1.2.3")
api("com.h2database:h2:1.4.200")
api("org.postgresql:postgresql:42.2.16")
api("mysql:mysql-connector-java:8.0.21")
api("com.microsoft.sqlserver:mssql-jdbc:8.4.1.jre11")
}
val fatJar = task("fatJar", type = Jar::class) {
manifest {
attributes["Implementation-Title"] = "DB2XLS Bundle"
attributes["Implementation-Version"] = "0.1-SNAPSHOT"
attributes["Main-Class"] = "de.peterbecker.xls.Db2XlsKt"
}
from(
configurations.compile.get().map { if (it.isDirectory) it else zipTree(it) },
configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) }
)
with(tasks.jar.get() as CopySpec)
}
tasks {
"build" {
dependsOn(fatJar)
}
}
The build produces a JAR file that looks ok when inspecting with a ZIP tool, but it fails to execute:
$ java -jar db2xls-bundle-0.1-SNAPSHOT.jar
Error: Could not find or load main class de.peterbecker.xls.Db2XlsKt
Caused by: java.lang.ClassNotFoundException: de.peterbecker.xls.Db2XlsKt
The same goes if I use a classpath instead:
$ java -cp db2xls-bundle-0.1-SNAPSHOT.jar de.peterbecker.xls.Db2XlsKt
Error: Could not find or load main class de.peterbecker.xls.Db2XlsKt
Caused by: java.lang.ClassNotFoundException: de.peterbecker.xls.Db2XlsKt
The class file seems to be there, though:
$ jar -t --file db2xls-bundle-0.1-SNAPSHOT.jar | grep Db2XlsKt
de/peterbecker/xls/Db2XlsKt$logger$1.class
de/peterbecker/xls/Db2XlsKt$processQuery$1.class
de/peterbecker/xls/Db2XlsKt$toLists$$inlined$use$lambda$1.class
de/peterbecker/xls/Db2XlsKt.class
And the normal JAR seems to find load the class as expected (then failing on the lack of a depdency):
$ java -cp db2xls-0.1-SNAPSHOT.jar de.peterbecker.xls.Db2XlsKt
Error: Unable to initialize main class de.peterbecker.xls.Db2XlsKt
Caused by: java.lang.NoClassDefFoundError: kotlin/NoWhenBranchMatchedException
What am I doing wrong?
The full code is available at https://github.com/peterbecker/xls-utils/tree/fat_jar
So i have a bare react-native application wherein i am using expo modules.
I am using the expo location module and getting the following error.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
/home/amol/Desktop/AccountantComplete/CompleteCode/Accountant/node_modules/expo-location/android/src/main/java/expo/modules/location/LocationModule.java:361: error: cannot find symbol
new Permissions.PermissionsRequestListener() {
^
symbol: class PermissionsRequestListener
location: interface Permissions
/home/amol/Desktop/AccountantComplete/CompleteCode/Accountant/node_modules/expo-location/android/src/main/java/expo/modules/location/LocationModule.java:502: error: cannot find symbol
mPermissions.getPermission(Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED
^
symbol: method getPermission(String)
location: variable mPermissions of type Permissions
/home/amol/Desktop/AccountantComplete/CompleteCode/Accountant/node_modules/expo-location/android/src/main/java/expo/modules/location/LocationModule.java:503: error: cannot find symbol
&& mPermissions.getPermission(Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED
^
symbol: method getPermission(String)
location: variable mPermissions of type Permissions
Note: /home/amol/Desktop/AccountantComplete/CompleteCode/Accountant/node_modules/expo-location/android/src/main/java/expo/modules/location/taskConsumers/GeofencingTaskConsumer.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':expo-location:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 16s
at checkExecSyncError (child_process.js:607:13)
at execFileSync (child_process.js:627:13)
at runOnAllDevices (/home/amol/Desktop/AccountantComplete/CompleteCode/Accountant/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:39)
at buildAndRun (/home/amol/Desktop/AccountantComplete/CompleteCode/Accountant/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/index.js:158:41)
at then.result (/home/amol/Desktop/AccountantComplete/CompleteCode/Accountant/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/index.js:125:12)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7);
So my best guess is there is an error while importing stuff from permission module.
So i have these lines in expo-permissions app level build.gradle file.
compileOnly('com.facebook.react:react-native:+') {
exclude group: 'com.android.support'
}
I am also using jettifier, i am guessing there is some issue with respect to transpiling code to android x.
I changed this
compileOnly('com.facebook.react:react-native:+') {
exclude group: 'com.android.support'
}
to
implementation 'com.facebook.react:react-native:+'
and everything works fine.
I would like to know exactly what is happening and if this deserves a pull request.
Any help on the same would be highly appreciated thanks.
ok, in my case I needed to raise the following versions from android/build.grade:
buildscript {
ext {
buildToolsVersion = "28.0.3" -> "29.0.2"
minSdkVersion = 21
compileSdkVersion = 28 -> 29
targetSdkVersion = 28 -> 29
}
[
{
"MODID": "ms",
"name": "More Stuff",
"description": "This adds more items to minecraft",
"version": "${1.0}",
"mc_version": "${1.7.10}",
"url": "",
"updateUrl": "",
"authorList": ["Sean Blumenfeld"],
"credits": "Sean Blumenfeld",
"logoFile": "",
"screenshots": [],
"dependencies": []
}
]
When I run the sh gradlew build command in terminal I get the following out put:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':processResources'.
Could not copy file '/Users/seanblumenfeld/Desktop/Java Review/mod/forge-1.7.10-10.13.4.1614-1.7.10-src/src/main/resources/mcmod.info' to '/Users/seanblumenfeld/Desktop/Java Review/mod/forge-1.7.10-10.13.4.1614-1.7.10-src/build/resources/main/mcmod.info'.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
I have no clue what this means or what I did wrong. If you can help me figure it out, I would greatly appreciate it.
here is the --stacktrace output looks like:
What went wrong:
Execution failed for task ':processResources'.
Could not copy file '/Users/seanblumenfeld/Desktop/JavaReview/mod/forge-1.7.10-10.13.4.1614-1.7.10-src/src/main/resources/mcmod.info' to '/Users/seanblumenfeld/Desktop/JavaReview/mod/forge-1.7.10-10.13.4.1614-1.7.10-src/build/resources/main/mcmod.info'.
Try:
Run with --info or --debug option to get more log output.
Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':processResources'.
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:296)
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.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)
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:148)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:105)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:85)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:81)
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:39)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:29)
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: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:127)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:56)
Caused by: org.gradle.api.GradleException: Could not copy file '/Users/seanblumenfeld/Desktop/JavaReview/mod/forge-1.7.10-10.13.4.1614-1.7.10-src/src/main/resources/mcmod.info' to '/Users/seanblumenfeld/Desktop/JavaReview/mod/forge-1.7.10-10.13.4.1614-1.7.10-src/build/resources/main/mcmod.info'.
at org.gradle.api.internal.file.AbstractFileTreeElement.copyTo(AbstractFileTreeElement.java:79)
at org.gradle.api.internal.file.copy.DefaultFileCopyDetails.copyTo(DefaultFileCopyDetails.java:102)
at org.gradle.api.internal.file.copy.FileCopyAction$FileCopyDetailsInternalAction.processFile(FileCopyAction.java:44)
at org.gradle.api.internal.file.copy.NormalizingCopyActionDecorator$1$1.processFile(NormalizingCopyActionDecorator.java:65)
at org.gradle.api.internal.file.copy.DuplicateHandlingCopyActionDecorator$1$1.processFile(DuplicateHandlingCopyActionDecorator.java:60)
at org.gradle.api.internal.file.copy.CopyFileVisitorImpl.processFile(CopyFileVisitorImpl.java:60)
at org.gradle.api.internal.file.copy.CopyFileVisitorImpl.visitFile(CopyFileVisitorImpl.java:44)
at org.gradle.api.internal.file.collections.DirectoryFileTree.walkDir(DirectoryFileTree.java:157)
at org.gradle.api.internal.file.collections.DirectoryFileTree.visitFrom(DirectoryFileTree.java:125)
at org.gradle.api.internal.file.collections.DirectoryFileTree.visit(DirectoryFileTree.java:115)
at org.gradle.api.internal.file.collections.FileTreeAdapter.visit(FileTreeAdapter.java:96)
at org.gradle.api.internal.file.CompositeFileTree.visit(CompositeFileTree.java:54)
at org.gradle.api.internal.file.copy.CopySpecActionImpl.execute(CopySpecActionImpl.java:37)
at org.gradle.api.internal.file.copy.CopySpecActionImpl.execute(CopySpecActionImpl.java:24)
at org.gradle.api.internal.file.copy.DefaultCopySpec$DefaultCopySpecResolver.walk(DefaultCopySpec.java:498)
at org.gradle.api.internal.file.copy.DefaultCopySpec$DefaultCopySpecResolver.walk(DefaultCopySpec.java:500)
at org.gradle.api.internal.file.copy.DefaultCopySpec$DefaultCopySpecResolver.walk(DefaultCopySpec.java:500)
at org.gradle.api.internal.file.copy.DefaultCopySpec.walk(DefaultCopySpec.java:322)
at org.gradle.api.internal.file.copy.DelegatingCopySpecInternal.walk(DelegatingCopySpecInternal.java:206)
at org.gradle.api.internal.file.copy.CopySpecBackedCopyActionProcessingStream.process(CopySpecBackedCopyActionProcessingStream.java:36)
at org.gradle.api.internal.file.copy.DuplicateHandlingCopyActionDecorator$1.process(DuplicateHandlingCopyActionDecorator.java:44)
at org.gradle.api.internal.file.copy.NormalizingCopyActionDecorator$1.process(NormalizingCopyActionDecorator.java:56)
at org.gradle.api.internal.file.copy.FileCopyAction.execute(FileCopyAction.java:35)
at org.gradle.api.internal.file.copy.NormalizingCopyActionDecorator.execute(NormalizingCopyActionDecorator.java:52)
at org.gradle.api.internal.file.copy.DuplicateHandlingCopyActionDecorator.execute(DuplicateHandlingCopyActionDecorator.java:42)
at org.gradle.api.internal.file.copy.CopyActionExecuter.execute(CopyActionExecuter.java:38)
at org.gradle.api.tasks.AbstractCopyTask.copy(AbstractCopyTask.java:83)
at org.gradle.language.jvm.tasks.ProcessResources.copy(ProcessResources.java:33)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:218)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:211)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:200)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:570)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:553)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 47 more
Caused by: groovy.lang.GroovyRuntimeException: Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed:
SimpleTemplateScript1.groovy: 7: unexpected token: 10 # line 7, column 27.
\"mc_version\": \"${1.7.10}\",
^
1 error
at org.gradle.api.internal.file.copy.FilterChain$3.transform(FilterChain.java:90)
at org.gradle.api.internal.file.copy.FilterChain$3.transform(FilterChain.java:84)
at org.gradle.api.internal.ChainingTransformer.transform(ChainingTransformer.java:37)
at org.gradle.api.internal.file.copy.FilterChain.transform(FilterChain.java:39)
at org.gradle.api.internal.file.copy.FilterChain.transform(FilterChain.java:46)
at org.gradle.api.internal.file.copy.DefaultFileCopyDetails.open(DefaultFileCopyDetails.java:86)
at org.gradle.api.internal.file.AbstractFileTreeElement.copyTo(AbstractFileTreeElement.java:56)
at org.gradle.api.internal.file.copy.DefaultFileCopyDetails.copyTo(DefaultFileCopyDetails.java:94)
at org.gradle.api.internal.file.AbstractFileTreeElement.copyFile(AbstractFileTreeElement.java:93)
at org.gradle.api.internal.file.AbstractFileTreeElement.copyTo(AbstractFileTreeElement.java:74)
... 82 more
BUILD FAILED
Total time: 4.389 secs
Look at this line of the stack trace:
Caused by: groovy.lang.GroovyRuntimeException: Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed: SimpleTemplateScript1.groovy: 7: unexpected token: 10 # line 7, column 27. \"mc_version\": \"${1.7.10}\", ^
It specifies that the mc_version line in your mcmod.info can't be parsed. If you look at the forge docs you will see the name of the variable is mcversion, not mc_version. Hopefully changing the name of the variable should solve the error.
I am trying to start Selenium from Gradle in order to run Protractor tests.
Here is my Gradle script:
//main task to run protractor tests
task uiTests << {
println "Starting protractor tests"
}
//start Selenium server
task startSelenium << {
println "Starting Selenium..."
ant.exec(executable: '/bin/bash', spawn: true) {
arg(value:'webdriver-manager')
arg(value:'start')
}
}
//run protractor
task runProtractor(type: Exec) {
commandLine 'protractor', 'bignibou-client/protractor.conf.js'
}
//start selenium, then run protractor
uiTests.dependsOn([startSelenium, runProtractor])
However, the output seems to indicate that the Selenium process has not being started:
:runProtractor
Using the selenium server at http://localhost:4444/wd/hub
[launcher] Running 1 instances of WebDriver
/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:172
callback(new Error(message));
^
Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444
at ClientRequest.<anonymous> (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:172:16)
at emitOne (events.js:77:13)
at ClientRequest.emit (events.js:169:7)
at Socket.socketErrorListener (_http_client.js:259:9)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at emitErrorNT (net.js:1250:8)
at doNTCallback2 (node.js:429:9)
at process._tickCallback (node.js:343:17)
From: Task: WebDriver.createSession()
at Function.webdriver.WebDriver.acquireSession_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:157:22)
at Function.webdriver.WebDriver.createSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:131:30)
at [object Object].Builder.build (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/builder.js:445:22)
at [object Object].DriverProvider.getNewDriver (/usr/local/lib/node_modules/protractor/lib/driverProviders/driverProvider.js:38:7)
at [object Object].Runner.createBrowser (/usr/local/lib/node_modules/protractor/lib/runner.js:182:37)
at /usr/local/lib/node_modules/protractor/lib/runner.js:263:21
at _fulfilled (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:797:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:826:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:759:13)
at /usr/local/lib/node_modules/protractor/node_modules/q/q.js:525:49
[launcher] Process exited with error code 1
:runProtractor FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':runProtractor'.
> Process 'command 'protractor'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Can anyone please provide informed tips and guidance?
By referring the webdriver-manager script directly as shown below sorted the issue:
//main task to run protractor tests
task uiTests << {
println "Starting protractor tests"
}
//start Selenium server
task startSelenium << {
println "Starting Selenium..."
ant.exec(executable: 'webdriver-manager', spawn: true) {//CHANGED!!
arg(value: 'start')
}
}
//run protractor
task runProtractor(type: Exec) {
commandLine 'protractor', 'bignibou-client/protractor.conf.js'
}
//start selenium, then run protractor
uiTests.dependsOn([startSelenium, runProtractor])