xref: /aosp_15_r20/external/exoplayer/tree_8e57d3715f9092d5ec54ebe2e538f34bfcc34479/publish.gradle (revision 30877f796caf59d855b10b687a5d6b3918d765cb)
1// Copyright (C) 2017 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15apply plugin: 'maven-publish'
16apply from: "$gradle.ext.exoplayerSettingsDir/missing_aar_type_workaround.gradle"
17
18afterEvaluate {
19    publishing {
20        repositories {
21            maven {
22                url = findProperty('mavenRepo') ?: "${buildDir}/repo"
23            }
24        }
25        publications {
26            release(MavenPublication) {
27                from components.release
28                artifact androidSourcesJar
29                groupId = 'com.google.android.exoplayer'
30                artifactId = releaseArtifactId
31                version releaseVersion
32                pom {
33                    name = releaseArtifactId
34                    description = releaseDescription
35                    licenses {
36                        license {
37                            name = 'The Apache Software License, Version 2.0'
38                            url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
39                            distribution = 'repo'
40                        }
41                    }
42                    developers {
43                        developer {
44                            name = 'The Android Open Source Project'
45                        }
46                    }
47                    scm {
48                        connection = 'scm:git:https://github.com/google/ExoPlayer.git'
49                        url = 'https://github.com/google/ExoPlayer'
50                    }
51                    withXml {
52                        addMissingAarTypeToXml(it)
53                    }
54                }
55            }
56        }
57    }
58}
59tasks.withType(PublishToMavenRepository) { it.dependsOn lint, test }
60
61task androidSourcesJar(type: Jar) {
62    archiveClassifier.set('sources')
63    from android.sourceSets.main.java.srcDirs
64}
65