Skip to content

Commit d2ab3d2

Browse files
committed
chore: Update to gradle 8
1 parent 9d11948 commit d2ab3d2

9 files changed

Lines changed: 285 additions & 290 deletions

File tree

.github/workflows/push.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: "Checkout Branch"
13-
uses: actions/checkout@v3
14-
- name: "Install JDK 11"
15-
uses: actions/setup-java@v3
13+
uses: actions/checkout@v4
14+
- name: "Install JDK 17"
15+
uses: actions/setup-java@v5
1616
with:
1717
distribution: "zulu"
18-
java-version: "11"
18+
java-version: "17"
1919
cache: "gradle"
2020
- name: "Run Tests"
2121
run: ./gradlew test

.scripts/maven.gradle

Lines changed: 0 additions & 89 deletions
This file was deleted.

.scripts/release.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.6.0

build.gradle

Lines changed: 75 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
apply plugin: 'java'
1+
plugins {
2+
id 'java-library'
3+
id 'maven-publish'
4+
id 'signing'
5+
}
26

37
group = '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

1410
repositories {
1511
mavenCentral()
@@ -18,26 +14,15 @@ repositories {
1814
sourceCompatibility = JavaVersion.VERSION_1_8
1915
targetCompatibility = 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

4328
ext {
@@ -53,15 +38,66 @@ ext {
5338
}
5439

5540
dependencies {
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
}

gradle/wrapper/gradle-wrapper.jar

-11.8 KB
Binary file not shown.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
46
zipStoreBase=GRADLE_USER_HOME
57
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)