Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 7 additions & 1 deletion android-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ android {
}
}

repositories {
maven {
url "https://central.sonatype.com/repository/maven-snapshots/"
}
mavenCentral()
}

dependencies {
api project(':shared')
api project(':datafile-handler')
Expand All @@ -68,7 +75,6 @@ dependencies {
api ("com.optimizely.ab:core-api:$java_core_ver") {
exclude group: 'com.google.code.findbugs'
}

implementation "org.slf4j:slf4j-api:$slf4j_ver"

compileOnly "com.fasterxml.jackson.core:jackson-databind:$jacksonversion"
Expand Down
45 changes: 30 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ buildscript {
ext.is_release_version = !version_name.endsWith("SNAPSHOT")

repositories {
jcenter()
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.2'
Expand All @@ -39,7 +39,8 @@ buildscript {
}

plugins {
id "org.jlleitschuh.gradle.ktlint" version "11.0.0"
id "org.jlleitschuh.gradle.ktlint" version "11.0.0"
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
}

allprojects {
Expand All @@ -52,11 +53,10 @@ allprojects {
}

repositories {
jcenter()
google()
mavenCentral()
// SNAPSHOT support
maven {url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
maven { url "https://jitpack.io" }
}

Expand Down Expand Up @@ -117,9 +117,35 @@ task testODPModule () {
}

// Publish to MavenCentral
nexusPublishing {
packageGroup = group_id
repositories {
sonatype {
nexusUrl.set(uri('https://ossrh-staging-api.central.sonatype.com/service/local/'))
snapshotRepositoryUrl.set(uri('https://central.sonatype.com/repository/maven-snapshots/'))
username = System.getenv('MAVEN_CENTRAL_USERNAME')
password = System.getenv('MAVEN_CENTRAL_PASSWORD')
}
}

}

task ship() {
dependsOn(':android-sdk:ship', ':shared:ship', ':event-handler:ship', ':user-profile:ship', ':datafile-handler:ship', ':odp:ship')
doLast {
def sonatypeTasks = ['publishToSonatype']
if (is_release_version) {
sonatypeTasks.add('closeSonatypeStagingRepository')
}

def args = ['./gradlew']
args.addAll(sonatypeTasks)
args.add('--info')

exec {
commandLine args
}
}
}

def publishedProjects = subprojects.findAll { it.name != 'test-app' }
Expand Down Expand Up @@ -223,17 +249,6 @@ configure(publishedProjects) {
from components.release
}
}
repositories {
maven {
def releaseUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
def snapshotUrl = "https://oss.sonatype.org/content/repositories/snapshots"
url = is_release_version ? releaseUrl : snapshotUrl
credentials {
username System.getenv('MAVEN_CENTRAL_USERNAME')
password System.getenv('MAVEN_CENTRAL_PASSWORD')
}
}
}
}

signing {
Expand Down
Loading