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
34 changes: 21 additions & 13 deletions OneSignalSDK/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,29 @@ buildscript {
ktlintVersion = '1.0.1'
// DO NOT upgrade for tests, using an old version so it matches AOSP
tdunningJsonForTest = '1.0'
}

repositories {
google()
mavenCentral()
gradlePluginPortal()
// Huawei maven
maven { url 'https://developer.huawei.com/repo/' }
sharedRepos = {
google()
mavenCentral()
gradlePluginPortal()
// Huawei maven
maven { url 'https://developer.huawei.com/repo/' }
}
sharedDeps = [
"com.android.tools.build:gradle:$androidGradlePluginVersion",
"com.google.gms:google-services:$googleServicesGradlePluginVersion",
"com.huawei.agconnect:agcp:$huaweiAgconnectVersion",
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion",
"org.jlleitschuh.gradle:ktlint-gradle:$ktlintPluginVersion",
"com.vanniktech.maven.publish:com.vanniktech.maven.publish.gradle.plugin:0.32.0"
]
}
dependencies {
classpath "com.android.tools.build:gradle:$androidGradlePluginVersion"
classpath "com.google.gms:google-services:$googleServicesGradlePluginVersion"
classpath "com.huawei.agconnect:agcp:$huaweiAgconnectVersion"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "org.jlleitschuh.gradle:ktlint-gradle:$ktlintPluginVersion"

buildscript {
repositories sharedRepos
dependencies {
classpath sharedDeps
}
}
}

Expand Down
1 change: 1 addition & 0 deletions OneSignalSDK/onesignal/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
// however consumers look for an .aar file, which this causes it
// to be created.
id 'kotlin-android'
id 'com.vanniktech.maven.publish'
}

android {
Expand Down
1 change: 1 addition & 0 deletions OneSignalSDK/onesignal/core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id 'com.android.library'
id 'kotlin-android'
id 'org.jlleitschuh.gradle.ktlint'
id 'com.vanniktech.maven.publish'
}

android {
Expand Down
1 change: 1 addition & 0 deletions OneSignalSDK/onesignal/in-app-messages/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id 'com.android.library'
id 'kotlin-android'
id 'org.jlleitschuh.gradle.ktlint'
id 'com.vanniktech.maven.publish'
}

android {
Expand Down
1 change: 1 addition & 0 deletions OneSignalSDK/onesignal/location/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id 'com.android.library'
id 'kotlin-android'
id 'org.jlleitschuh.gradle.ktlint'
id 'com.vanniktech.maven.publish'
}

android {
Expand Down
130 changes: 33 additions & 97 deletions OneSignalSDK/onesignal/maven-push.gradle
Original file line number Diff line number Diff line change
@@ -1,108 +1,44 @@
/**
* Modified MIT License
*
* Copyright 2021 OneSignal
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 1. The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* 2. All copies of substantial portions of the Software may only be used in connection
* with services provided by OneSignal.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
buildscript {
repositories sharedRepos
dependencies {
classpath sharedDeps
}
}

apply plugin: 'maven-publish'
apply plugin: 'signing'
import com.vanniktech.maven.publish.AndroidSingleVariantLibrary
import com.vanniktech.maven.publish.SonatypeHost

class Global {
static def POM_PACKAGING = 'aar'
mavenPublishing {
configure(new AndroidSingleVariantLibrary("release", true, true))
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)

static def POM_URL = 'https://github.com/onesignal/onesignal-android-sdk'
static def POM_SCM_URL = 'https://github.com/onesignal/onesignal-android-sdk'
static def POM_SCM_CONNECTION = 'scm:git:https://github.com/onesignal/onesignal-android-sdk'
static def POM_SCM_DEV_CONNECTION = 'scm:git:https://github.com/onesignal/onesignal-android-sdk'
static def POM_LICENCE_NAME = 'MIT License'
static def POM_LICENCE_URL = 'https://raw.githubusercontent.com/onesignal/onesignal-android-sdk/master/LICENSE'
static def POM_LICENCE_DIST = 'repo'
static def POM_DEVELOPER_ID = 'OneSignal'
static def POM_DEVELOPER_NAME = 'Josh Kasten'
static def SNAPSHOT_REPOSITORY_URL = 'https://oss.sonatype.org/content/repositories/snapshots'
static def RELEASE_REPOSITORY_URL = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
}
signAllPublications()

def getRepositoryUsername() {
return hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : ""
}
coordinates(project.group, project.name, project.version)

def getRepositoryPassword() {
return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : ""
}

afterEvaluate {
publishing {
repositories {
maven {
url = Global.RELEASE_REPOSITORY_URL
credentials {
username = getRepositoryUsername()
password = getRepositoryPassword()
}
pom {
name = "OneSignal Android SDK"
description = "OneSignal is a free email, sms, push notification, and in-app message service for mobile apps. This plugin makes it easy to integrate your native Android or Amazon app with OneSignal."
inceptionYear = "2015"
url = "https://github.com/onesignal/onesignal-android-sdk/"
licenses {
license {
name = "Modified MIT License"
url = "https://raw.githubusercontent.com/onesignal/onesignal-android-sdk/main/LICENSE"
distribution = "repo"
}
}

publications {
release(MavenPublication) {
afterEvaluate {
from components.findByName('release')
}

pom {
name = projectName
description = projectDescription
packaging = Global.POM_PACKAGING
url = Global.POM_URL

scm {
url = Global.POM_SCM_URL
connection = Global.POM_SCM_CONNECTION
developerConnection = Global.POM_SCM_DEV_CONNECTION
}

licenses {
license {
name = Global.POM_LICENCE_NAME
url = Global.POM_LICENCE_URL
distribution = Global.POM_LICENCE_DIST
}
}

developers {
developer {
id = Global.POM_DEVELOPER_ID
name = Global.POM_DEVELOPER_NAME
}
}
}
developers {
developer {
id = "OneSignal"
name = "OneSignal"
url = "https://github.com/OneSignal/"
}
}
}

signing {
required { true }
sign publishing.publications.release
scm {
url = "https://github.com/onesignal/onesignal-android-sdk"
connection = "scm:git:git://github.com/onesignal/onesignal-android-sdk.git"
developerConnection = "scm:git:ssh://[email protected]/onesignal/onesignal-android-sdk.git"
}
}
}
1 change: 1 addition & 0 deletions OneSignalSDK/onesignal/notifications/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id 'com.android.library'
id 'kotlin-android'
id 'org.jlleitschuh.gradle.ktlint'
id 'com.vanniktech.maven.publish'
}

android {
Expand Down
Loading