Skip to content

Commit

Permalink
Merge pull request #24 from renatoathaydes/master
Browse files Browse the repository at this point in the history
Added publishing information to Gradle file.
  • Loading branch information
romankh3 committed Oct 8, 2018
2 parents d191555 + 230a481 commit f2ca4df
Showing 1 changed file with 93 additions and 3 deletions.
96 changes: 93 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ plugins {
id 'java'
id 'application'
id 'com.github.kt3k.coveralls' version '2.6.3'
id 'maven'
id "com.jfrog.bintray" version "1.8.4"
}

group 'image-comparison'
version '1.0-SNAPSHOT'
group 'com.github.romankh3'
version '1.0'
description 'A library and utility to compare different images.'
sourceCompatibility = 1.8

mainClassName = "ua.comparison.image.ImageComparison"
Expand All @@ -21,7 +24,10 @@ dependencies {

jar {
manifest {
attributes 'Main-Class': mainClassName
attributes 'Main-Class': mainClassName,
"Implementation-Title": "image-comparison",
"Implementation-Version": version,
"Automatic-Module-Name": 'com.github.romankh3.image.comparison'
}
}

Expand All @@ -34,3 +40,87 @@ jacocoTestReport {

defaultTasks << 'clean'
defaultTasks << 'build'

/* Publishing config */

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

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

artifacts {
archives javadocJar, sourcesJar
}

// add all the info required by Maven Central to the pom
configure( install.repositories.mavenInstaller ) {
pom.project {
inceptionYear '2018'
name project.name
packaging 'jar'
description project.description

url 'https://github.com/romankh3/image-comparison'

scm {
connection 'git@github.com:romankh3/image-comparison.git'
developerConnection 'git@github.com:romankh3/image-comparison.git'
url 'https://github.com/romankh3/image-comparison'
}

licenses {
license {
name 'The Unlicense'
url 'http://unlicense.org/'
}
}

developers {
developer {
id 'romankh3'
name 'Roman Beskrovnyi'
email 'roman.beskrovnyy@gmail.com'
}
}
}
}

def getProjectProperty = { String propertyName ->
project.properties[ propertyName ]
}

bintray {
user = getProjectProperty "bintrayUserName"
key = getProjectProperty "bintrayApiKey"
configurations = [ 'archives' ]
publish = true
pkg {
repo = 'maven'
name = 'image-comparison'
licenses = [ 'unlicense' ]
labels = [ 'java', 'image', 'image-comparison' ]
publicDownloadNumbers = true

//noinspection GroovyAssignabilityCheck
version {
name = project.version
vcsTag = project.version
gpg {
sign = true
}
mavenCentralSync {
sync = true
user = getProjectProperty 'ossrhUsername'
password = getProjectProperty 'ossrhPassword'
close = '1' // '0' to NOT close
}
}
}
}

bintrayUpload.dependsOn build, sourcesJar

0 comments on commit f2ca4df

Please sign in to comment.