|
| 1 | +plugins { |
| 2 | + id "java" |
| 3 | + id "maven-publish" |
| 4 | + id "eclipse" |
| 5 | + id "org.dm.bundle" version "0.8.2" |
| 6 | + id "nebula.provided-base" version "2.2.2" |
| 7 | + id "com.jfrog.bintray" version "1.6" |
| 8 | +} |
| 9 | + |
| 10 | +group = "com.github.davidb" |
| 11 | +def description = "A reporter for metrics which announces measurements to an InfluxDB server." |
| 12 | +version = "git describe --always --dirty".execute().text.trim() |
| 13 | +println("version : '${version}'") |
| 14 | + |
| 15 | +repositories { |
| 16 | + jcenter() |
| 17 | +} |
| 18 | + |
| 19 | +dependencies { |
| 20 | + compile 'io.dropwizard.metrics:metrics-core:3.1.2' |
| 21 | + compile 'org.slf4j:slf4j-api:1.7.7' |
| 22 | + |
| 23 | + testCompile 'junit:junit:4.12' |
| 24 | + testCompile 'org.hamcrest:hamcrest-all:1.3' |
| 25 | + testCompile 'org.easytesting:fest-assert-core:2.0M10' |
| 26 | + testCompile 'org.mockito:mockito-all:1.9.5' |
| 27 | + testCompile 'org.slf4j:slf4j-simple:1.7.7' |
| 28 | +} |
| 29 | + |
| 30 | +sourceCompatibility = JavaVersion.VERSION_1_8 |
| 31 | +targetCompatibility = JavaVersion.VERSION_1_8 |
| 32 | +[compileJava, compileTestJava]*.options*.encoding = 'UTF-8' |
| 33 | + |
| 34 | +task sourcesJar(type: Jar) { |
| 35 | + from sourceSets.main.allSource |
| 36 | + classifier = 'sources' |
| 37 | +} |
| 38 | + |
| 39 | +def pomConfig = { |
| 40 | + url "https://github.com/davidB/${project.name}" |
| 41 | + inceptionYear "2016" |
| 42 | + licenses { |
| 43 | + license { |
| 44 | + name "Public domain (CC0-1.0)" |
| 45 | + url "http://creativecommons.org/publicdomain/zero/1.0/" |
| 46 | + distribution "repo" |
| 47 | + } |
| 48 | + } |
| 49 | + developers { |
| 50 | + developer { |
| 51 | + id "davidB" |
| 52 | + name "David Bernard" |
| 53 | + } |
| 54 | + developer { |
| 55 | + id "McFoggy" |
| 56 | + name "Matthieu Brouillard" |
| 57 | + |
| 58 | + } |
| 59 | + } |
| 60 | +} |
| 61 | + |
| 62 | +publishing { |
| 63 | + publications { |
| 64 | + mavenStuff(MavenPublication) { |
| 65 | + from components.java |
| 66 | + artifact sourcesJar |
| 67 | + pom.withXml { |
| 68 | + def root = asNode() |
| 69 | + root.appendNode('description', description) |
| 70 | + root.children().last() + pomConfig |
| 71 | + } |
| 72 | + } |
| 73 | + } |
| 74 | +} |
| 75 | +bintray { |
| 76 | + user = bintray_user |
| 77 | + key = bintray_api_key |
| 78 | + |
| 79 | + publications = ['mavenStuff'] //When uploading Maven-based publication files |
| 80 | + //dryRun = false //Whether to run this as dry-run, without deploying |
| 81 | + publish = true //If version should be auto published after an upload |
| 82 | + pkg { |
| 83 | + repo = 'maven' |
| 84 | + name = project.name |
| 85 | + desc = description |
| 86 | + websiteUrl = "https://github.com/davidB/${project.name}" |
| 87 | + issueTrackerUrl = "https://github.com/davidB/${project.name}/issues" |
| 88 | + vcsUrl = "https://github.com/davidB/${project.name}.git" |
| 89 | + licenses = ['CC0-1.0'] |
| 90 | + publicDownloadNumbers = true |
| 91 | + version { |
| 92 | + name = project.version |
| 93 | + vcsTag = project.version |
| 94 | + //attributes = [] |
| 95 | + //gpg { |
| 96 | + // sign = true //Determines whether to GPG sign the files. The default is false |
| 97 | + // passphrase = 'optional, the passphrase for GPG signing' |
| 98 | + //} |
| 99 | + } |
| 100 | + } |
| 101 | +} |
| 102 | + |
0 commit comments