1- apply plugin : ' java'
1+ plugins {
2+ id ' java-library'
3+ id ' maven-publish'
4+ id ' signing'
5+ }
26
37group = ' com.mparticle'
4- version = ' 2.7.0'
5-
6- apply from : ' .scripts/maven.gradle'
7-
8- buildscript {
9- repositories {
10- mavenCentral()
11- }
12- }
8+ version = project. hasProperty(' VERSION' ) ? project. property(' VERSION' ) : file(' VERSION' ). text. trim()
139
1410repositories {
1511 mavenCentral()
@@ -18,26 +14,15 @@ repositories {
1814sourceCompatibility = JavaVersion . VERSION_1_8
1915targetCompatibility = JavaVersion . VERSION_1_8
2016
21- task sdkJavadocs (type : Javadoc ) {
22- source = sourceSets. main. allJava
23- title = ' mParticle Server Events SDK API Reference'
24- failOnError false
25- getOptions(). setNoTimestamp(true )
17+ java {
18+ withSourcesJar()
19+ withJavadocJar()
2620}
2721
28- task javadocsJar (type : Jar , dependsOn : sdkJavadocs) {
29- classifier = ' javadoc'
30- from javadoc. destinationDir
31- }
32-
33- task sourcesJar (type : Jar ) {
34- classifier = ' sources'
35- from sourceSets. main. allJava
36- }
37-
38- artifacts {
39- archives sourcesJar
40- archives javadocsJar
22+ javadoc {
23+ title = ' mParticle Server Events SDK API Reference'
24+ options. noTimestamp = true
25+ failOnError = false
4126}
4227
4328ext {
@@ -53,15 +38,66 @@ ext {
5338}
5439
5540dependencies {
56- compile " com.squareup.retrofit2:retrofit:$retrofit_version "
57- compile " com.squareup.retrofit2:converter-scalars:$retrofit_version "
58- compile " com.squareup.retrofit2:converter-gson:$retrofit_version "
59- compile " io.swagger:swagger-annotations:$swagger_annotations_version "
60- compile " com.google.code.findbugs:jsr305:3.0.2"
61- compile " io.gsonfire:gson-fire:$json_fire_version "
62- compile " org.threeten:threetenbp:$threetenbp_version "
63- testCompile " junit:junit:$junit_version "
64- testCompile " ch.qos.logback:logback-core:$slf4j_core_version "
65- testCompile " ch.qos.logback:logback-classic:$slf4j_classic_version "
66- testCompile " org.slf4j:slf4j-api:$slf4j_version "
41+ api " com.squareup.retrofit2:retrofit:$retrofit_version "
42+ api " com.squareup.retrofit2:converter-scalars:$retrofit_version "
43+ api " com.squareup.retrofit2:converter-gson:$retrofit_version "
44+ api " io.swagger:swagger-annotations:$swagger_annotations_version "
45+ api " com.google.code.findbugs:jsr305:3.0.2"
46+ api " io.gsonfire:gson-fire:$json_fire_version "
47+ api " org.threeten:threetenbp:$threetenbp_version "
48+ testImplementation " junit:junit:$junit_version "
49+ testImplementation " ch.qos.logback:logback-core:$slf4j_core_version "
50+ testImplementation " ch.qos.logback:logback-classic:$slf4j_classic_version "
51+ testImplementation " org.slf4j:slf4j-api:$slf4j_version "
52+ }
53+
54+ publishing {
55+ publications {
56+ maven(MavenPublication ) {
57+ from components. java
58+ groupId = ' com.mparticle'
59+ artifactId = ' server-events-sdk'
60+ pom {
61+ name = ' mParticle server-side Java SDK'
62+ description = ' mParticle SDK for server-side Java environments'
63+ url = ' https://github.com/mparticle/mparticle-java-events-sdk'
64+ licenses {
65+ license {
66+ name = ' The Apache Software License, Version 2.0'
67+ url = ' http://www.apache.org/license/LICENSE-2.0.txt'
68+ }
69+ }
70+ scm {
71+ url = ' https://github.com/mparticle/mparticle-java-events-sdk'
72+ connection = ' scm:git:https://github.com/mparticle/mparticle-java-events-sdk'
73+ developerConnection = ' scm:git:git@github.com:mparticle/mparticle-java-events-sdk.git'
74+ }
75+ developers {
76+ developer {
77+ id = ' mParticle'
78+ name = ' mParticle Inc.'
79+ email = ' developers@mparticle.com'
80+ }
81+ }
82+ }
83+ }
84+ }
85+ repositories {
86+ maven {
87+ name = ' sonatype'
88+ url = ' https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/'
89+ credentials {
90+ username = System . getenv(' sonatypeUsername' )
91+ password = System . getenv(' sonatypePassword' )
92+ }
93+ }
94+ }
95+ }
96+
97+ def signingKey = System . getenv(' ORG_GRADLE_PROJECT_signingInMemoryKey' )
98+ def signingPassword = System . getenv(' ORG_GRADLE_PROJECT_signingInMemoryKeyPassword' )
99+ signing {
100+ required { gradle. taskGraph. hasTask(' publishMavenPublicationToSonatypeRepository' ) }
101+ useInMemoryPgpKeys(signingKey, signingPassword)
102+ sign publishing. publications. maven
67103}
0 commit comments