bintray / gradle-bintray-plugin

Apache License 2.0
1.28k stars 194 forks source link

bintrayUpload: pkg optional attributes ignored #207

Open leinardi opened 6 years ago

leinardi commented 6 years ago

I'm currently settings several optional pkg attributes but it seems that they are ignored when I run the bintrayUpload task.

This is my current bintray script:

def mvn_config = [:]
mvn_config.repository = 'androidthings'
mvn_config.group_id = 'com.leinardi.android.things'
mvn_config.artifact_id = 'driver-hd44780'
mvn_config.version = '0.2'
mvn_config.licenses = 'Apache-2.0' // Comma separated
mvn_config.website = 'https://github.com/leinardi/androidthings-drivers'
mvn_config.issue_tracker_url = 'https://github.com/leinardi/androidthings-drivers/issues'
mvn_config.vcs_url = 'https://github.com/leinardi/androidthings-drivers.git'
mvn_config.description = 'HD44780 LCD driver for Android Things'
mvn_config.tags = 'pcf8574,hd44780,android-things,android,raspberry-pi' // Comma separated
mvn_config.inception_year = '2017'
mvn_config.dryRun = false
mvn_config.publish = false
mvn_config.override = true

ext.mvn_config = mvn_config

apply from: rootProject.file('maven.gradle')
apply from: rootProject.file('bintray.gradle')
apply plugin: 'com.jfrog.bintray'

group mvn_config.group_id
version mvn_config.version

bintray {
    user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
    key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')

    configurations = ['archives']
    dryRun = mvn_config.dryRun //[Default: false] Whether to run this as dry-run, without deploying
    publish = mvn_config.publish //[Default: false] Whether version should be auto published after an upload
    override = mvn_config.override //[Default: false] Whether to override version artifacts already published

    pkg {
        repo = mvn_config.repository
        name = mvn_config.artifact_id
        userOrg = user
        licenses = mvn_config.licenses.split(',')
        websiteUrl = mvn_config.website
        issueTrackerUrl = mvn_config.issue_tracker_url
        vcsUrl = mvn_config.vcs_url
        labels = mvn_config.tags.split(',')
        version {
            name = mvn_config.version
            desc = mvn_config.description
        }
    }
}

It seems that in the source code the attributes are still read: https://github.com/bintray/gradle-bintray-plugin/blob/420e37225e4fba865bcb24741494c98d1f1dd6f6/src/main/groovy/com/jfrog/bintray/gradle/BintrayPlugin.groovy#L46

but most of the those fields are empty when the bintrayUpload task finishes (eg: websiteUrl, issueTrackerUrl, vcsUrl, labels, desc).

leinardi commented 6 years ago

I just noticed that the values are ignored only if the package already exist on bintray when I trigger the task. If the task is also creating the package than the values are correctly set.

I still think this is an issue and the values should always be updated by the task, no matter if the package was already present on bintray or not.