brunocvcunha/instagram4j

View on GitHub
build.gradle

Summary

Maintainability
Test Coverage
plugins {
    id 'java-library'
    id 'io.freefair.lombok' version '5.1.0'
    id 'maven-publish'
    id 'signing'
    id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
    id 'net.nemerosa.versioning' version '2.8.2'
}

group = 'com.github.instagram4j'
archivesBaseName = 'instagram4j'
// For release
// Must be on release/<version> branch
// Release: ./gradlew publishToSonatype closeSonatypeStagingRepository --console=plain
version = "${versioning.info.branchType.equals('release') ? versioning.info.display : versioning.info.full}"

java {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
}

repositories {
    jcenter()
}

dependencies {
    // OkHttp
    api 'com.squareup.okhttp3:okhttp:4.7.2'
    api 'com.squareup.okhttp3:okhttp-urlconnection:4.7.2'
    // jackson data-bind
    api 'com.fasterxml.jackson.core:jackson-databind:2.11.0'
    api 'com.fasterxml.jackson.core:jackson-annotations:2.11.0'
    api 'org.slf4j:slf4j-api:1.7.30'
    // Test utilities
    testImplementation 'org.slf4j:slf4j-log4j12:1.7.30'
    testImplementation 'com.squareup.okhttp3:logging-interceptor:4.7.2'
    testImplementation 'log4j:log4j:1.2.17'
    testImplementation 'junit:junit:4.12'
    testImplementation 'pl.pragmatists:JUnitParams:1.1.1'
}

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

javadoc.failOnError = false
task javadocJar(type: Jar, dependsOn: javadoc) {
    classifier = 'javadoc'
    from javadoc.destinationDir
}

publishing {
    publications {
        mavenPublish(MavenPublication) {
            from components.java
            artifact sourcesJar {
                classifier "sources"
            }
            artifact javadocJar {
                classifier "javadoc"
            }
            groupId group
            artifactId archivesBaseName
            version version
            pom {
                name = "instagram4j"
                description = "Java HTTP Client for Instagram"
                url = "https://github.com/instagram4j/instagram4j"
                licenses {
                    license {
                        name = "The Apache License, Version 2.0"
                        url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
                    }
                }
                developers {
                    developer {
                        id = "instagram4j"
                        name = "instagram4j"
                        email = "instagram4j@github.com"
                    }
                }
                scm {
                    connection = "scm:git:git://github.com/instagram4j/instagram4j.git"
                    developerConnection = "scm:git:ssh://github.com:instagram4j/instagram4j.git"
                    url = "https://github.com/instagram4j/instagram4j/tree/master"
                }
            }
        }
    }
}

signing {
    sign publishing.publications.mavenPublish
}

nexusPublishing {
    repositories {
        sonatype()
    }
}