Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(publish): add sonata to repositories #55

Merged
merged 3 commits into from
Sep 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ def pomConfig = {
url "https://github.com:rees46/android-sdk/tree/master"
}
}
def urls = [rees46: "https://github.com/rees46/android-sdk", personaclick: "https://github.com/PersonaClick/android-sdk"]

def publicationNames = []
publishing {
Expand Down Expand Up @@ -108,10 +109,41 @@ publishing {

url = uri(publishUrl)
}
maven {
name = "sonatype"

def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"

credentials {
username ossrhUsername
password ossrhPassword
}

url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
Nelfimov marked this conversation as resolved.
Show resolved Hide resolved
}
}

def sonatypeIds = [rees46: sonatype_rees46, personaclick: sonatype_personaclick]

afterEvaluate {
nexusPublishing {
repositories {
android.libraryVariants.all { variant ->
if (variant.buildType.name == "debug") return

"${variant.flavorName}Sonatype" {
stagingProfileId = sonatypeIds[variant.flavorName]
username = ossrhUsername
password = ossrhPassword
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}
}

android.libraryVariants.all { variant ->
if(variant == 'release') {
tasks.javadoc.classpath += files(variant.javaCompileProvider.get().classpath)
Expand Down
Loading