|
| 1 | +plugins { |
| 2 | + id 'ru.vyarus.animalsniffer' version '1.2.0' |
| 3 | + id 'net.saliman.cobertura' version '2.3.2' |
| 4 | +} |
1 | 5 | apply plugin: 'java' |
2 | | -apply plugin: 'maven' |
3 | | -apply plugin: 'eclipse' |
4 | | -apply plugin: 'idea' |
5 | 6 |
|
6 | | -sourceCompatibility = 1.7 |
7 | | -targetCompatibility = 1.7 |
8 | | -group = 'com.ibm.watson.developercloud' |
9 | | -archivesBaseName = 'watson-developer-cloud' |
10 | | -version = '3.5.2' |
| 7 | +import org.apache.tools.ant.filters.* |
| 8 | + |
| 9 | +archivesBaseName = 'java-sdk' |
| 10 | + |
11 | 11 |
|
12 | 12 | description = 'Client library to use the IBM Watson and Alchemy Services' |
13 | 13 |
|
14 | | -repositories { |
15 | | - mavenCentral() |
| 14 | +task docs(type: Javadoc) { |
| 15 | + destinationDir = file("$buildDir/docs/all") |
| 16 | +} |
| 17 | + |
| 18 | + |
| 19 | +def getDate() { |
| 20 | + def date = new Date() |
| 21 | + def formattedDate = date.format('yyyyMMddHHmmss') |
| 22 | + return formattedDate |
16 | 23 | } |
17 | | -dependencies { |
18 | | - compile group: 'com.squareup.okhttp3', name: 'okhttp', version:'3.3.1' |
19 | | - compile group: 'com.squareup.okhttp3', name: 'okhttp-ws', version:'3.3.1' |
20 | | - compile group: 'com.squareup.okhttp3', name: 'logging-interceptor', version:'3.3.1' |
21 | | - compile group: 'com.squareup.okhttp3', name: 'okhttp-urlconnection', version:'3.3.1' |
22 | | - compile group: 'com.google.code.gson', name: 'gson', version:'2.6.2' |
23 | | - compile group: 'org.apache.commons', name: 'commons-lang3', version:'3.4' |
24 | | - compile group: 'org.glassfish.jersey.bundles.repackaged', name: 'jersey-jsr166e', version:'2.22.2' |
25 | | - testCompile group: 'com.squareup.okhttp3', name: 'mockwebserver', version:'3.3.1' |
26 | | - testCompile group: 'ch.qos.logback', name: 'logback-classic', version:'1.1.7' |
27 | | - testCompile group: 'com.google.guava', name: 'guava', version:'19.0' |
28 | | - testCompile group: 'junit', name: 'junit-dep', version:'4.11' |
29 | | -} |
30 | | - |
31 | | -task sourcesJar(type: Jar) { |
| 24 | + |
| 25 | +subprojects { |
| 26 | + afterEvaluate { |
| 27 | + if (plugins.hasPlugin(JavaPlugin)) { |
| 28 | + rootProject.tasks.docs { |
| 29 | + source += files(sourceSets.collect { srcSet -> srcSet.allJava }) |
| 30 | + classpath += files(sourceSets*.compileClasspath) |
| 31 | + } |
| 32 | + } |
| 33 | + } |
| 34 | +} |
| 35 | + |
| 36 | +allprojects { |
| 37 | + apply plugin: 'ru.vyarus.animalsniffer' |
| 38 | + apply plugin: 'net.saliman.cobertura' |
| 39 | + apply plugin: 'java' |
| 40 | + apply plugin: 'maven' |
| 41 | + apply plugin: 'checkstyle' |
| 42 | + |
| 43 | + version = '3.5.2-SNAPSHOT' |
| 44 | + group = 'com.ibm.watson.developercloud' |
| 45 | + |
| 46 | + task sourcesJar(type: Jar) { |
32 | 47 | classifier = 'sources' |
33 | 48 | from sourceSets.main.allSource |
34 | | -} |
| 49 | + } |
35 | 50 |
|
36 | | -artifacts { |
| 51 | + task javadocJar(type: Jar, dependsOn: javadoc) { |
| 52 | + classifier = 'javadoc' |
| 53 | + from javadoc.destinationDir |
| 54 | + } |
| 55 | + |
| 56 | + repositories { |
| 57 | + mavenCentral() |
| 58 | + } |
| 59 | + |
| 60 | + artifacts { |
37 | 61 | archives sourcesJar |
| 62 | + archives javadocJar |
| 63 | + } |
| 64 | + |
| 65 | + checkstyle { |
| 66 | + configFile = rootProject.file('checkstyle.xml') |
| 67 | + } |
| 68 | + |
| 69 | + dependencies { |
| 70 | + testCompile group: 'com.squareup.okhttp3', name: 'mockwebserver', version: '3.3.1' |
| 71 | + testCompile group: 'ch.qos.logback', name: 'logback-classic', version: '1.1.7' |
| 72 | + testCompile group: 'com.google.guava', name: 'guava', version: '19.0' |
| 73 | + testCompile group: 'junit', name: 'junit-dep', version: '4.11' |
| 74 | + signature 'org.codehaus.mojo.signature:java17:1.0@signature' |
| 75 | + } |
| 76 | + |
| 77 | + processResources { |
| 78 | + filter ReplaceTokens, tokens: [ |
| 79 | + "pom.version": project.version, |
| 80 | + "build.date" : getDate() |
| 81 | + ] |
| 82 | + } |
| 83 | + |
| 84 | + uploadArchives { |
| 85 | + repositories.mavenDeployer { |
| 86 | + repository(url: "http://oss.sonatype.org/service/local/staging/deploy/maven2/") { |
| 87 | + authentication(userName: System.env.CI_DEPLOY_USERNAME, password: System.env.CI_DEPLOY_PASSWORD) |
| 88 | + } |
| 89 | + snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/"){ |
| 90 | + authentication(userName: System.env.CI_DEPLOY_USERNAME, password: System.env.CI_DEPLOY_PASSWORD) |
| 91 | + } |
| 92 | + } |
| 93 | + } |
| 94 | + |
| 95 | + cobertura { |
| 96 | + coverageFormats = ['html', 'xml'] |
| 97 | + coverageIgnoreTrivial = true |
| 98 | + coverageIgnores = ['org.slf4j.Logger.*'] |
| 99 | + coverageReportDir = new File("$buildDir/reports/cobertura") |
| 100 | + } |
| 101 | +} |
| 102 | + |
| 103 | + |
| 104 | +configure(subprojects - project(':core')) { |
| 105 | + dependencies { |
| 106 | + compile project(':core') |
| 107 | + testCompile project(path: ':core', configuration: 'tests') |
| 108 | + } |
| 109 | +} |
| 110 | + |
| 111 | +project(':core') { |
| 112 | + |
| 113 | + task testJar(type: Jar) { |
| 114 | + classifier = 'tests' |
| 115 | + from sourceSets.test.output |
| 116 | + } |
| 117 | + |
| 118 | + configurations { |
| 119 | + tests |
| 120 | + } |
| 121 | + |
| 122 | + artifacts { |
| 123 | + tests testJar |
| 124 | + } |
| 125 | + |
| 126 | + dependencies { |
| 127 | + compile group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.3.1' |
| 128 | + compile group: 'com.squareup.okhttp3', name: 'okhttp-ws', version: '3.3.1' |
| 129 | + compile group: 'com.squareup.okhttp3', name: 'logging-interceptor', version: '3.3.1' |
| 130 | + compile group: 'com.squareup.okhttp3', name: 'okhttp-urlconnection', version: '3.3.1' |
| 131 | + compile group: 'com.google.code.gson', name: 'gson', version: '2.6.2' |
| 132 | + compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.4' |
| 133 | + compile group: 'org.glassfish.jersey.bundles.repackaged', name: 'jersey-jsr166e', version: '2.22.2' |
| 134 | + |
| 135 | + } |
| 136 | +} |
| 137 | + |
| 138 | +project(':dialog') { |
| 139 | + dependencies { |
| 140 | + compile project(':core') |
| 141 | + compile project(':conversation') |
| 142 | + } |
38 | 143 | } |
| 144 | + |
| 145 | +project(':tests') { |
| 146 | + dependencies { |
| 147 | + testCompile project(':core') |
| 148 | + testCompile project(':natural-language-classifier') |
| 149 | + testCompile project(':alchemy') |
| 150 | + testCompile project(':android-utils') |
| 151 | + testCompile project(':conversation') |
| 152 | + testCompile project(':dialog') |
| 153 | + testCompile project(':document-conversion') |
| 154 | + testCompile project(':language-translation') |
| 155 | + testCompile project(':language-translator') |
| 156 | + testCompile project(':personality-insights') |
| 157 | + testCompile project(':retrieve-and-rank') |
| 158 | + testCompile project(':speech-to-text') |
| 159 | + testCompile project(':text-to-speech') |
| 160 | + testCompile project(':tone-analyzer') |
| 161 | + testCompile project(':tradeoff-analytics') |
| 162 | + testCompile project(':visual-recognition') |
| 163 | + |
| 164 | + testCompile group: 'com.squareup.okhttp3', name: 'mockwebserver', version: '3.3.1' |
| 165 | + testCompile group: 'ch.qos.logback', name: 'logback-classic', version: '1.1.7' |
| 166 | + testCompile group: 'com.google.guava', name: 'guava', version: '19.0' |
| 167 | + testCompile group: 'junit', name: 'junit-dep', version: '4.11' |
| 168 | + } |
| 169 | +} |
| 170 | + |
| 171 | +configure(rootProject) { |
| 172 | + dependencies { |
| 173 | + compile project(':natural-language-classifier') |
| 174 | + compile project(':alchemy') |
| 175 | + compile project(':android-utils') |
| 176 | + compile project(':conversation') |
| 177 | + compile project(':dialog') |
| 178 | + compile project(':document-conversion') |
| 179 | + compile project(':language-translation') |
| 180 | + compile project(':language-translator') |
| 181 | + compile project(':personality-insights') |
| 182 | + compile project(':retrieve-and-rank') |
| 183 | + compile project(':speech-to-text') |
| 184 | + compile project(':text-to-speech') |
| 185 | + compile project(':tone-analyzer') |
| 186 | + compile project(':tradeoff-analytics') |
| 187 | + compile project(':visual-recognition') |
| 188 | + } |
| 189 | +} |