RobWin / jgitflow-gradle-plugin

A Gradle Plugin which adds tasks to support the Gitflow Workflow.
Apache License 2.0
48 stars 44 forks source link

Misleading error if version is not correctly formatted in gradle.properties #28

Open ptaylor opened 6 years ago

ptaylor commented 6 years ago

If I have spaces in the version property I get the following errror

version.properties: version = 1.0.0-SNAPSHOT

./gradlew releaseStart


...
16:15:59.532 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Build operation 'Execute start for :releaseStart' started
16:15:59.575 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] parsing buildfile jar:file:/Users/ptaylor/.gradle/wrapper/dists/gradle-4.5-bin/bgd6nrwgxy3inh8yed6gmsvbx/gradle-4.5/lib/ant-1.9.9.jar!/org/apache/tools/ant/antlib.xml with URI = jar:file:/Users/ptaylor/.gradle/wrapper/dists/gradle-4.5-bin/bgd6nrwgxy3inh8yed6gmsvbx/gradle-4.5/lib/ant-1.9.9.jar!/org/apache/tools/ant/antlib.xml from a zip file
16:15:59.577 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:replace] Replacing in /Users/ptaylor/work/gradle-gitflow/test-project/gradle.properties: version=1.5.0-SNAPSHOT --> version=1.5.0
16:15:59.578 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Completing Build operation 'Execute start for :releaseStart'
16:15:59.578 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter] Removed task artifact state for {} from context.
16:15:59.578 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':releaseStart'
16:15:59.578 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] :releaseStart FAILED
16:15:59.578 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Completing Build operation 'Task :releaseStart'
16:15:59.578 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Build operation 'Task :releaseStart' completed
16:15:59.578 [INFO] [org.gradle.execution.taskgraph.DefaultTaskPlanExecutor] :releaseStart (Thread[Task worker for ':',5,main]) completed. Took 0.046 secs.
16:15:59.578 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.12 completed (1 worker(s) in use)
16:15:59.578 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Task worker for ':': released lock on root.1.12
16:15:59.578 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Task worker for ':': released lock on :
16:15:59.578 [DEBUG] [org.gradle.execution.taskgraph.DefaultTaskPlanExecutor] Task worker [Thread[Task worker for ':',5,main]] finished, busy: 0.046 secs, idle: 0.001 secs
16:15:59.578 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Completing Build operation 'Run tasks'
16:15:59.579 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
16:15:59.579 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
16:15:59.579 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
16:15:59.579 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
16:15:59.579 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':releaseStart'.
16:15:59.579 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > didn't replace anything
16:15:59.579 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
16:15:59.579 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
16:15:59.579 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.  Run with --scan to get full insights.
16:15:59.579 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
16:15:59.579 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org
16:15:59.579 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] 
16:15:59.579 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 0s
'''
ptaylor commented 6 years ago

Also if there is no version in gradle.properties you get this error:


16:43:25.977 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
16:43:25.978 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
16:43:25.978 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
16:43:25.978 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
16:43:25.978 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':releaseStart'.
16:43:25.978 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > com.github.zafarkhaja.semver.UnexpectedCharacterException (no error message)
16:43:25.978 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
16:43:25.978 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
16:43:25.978 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.  Run with --scan to get full insights.
16:43:25.978 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
16:43:25.978 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org
16:43:25.978 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] 
16:43:25.978 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 0s

'''
ptaylor commented 6 years ago

Fix here https://github.com/RobWin/jgitflow-gradle-plugin/pull/29