Open johnjohndoe opened 8 years ago
I managed to release the library by temporarily replacing:
licenses = project.packageLicenses
with
licenses = ['Apache-2.0']
Note that I use gradle.properties to maintain these values in one place. Please check if this behavior is reproducible bug.
Hey @johnjohndoe , Please let me know if this makes sense: The licenses value is a list. For example, ['Apache-2.0'] is a list with one element. Could it be that the property you're reading from gradle.properties is a string and that's what causes the issue? If so, you can try to do something like this:
def configuredLicenses = [lic1, lic2, lic3]
while saving lic1, lic2 and lic3 as 3 different properties in your gradle.properties
My gradle.properties contains the following definition:
packageLicenses=['Apache-2.0']
Do you know if a properties file can actually deal with other then strings?
I'm not aware of any Gradle or Groovy implementation that does that, but you can probably create your own simple implementation that takes a property string value, splits it according to a delimiter and returns a list.
So, if I understand correctly this is kind of an issue then with the plugin since most developers will not hard code settings within the deployment script but instead use a separate file such as gradle.properties. How do we deal with this in a smart way?
As always, we welcome ideas, suggestions and code contributions from the community.
First of all, you should throw an exception when you detect an invalid property value such as an Array. This error message should clearly state the problem (which is not the case in the error message in my initial post) so that developers know how to deal with it. As a follow up one might come up with a handy solution for defining an Array value in a properties file.
The gradle.properties file is a regular Java properties file and as such it cannot hold keys with multiple values. A simple solution would be having a comma delimited string in the properties file, for example:
licenses=Apache-2.0,BSD
And splitting this value in build.gradle to create an array
licenses = project.property('licenses').split(',')
I am trying to release the 1st version of the Overpass Java library I wrote. The release configuration can be found on this temporary branch. When I run
./gradlew bintrayUpload
this fails with following error:I don't really understand the error message. Here is what I get when I run
./gradlew bintrayUpload --debug
:Can I actually create the first release just via the plugin or do I have to manually do something on the Bintray website before? Please have look at my deployment configuration to spot errors.