mfuerstenau / gradle-buildconfig-plugin

A BuildConfig plugin for Gradle java projects
MIT License
173 stars 20 forks source link

appVersion in buildConfig yields error #8

Closed raleighr3 closed 8 years ago

raleighr3 commented 8 years ago

When trying to set the appVersion in buildConfig gradle gives the following error:

* What went wrong:
A problem occurred evaluating project ':tools:DebugInspector'.
> Could not set unknown property 'appVersion' for object of type de.fuerstenau.gradle.buildconfig.BuildConfigExtension.

If I try just version then it seems to work if set to a constant. Doesn't work when set project.version.

This is in a subproject build of multi-project gradle setup.

mfuerstenau commented 8 years ago

@raleighr3 You are right. Seems to be a documentation error on my part, it's version not appVersion as documented. Try

buildConfig {
   version = 'whatever you want'
}

also: if version is not set explicitely, it defaults to project.version. so

buildConfig {

}

would have the same effect as:

buildConfig {
   ...
   version = project.version
}
mfuerstenau commented 8 years ago

I corrected the README.md. I will close this issue. Feel free to reopen if there's still a problem.