Skip to content

Commit

Permalink
fix gradle build & release on gradle 7.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushalkapasi committed Feb 10, 2023
1 parent 2369d92 commit f6c4e0f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 54 deletions.
88 changes: 35 additions & 53 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ plugins {
id 'de.undercouch.download' version '5.2.0'
id 'java'
id 'java-library'
id 'maven'
id 'maven-publish'
id 'signing'
}
Expand All @@ -19,8 +18,9 @@ task sourcesJar(type: Jar) {
from sourceSets.main.allSource
}

artifacts {
archives javadocJar, sourcesJar
java {
withJavadocJar()
withSourcesJar()
}

signing {
Expand All @@ -31,50 +31,52 @@ group = "com.devcycle"
archivesBaseName = "java-server-sdk"
version = "1.1.3"

uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

repository(url: "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}

snapshotRepository(url: "https://s01.oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}

pom.project {
name 'DevCycle Java Server SDK'
packaging 'jar'
// optionally artifactId can be defined here
description 'Server side SDK to interact with DevCycle.'
url 'https://devcycle.com'
publishing {
publications {
javaServerSDK(MavenPublication) {
from components.java
pom {
name = 'DevCycle Java Server SDK'
packaging = 'jar'
artifactId = 'java-server-sdk'
description = 'Server side SDK to interact with DevCycle.'
url = 'https://devcycle.com'

scm {
connection 'scm:git:git://github.com/DevCycleHQ/java-server-sdk.git'
developerConnection 'scm:git:ssh://github.com:DevCycleHQ/java-server-sdk.git'
url 'https://github.com/DevCycleHQ/java-server-sdk'
connection = 'scm:git:git://github.com/DevCycleHQ/java-server-sdk.git'
developerConnection = 'scm:git:ssh://github.com:DevCycleHQ/java-server-sdk.git'
url = 'https://github.com/DevCycleHQ/java-server-sdk'
}

licenses {
license {
name 'MIT License'
url 'https://www.opensource.org/licenses/mit-license.php'
name = 'MIT License'
url = 'https://www.opensource.org/licenses/mit-license.php'
}
}

developers {
developer {
id 'devcycle'
name 'DevCycle Engineering'
email '[email protected]'
organization 'DevCycle'
id = 'devcycle'
name = 'DevCycle Engineering'
email = '[email protected]'
organization = 'DevCycle'
}
}
}
}
}
repositories {
maven {
def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
}

repositories {
Expand All @@ -83,25 +85,6 @@ repositories {

sourceCompatibility = JavaVersion.VERSION_1_8

install {
repositories.mavenInstaller {
pom.artifactId = 'java-server-sdk'
}
}

publishing {
publications {
myLibrary(MavenPublication) {
from components.java
}
}
}

task execute(type:JavaExec) {
main = System.getProperty('mainClass')
classpath = sourceSets.main.runtimeClasspath
}

def wasmResourcePath = "$projectDir/src/main/resources"
def wasmVersion = "1.1.28"
def wasmUrl = "https://unpkg.com/@devcycle/bucketing-assembly-script@$wasmVersion/build/bucketing-lib.release.wasm"
Expand All @@ -113,9 +96,8 @@ task downloadDVCBucketingWASM(type: Download) {
}
}

build {
dependsOn downloadDVCBucketingWASM
}
processResources.dependsOn downloadDVCBucketingWASM
sourcesJar.dependsOn downloadDVCBucketingWASM

ext {
retrofit_version = "2.9.0"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit f6c4e0f

Please sign in to comment.