|
| 1 | +import com.vanniktech.maven.publish.SonatypeHost |
| 2 | + |
| 3 | +/* |
| 4 | + * Copyright 2025 Kartik Prakash |
| 5 | + * |
| 6 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | + * you may not use this file except in compliance with the License. |
| 8 | + * You may obtain a copy of the License at |
| 9 | + * |
| 10 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | + * |
| 12 | + * Unless required by applicable law or agreed to in writing, software |
| 13 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | + * See the License for the specific language governing permissions and |
| 16 | + * limitations under the License. |
| 17 | + */ |
| 18 | + |
| 19 | +plugins { |
| 20 | + id("com.vanniktech.maven.publish") |
| 21 | + id("signing") |
| 22 | +} |
| 23 | + |
| 24 | +mavenPublishing { |
| 25 | + publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) |
| 26 | + signAllPublications() |
| 27 | + |
| 28 | + pom { |
| 29 | + name = "Multiplatform Work Manager" |
| 30 | + description = "Multiplatform Work Manager." |
| 31 | + inceptionYear = "2025" |
| 32 | + url = "https://github.com/kprakash2/multiplatform-work-manager/" |
| 33 | + licenses { |
| 34 | + license { |
| 35 | + name = "The Apache License, Version 2.0" |
| 36 | + url = "https://www.apache.org/licenses/LICENSE-2.0.txt" |
| 37 | + distribution = "https://www.apache.org/licenses/LICENSE-2.0.txt" |
| 38 | + } |
| 39 | + } |
| 40 | + developers { |
| 41 | + developer { |
| 42 | + id = "kprakash2" |
| 43 | + name = "Kartik Prakash" |
| 44 | + url = "https://github.com/kprakash2/" |
| 45 | + } |
| 46 | + } |
| 47 | + scm { |
| 48 | + url = "https://github.com/kprakash2/multiplatform-work-manager/" |
| 49 | + } |
| 50 | + } |
| 51 | +} |
| 52 | + |
| 53 | +signing { |
| 54 | + val signingKey = findProperty("signing.key")?.toString()?.replace("\\n", "\n") |
| 55 | + |
| 56 | + if (signingKey != null) { |
| 57 | + val signingKeyPassword = findProperty("signing.password")?.toString() |
| 58 | + |
| 59 | + useInMemoryPgpKeys( |
| 60 | + signingKey, |
| 61 | + signingKeyPassword |
| 62 | + ) |
| 63 | + sign(publishing.publications) |
| 64 | + } |
| 65 | +} |
0 commit comments