|
| 1 | +plugins { |
| 2 | + id 'java' |
| 3 | + id 'eclipse' |
| 4 | + id 'maven' |
| 5 | + id 'signing' |
| 6 | +} |
| 7 | + |
| 8 | +task wrapper(type: Wrapper) { |
| 9 | + gradleVersion = '3.0' |
| 10 | +} |
| 11 | + |
| 12 | +// The project version is controlled externally by the "version.sh" script. |
| 13 | +def getVersion = { -> |
| 14 | + def stdout = new ByteArrayOutputStream() |
| 15 | + exec { |
| 16 | + commandLine 'bash', 'version.sh' |
| 17 | + standardOutput = stdout |
| 18 | + } |
| 19 | + return stdout.toString().trim() |
| 20 | +} |
| 21 | + |
| 22 | +group = 'com.cinchapi' |
| 23 | +version = getVersion() |
| 24 | +// Drop the build component from version number and use that for |
| 25 | +// publishing |
| 26 | +ext.mavenVersion = version.split('\\.') |
| 27 | +ext.mavenVersion[3] = ext.mavenVersion[3].replaceAll("[0-9]+-", "-") |
| 28 | +ext.mavenVersion[3] = ext.mavenVersion[3].replaceAll("[0-9]+", "").trim() |
| 29 | +ext.mavenVersion = ext.mavenVersion.join(".").replace(".-", "-").replaceAll('\\.$', "") |
| 30 | + |
| 31 | +jar { |
| 32 | + manifest { |
| 33 | + attributes("Specificiation-Title": "Bucket", "Specificiation-Version": version, "Implementation-Version": version) |
| 34 | + } |
| 35 | +} |
| 36 | + |
| 37 | +task sourcesJar(type: Jar, dependsOn: classes) { |
| 38 | + classifier = 'sources' |
| 39 | + from sourceSets.main.allSource |
| 40 | +} |
| 41 | + |
| 42 | +task javadocJar(type: Jar, dependsOn: javadoc) { |
| 43 | + classifier = 'javadoc' |
| 44 | + from javadoc.destinationDir |
| 45 | +} |
| 46 | + |
| 47 | +artifacts { |
| 48 | + archives sourcesJar |
| 49 | + archives javadocJar |
| 50 | +} |
| 51 | + |
| 52 | +// Set the version for all Concourse dependencies |
| 53 | +ext.concourseVersion = '0.7.0-SNAPSHOT' |
| 54 | + |
| 55 | +repositories { |
| 56 | + mavenCentral() |
| 57 | + maven { |
| 58 | + url 'https://oss.sonatype.org/content/repositories/snapshots/' |
| 59 | + } |
| 60 | + maven { |
| 61 | + url 'http://cinchapi.bintray.com/maven' |
| 62 | + } |
| 63 | + maven { |
| 64 | + url 'http://cinchapi.bintray.com/maven-snapshots' |
| 65 | + } |
| 66 | + maven { |
| 67 | + url "http://dl.bintray.com/steppschuh/Markdown-Generator" |
| 68 | + } |
| 69 | +} |
| 70 | + |
| 71 | +dependencies { |
| 72 | + compile group: 'com.cinchapi', name: 'accent4j', version: '1.0.0-SNAPSHOT', changing:true |
| 73 | + compile group: 'com.cinchapi', name: 'concourse-driver-java', version: concourseVersion, changing:true // needed for util classes... |
| 74 | + compile group: 'com.google.code.findbugs', name: 'jsr305', version:'2.0.1' |
| 75 | + compile group: 'com.google.guava', name:'guava', version:'21.0' |
| 76 | + testCompile 'junit:junit:4.11' |
| 77 | +} |
| 78 | + |
| 79 | +test { |
| 80 | + testLogging { |
| 81 | + showStandardStreams = true |
| 82 | + } |
| 83 | +} |
| 84 | + |
| 85 | +uploadArchives { |
| 86 | + repositories { |
| 87 | + mavenDeployer { |
| 88 | + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } |
| 89 | + |
| 90 | + // Drop the build component from version number and use that in the |
| 91 | + // POM file |
| 92 | + def _version = project.version.split('\\.') |
| 93 | + _version[3] = _version[3].replaceAll("[0-9]+-", "-") |
| 94 | + _version[3] = _version[3].replaceAll("[0-9]+", "").trim() |
| 95 | + _version = _version.join(".").replace(".-", "-").replaceAll('\\.$', "") |
| 96 | + pom.version = _version |
| 97 | + |
| 98 | + pom.project { |
| 99 | + name 'Data Transform API' |
| 100 | + packaging 'jar' |
| 101 | + description 'A common API for data transformation.' |
| 102 | + url 'http://cinchapi.com' |
| 103 | + |
| 104 | + scm { |
| 105 | + url '[email protected]:cinchapi/data-transform-api.git' |
| 106 | + connection '[email protected]:cinchapi/data-transform-api.git' |
| 107 | + developerConnection '[email protected]:cinchapi/data-transform-api.git' |
| 108 | + } |
| 109 | + |
| 110 | + licenses { |
| 111 | + license { |
| 112 | + name 'The Apache License' |
| 113 | + url 'http://opensource.org/licenses/Apache-2.0' |
| 114 | + distribution 'repo' |
| 115 | + } |
| 116 | + } |
| 117 | + |
| 118 | + developers { |
| 119 | + developer { |
| 120 | + id 'jnelson' |
| 121 | + name 'Jeff Nelson' |
| 122 | + } |
| 123 | + } |
| 124 | + } |
| 125 | + |
| 126 | + def mavenUrl = pom.version.matches('^[0-9]+\\.[0-9]+\\.[0-9]+(-rc[0-9]+){0,1}$') ? 'https://oss.sonatype.org/service/local/staging/deploy/maven2' : 'https://oss.sonatype.org/content/repositories/snapshots' |
| 127 | + repository(url: mavenUrl) { |
| 128 | + authentication(userName: sonatypeUsername, password: sonatypePassword) |
| 129 | + } |
| 130 | + } |
| 131 | + } |
| 132 | +} |
0 commit comments