James E. King III | b1d63e7 | 2019-01-22 14:16:39 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Licensed to the Apache Software Foundation (ASF) under one |
| 3 | * or more contributor license agreements. See the NOTICE file |
| 4 | * distributed with this work for additional information |
| 5 | * regarding copyright ownership. The ASF licenses this file |
| 6 | * to you under the Apache License, Version 2.0 (the |
| 7 | * "License"); you may not use this file except in compliance |
| 8 | * with the License. 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, |
| 13 | * software distributed under the License is distributed on an |
| 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | * KIND, either express or implied. See the License for the |
| 16 | * specific language governing permissions and limitations |
| 17 | * under the License. |
| 18 | */ |
| 19 | |
| 20 | // Following Gradle best practices to keep build logic organized |
| 21 | |
| 22 | model { |
| 23 | tasks.signMavenPublication { |
| 24 | dependsOn compileFlex |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | publishing { |
| 29 | publications { |
| 30 | maven(MavenPublication) { |
| 31 | |
| 32 | groupId = "$group" |
| 33 | artifactId = "${project.name}" |
| 34 | version = "$version" |
| 35 | |
| 36 | def swcFile = file("$buildDir/libthrift-as3.swc") |
| 37 | artifact(swcFile) |
| 38 | |
| 39 | pom { |
| 40 | description = 'Thrift is a software framework for scalable cross-language services development.' |
| 41 | packaging = 'swc' |
| 42 | |
| 43 | // older gradle doesn't recognize all the properties, so we inject them.. |
| 44 | withXml { |
| 45 | asNode().with { |
| 46 | appendNode('name', 'Apache Thrift') |
| 47 | appendNode('url', 'http://thrift.apache.org/') |
| 48 | appendNode('scm').with { |
| 49 | appendNode('url', 'https://github.com/apache/thrift/') |
| 50 | appendNode('connection', 'scm:git:https://github.com/apache/thrift.git') |
| 51 | appendNode('developerConnection', 'scm:git:git@github.com:apache/thrift.git') |
| 52 | } |
| 53 | appendNode('issueManagement').with { |
| 54 | appendNode('url', 'https://issues.apache.org/jira/projects/THRIFT/') |
| 55 | appendNode('system', 'Jira') |
| 56 | } |
| 57 | appendNode('licenses').with { |
| 58 | appendNode('license').with { |
| 59 | appendNode('name', 'The Apache Software License, Version 2.0') |
| 60 | appendNode('url', "${project.license}") |
| 61 | } |
| 62 | } |
| 63 | appendNode('organization').with { |
| 64 | appendNode('name', 'The Apache Software Foundation') |
| 65 | appendNode('url', 'http://www.apache.org/') |
| 66 | } |
| 67 | appendNode('developers').with { |
| 68 | appendNode('developer').with { |
| 69 | appendNode('id', 'dev') |
| 70 | appendNode('name', 'Apache Thrift Developers') |
| 71 | appendNode('email', 'dev@thrift.apache.org') |
| 72 | } |
| 73 | } |
| 74 | } |
| 75 | } |
| 76 | } |
| 77 | } |
| 78 | } |
| 79 | repositories { |
| 80 | maven { |
| 81 | url = property('maven-repository-url') |
| 82 | |
| 83 | if (project.hasProperty('mavenUser') && project.hasProperty('mavenPassword')) { |
| 84 | credentials { |
| 85 | username = property('mavenUser') |
| 86 | password = property('mavenPassword') |
| 87 | } |
| 88 | } |
| 89 | } |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | signing { |
| 94 | required { property('sign') } |
| 95 | sign publishing.publications.maven |
| 96 | } |