https://github.com/web3j/quorum
Raw File
Tip revision: 3b50f122957925416008008ace72d5e5b486777d authored by Sam Nazha on 19 November 2018, 08:21:19 UTC
Changing the version of web3j
Tip revision: 3b50f12
build.gradle
buildscript {
    ext.kotlin_version = '1.2.71'
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.5.3'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

plugins {
    id "com.jfrog.bintray" version "1.7.3"
}

apply plugin: 'java'
apply plugin: 'kotlin'
// Required for JFrog Artifactory repository
apply plugin: 'jacoco'
apply plugin: 'maven-publish'

// Required for Maven Nexus repository
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'idea'
apply plugin: 'io.codearte.nexus-staging'

sourceCompatibility = 1.8

jacoco {
    toolVersion = '0.7.7.201606060606' // See http://www.eclemma.org/jacoco/.
}

jacocoTestReport {
    reports {
        xml.enabled true
    }
}

ext {
    ossrhUsername = project.hasProperty('ossrhUsername') ? project.property('ossrhUsername') : System.getenv('OSSRH_USERNAME')
    ossrhPassword = project.hasProperty('ossrhPassword') ? project.property('ossrhPassword') : System.getenv('OSSRH_PASSWORD')
    ossrhRepoUrl = project.hasProperty('ossrhRepoUrl') ? project.property('ossrhRepoUrl') : System.getenv('OSSRH_REPO_URL')
    bintrayUser = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
    bintrayKey = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
    isSnapshotVersion = project.version.endsWith("-SNAPSHOT")

    web3jVersion = '4.0.1'
    junitVersion = '4.11'
    logbackVersion = '1.2.3'
    mockitoVersion = '1.10.19'
}


repositories {
    mavenCentral()
}

dependencies {
    compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version",
            "com.fasterxml.jackson.module:jackson-module-kotlin:2.9.0",
            "org.slf4j:slf4j-api:1.7.25",
            "org.web3j:core:$web3jVersion"
    testCompile 'junit:junit:4.12',
            "ch.qos.logback:logback-core:$logbackVersion",
            "ch.qos.logback:logback-classic:$logbackVersion",
            'org.mockito:mockito-core:1.10.19',
            "org.assertj:assertj-core:3.8.0",
            "org.web3j:core:$web3jVersion:tests"
}

tasks.withType(Test) {
    reports.html.destination = file("${reporting.baseDir}/${name}")
}

task javadocJar(type: Jar) {
    classifier = 'javadoc'
    from javadoc
}

task sourcesJar(type: Jar) {
    classifier = 'sources'
    from sourceSets.main.allSource
}

publishing {
    publications {
        mavenJava(MavenPublication) {
            from components.java

            artifact sourcesJar {
                classifier 'sources'
            }
        }
    }
}

bintray {
    user = bintrayUser
    key = bintrayKey
    publications = ['mavenJava']
    publish = true
    pkg {
        repo = 'maven'
        name = 'quorum'
        desc = 'web3j Quorum API'
        userOrg = 'web3j'
        licenses = ['Apache-2.0']
        issueTrackerUrl = 'https://github.com/web3j/quorum/issues'
        vcsUrl = 'https://github.com/web3j/quorum.git'
        websiteUrl = 'http://web3j.io'
        publicDownloadNumbers = true
    }
}

artifacts {
    archives sourcesJar, javadocJar
}

signing {
    required { gradle.taskGraph.hasTask('uploadArchives') }  // only execute as part of this task
    sign configurations.archives
}

uploadArchives {
    repositories {
        mavenDeployer {
            beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

            onlyIf {
                ossrhUsername != '' && ossrhPassword != '' && ossrhRepoUrl != ''
            }

            repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
                authentication(
                        userName: ossrhUsername,
                        password: ossrhPassword
                )
            }

            pom.project {
                name 'web3j'
                packaging 'jar'
                description 'web3j Quorum API'
                url 'http://web3j.org'

                scm {
                    connection 'scm:git:https://github.com/web3j/quorum.git'
                    url 'https://github.com/web3j/quorum.git'
                }

                licenses {
                    license {
                        name 'The Apache License, Version 2.0'
                        url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
                    }
                }

                developers {
                    developer {
                        id 'conor10'
                        name 'Conor Svensson'
                        email 'conor10@gmail.com'
                    }
                }
            }
        }
    }
}

task release {
    dependsOn 'clean'
    dependsOn 'build'
    dependsOn 'uploadArchives'
    dependsOn 'closeAndPromoteRepository'
    dependsOn 'bintrayUpload'

    tasks.findByName('build').mustRunAfter 'clean'

    tasks.findByName('uploadArchives').mustRunAfter 'build'
    tasks.findByName('closeAndPromoteRepository').mustRunAfter 'uploadArchives'

    tasks.findByName('bintrayUpload').mustRunAfter 'build'
}
compileKotlin {
    kotlinOptions {
        jvmTarget = "1.8"
    }
}
compileTestKotlin {
    kotlinOptions {
        jvmTarget = "1.8"
    }
}
back to top