|
1 |
| -/** |
2 |
| - * Modified MIT License |
3 |
| - * |
4 |
| - * Copyright 2021 OneSignal |
5 |
| - * |
6 |
| - * Permission is hereby granted, free of charge, to any person obtaining a copy |
7 |
| - * of this software and associated documentation files (the "Software"), to deal |
8 |
| - * in the Software without restriction, including without limitation the rights |
9 |
| - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
10 |
| - * copies of the Software, and to permit persons to whom the Software is |
11 |
| - * furnished to do so, subject to the following conditions: |
12 |
| - * |
13 |
| - * 1. The above copyright notice and this permission notice shall be included in |
14 |
| - * all copies or substantial portions of the Software. |
15 |
| - * |
16 |
| - * 2. All copies of substantial portions of the Software may only be used in connection |
17 |
| - * with services provided by OneSignal. |
18 |
| - * |
19 |
| - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
20 |
| - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
21 |
| - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
22 |
| - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
23 |
| - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
24 |
| - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
25 |
| - * THE SOFTWARE. |
26 |
| - */ |
| 1 | +buildscript { |
| 2 | + repositories sharedRepos |
| 3 | + dependencies { |
| 4 | + classpath sharedDeps |
| 5 | + } |
| 6 | +} |
27 | 7 |
|
28 |
| -apply plugin: 'maven-publish' |
29 |
| -apply plugin: 'signing' |
| 8 | +import com.vanniktech.maven.publish.AndroidSingleVariantLibrary |
| 9 | +import com.vanniktech.maven.publish.SonatypeHost |
30 | 10 |
|
31 |
| -class Global { |
32 |
| - static def POM_PACKAGING = 'aar' |
| 11 | +mavenPublishing { |
| 12 | + configure(new AndroidSingleVariantLibrary("release", true, true)) |
| 13 | + publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) |
33 | 14 |
|
34 |
| - static def POM_URL = 'https://github.com/onesignal/onesignal-android-sdk' |
35 |
| - static def POM_SCM_URL = 'https://github.com/onesignal/onesignal-android-sdk' |
36 |
| - static def POM_SCM_CONNECTION = 'scm:git:https://github.com/onesignal/onesignal-android-sdk' |
37 |
| - static def POM_SCM_DEV_CONNECTION = 'scm:git:https://github.com/onesignal/onesignal-android-sdk' |
38 |
| - static def POM_LICENCE_NAME = 'MIT License' |
39 |
| - static def POM_LICENCE_URL = 'https://raw.githubusercontent.com/onesignal/onesignal-android-sdk/master/LICENSE' |
40 |
| - static def POM_LICENCE_DIST = 'repo' |
41 |
| - static def POM_DEVELOPER_ID = 'OneSignal' |
42 |
| - static def POM_DEVELOPER_NAME = 'Josh Kasten' |
43 |
| - static def SNAPSHOT_REPOSITORY_URL = 'https://oss.sonatype.org/content/repositories/snapshots' |
44 |
| - static def RELEASE_REPOSITORY_URL = 'https://oss.sonatype.org/service/local/staging/deploy/maven2' |
45 |
| -} |
| 15 | + signAllPublications() |
46 | 16 |
|
47 |
| -def getRepositoryUsername() { |
48 |
| - return hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : "" |
49 |
| -} |
| 17 | + coordinates(project.group, project.name, project.version) |
50 | 18 |
|
51 |
| -def getRepositoryPassword() { |
52 |
| - return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : "" |
53 |
| -} |
54 |
| - |
55 |
| -afterEvaluate { |
56 |
| - publishing { |
57 |
| - repositories { |
58 |
| - maven { |
59 |
| - url = Global.RELEASE_REPOSITORY_URL |
60 |
| - credentials { |
61 |
| - username = getRepositoryUsername() |
62 |
| - password = getRepositoryPassword() |
63 |
| - } |
| 19 | + pom { |
| 20 | + name = "OneSignal Android SDK" |
| 21 | + 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." |
| 22 | + inceptionYear = "2015" |
| 23 | + url = "https://github.com/onesignal/onesignal-android-sdk/" |
| 24 | + licenses { |
| 25 | + license { |
| 26 | + name = "Modified MIT License" |
| 27 | + url = "https://raw.githubusercontent.com/onesignal/onesignal-android-sdk/main/LICENSE" |
| 28 | + distribution = "repo" |
64 | 29 | }
|
65 | 30 | }
|
66 |
| - |
67 |
| - publications { |
68 |
| - release(MavenPublication) { |
69 |
| - afterEvaluate { |
70 |
| - from components.findByName('release') |
71 |
| - } |
72 |
| - |
73 |
| - pom { |
74 |
| - name = projectName |
75 |
| - description = projectDescription |
76 |
| - packaging = Global.POM_PACKAGING |
77 |
| - url = Global.POM_URL |
78 |
| - |
79 |
| - scm { |
80 |
| - url = Global.POM_SCM_URL |
81 |
| - connection = Global.POM_SCM_CONNECTION |
82 |
| - developerConnection = Global.POM_SCM_DEV_CONNECTION |
83 |
| - } |
84 |
| - |
85 |
| - licenses { |
86 |
| - license { |
87 |
| - name = Global.POM_LICENCE_NAME |
88 |
| - url = Global.POM_LICENCE_URL |
89 |
| - distribution = Global.POM_LICENCE_DIST |
90 |
| - } |
91 |
| - } |
92 |
| - |
93 |
| - developers { |
94 |
| - developer { |
95 |
| - id = Global.POM_DEVELOPER_ID |
96 |
| - name = Global.POM_DEVELOPER_NAME |
97 |
| - } |
98 |
| - } |
99 |
| - } |
| 31 | + developers { |
| 32 | + developer { |
| 33 | + id = "OneSignal" |
| 34 | + name = "OneSignal" |
| 35 | + url = "https://github.com/OneSignal/" |
100 | 36 | }
|
101 | 37 | }
|
102 |
| - } |
103 |
| - |
104 |
| - signing { |
105 |
| - required { true } |
106 |
| - sign publishing.publications.release |
| 38 | + scm { |
| 39 | + url = "https://github.com/onesignal/onesignal-android-sdk" |
| 40 | + connection = "scm:git:git://github.com/onesignal/onesignal-android-sdk.git" |
| 41 | + developerConnection = "scm:git:ssh://[email protected]/onesignal/onesignal-android-sdk.git" |
| 42 | + } |
107 | 43 | }
|
108 | 44 | }
|
0 commit comments