|
| 1 | +// Run 'gradle checkUpdates' to find out which dependencies have newer versions |
| 2 | +plugins { |
| 3 | + id 'java-library' |
| 4 | + id 'net.ltgt.errorprone' version '1.3.0' |
| 5 | + id 'net.minecrell.licenser' version '0.4.1' |
| 6 | + id 'com.palantir.git-version' version '0.12.3' |
| 7 | + id 'maven-publish' |
| 8 | + id 'signing' |
| 9 | + id 'de.marcphilipp.nexus-publish' version '0.4.0' |
| 10 | + id 'name.remal.check-updates' version '1.2.2' |
| 11 | +} |
| 12 | + |
| 13 | +apply plugin: 'maven-publish' |
| 14 | +apply plugin: 'de.marcphilipp.nexus-publish' |
| 15 | +apply plugin: 'java' |
| 16 | + |
| 17 | +if (hasProperty('signing.keyId')) { |
| 18 | + apply plugin: 'signing' |
| 19 | + signing { |
| 20 | + sign configurations.archives |
| 21 | + } |
| 22 | +} |
| 23 | + |
| 24 | +group = 'io.temporal' |
| 25 | +version = getVersionName() |
| 26 | +archivesBaseName = "temporal-opentracing" |
| 27 | + |
| 28 | +description = '''Temporal Java SDK OpenTracing Support Module''' |
| 29 | + |
| 30 | +java { |
| 31 | + sourceCompatibility = JavaVersion.VERSION_1_8 |
| 32 | + targetCompatibility = JavaVersion.VERSION_1_8 |
| 33 | + withJavadocJar() |
| 34 | + withSourcesJar() |
| 35 | +} |
| 36 | + |
| 37 | +ext { |
| 38 | + opentracingVersion = '0.33.0' |
| 39 | +} |
| 40 | + |
| 41 | +dependencies { |
| 42 | + errorproneJavac('com.google.errorprone:javac:9+181-r4173-1') |
| 43 | + errorprone('com.google.errorprone:error_prone_core:2.5.1') |
| 44 | + |
| 45 | + api project(':temporal-sdk') |
| 46 | + api group: 'io.opentracing', name: 'opentracing-api', version: "$opentracingVersion" |
| 47 | + |
| 48 | + implementation group: 'com.google.guava', name: 'guava', version: '30.1.1-jre' |
| 49 | + implementation group: 'io.opentracing', name: 'opentracing-util', version: "$opentracingVersion" |
| 50 | + |
| 51 | + testImplementation project(":temporal-testing") |
| 52 | + testImplementation project(':temporal-testing-junit4') |
| 53 | + testImplementation group: 'junit', name: 'junit', version: '4.13.2' |
| 54 | + testImplementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3' |
| 55 | + testImplementation group: 'org.mockito', name: 'mockito-core', version: '3.8.0' |
| 56 | + testImplementation group: 'io.opentracing', name: 'opentracing-mock', version: "$opentracingVersion" |
| 57 | +} |
| 58 | + |
| 59 | +license { |
| 60 | + header rootProject.file('license-header.txt') |
| 61 | + exclude '**/*.puml' |
| 62 | +} |
| 63 | + |
| 64 | +compileJava { |
| 65 | + dependsOn 'googleJavaFormat' |
| 66 | + options.encoding = 'UTF-8' |
| 67 | + options.compilerArgs << '-Xlint:none' << '-Xlint:deprecation' << '-Werror' |
| 68 | +} |
| 69 | + |
| 70 | +compileTestJava { |
| 71 | + options.encoding = 'UTF-8' |
| 72 | + options.compilerArgs << '-Xlint:none' << '-Xlint:deprecation' << '-Werror' |
| 73 | +} |
| 74 | + |
| 75 | +if (JavaVersion.current().isJava8Compatible()) { |
| 76 | + allprojects { |
| 77 | + tasks.withType(Javadoc) { |
| 78 | + options.addStringOption('Xdoclint:none', '-quiet') |
| 79 | + } |
| 80 | + } |
| 81 | +} |
| 82 | + |
| 83 | +javadoc { |
| 84 | + options.encoding = 'UTF-8' |
| 85 | + if (JavaVersion.current().isJava9Compatible()) { |
| 86 | + options.addBooleanOption('html5', true) |
| 87 | + } |
| 88 | +} |
| 89 | + |
| 90 | +task sourceJar(type: Jar) { |
| 91 | + from sourceSets.main.allSource |
| 92 | + classifier "sources" |
| 93 | +} |
| 94 | + |
| 95 | +test { |
| 96 | + dependsOn 'checkLicenseMain' |
| 97 | + testLogging { |
| 98 | + events 'passed', 'skipped', 'failed' |
| 99 | + exceptionFormat 'full' |
| 100 | + // Uncomment the following line if you want to see test logs in gradlew run. |
| 101 | + showStandardStreams true |
| 102 | + } |
| 103 | + forkEvery = 1 |
| 104 | + maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1 |
| 105 | +} |
| 106 | + |
| 107 | +publishing { |
| 108 | + publications { |
| 109 | + mavenJava(MavenPublication) { |
| 110 | + from components.java |
| 111 | + versionMapping { |
| 112 | + usage('java-api') { |
| 113 | + fromResolutionOf('runtimeClasspath') |
| 114 | + } |
| 115 | + usage('java-runtime') { |
| 116 | + fromResolutionResult() |
| 117 | + } |
| 118 | + } |
| 119 | + pom { |
| 120 | + name = 'Temporal Java SDK OpenTracing Support Module' |
| 121 | + packaging = 'jar' |
| 122 | + // optionally artifactId can be defined here |
| 123 | + description = 'Contains a set of classes that adds OpenTracing support to Temporal' |
| 124 | + url = 'https://github.com/temporalio/temporal-java-sdk' |
| 125 | + |
| 126 | + scm { |
| 127 | + connection = 'scm:[email protected]:temporalio/temporal-java-sdk.git' |
| 128 | + developerConnection = 'scm:[email protected]:temporalio/temporal-java-sdk.git' |
| 129 | + url = 'https://github.com/temporalio/temporal-java-sdk.git' |
| 130 | + } |
| 131 | + |
| 132 | + licenses { |
| 133 | + license { |
| 134 | + name = 'The Apache License, Version 2.0' |
| 135 | + url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' |
| 136 | + } |
| 137 | + } |
| 138 | + |
| 139 | + developers { |
| 140 | + developer { |
| 141 | + id = 'mfateev' |
| 142 | + name = 'Maxim Fateev' |
| 143 | + |
| 144 | + } |
| 145 | + developer { |
| 146 | + id = 'samarabbas' |
| 147 | + name = 'Samar Abbas' |
| 148 | + |
| 149 | + } |
| 150 | + } |
| 151 | + } |
| 152 | + } |
| 153 | + |
| 154 | + } |
| 155 | + |
| 156 | + signing { |
| 157 | + sign publishing.publications.mavenJava |
| 158 | + } |
| 159 | + |
| 160 | + // Uncomment to test local publishing and comment nexusPublishing |
| 161 | +// repositories { |
| 162 | +// maven { |
| 163 | +// def releasesRepoUrl = "$System.env.HOME/repos/releases" |
| 164 | +// def snapshotsRepoUrl = "$System.env.HOME/repos/snapshots" |
| 165 | +// url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl |
| 166 | +// } |
| 167 | +// } |
| 168 | + |
| 169 | +} |
| 170 | + |
| 171 | +nexusPublishing { |
| 172 | + repositories { |
| 173 | + sonatype { |
| 174 | + username = project.hasProperty('ossrhUsername') ? project.property('ossrhUsername') : '' |
| 175 | + password = project.hasProperty('ossrhPassword') ? project.property('ossrhPassword') : '' |
| 176 | + } |
| 177 | + } |
| 178 | +} |
0 commit comments