mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Add Maven publishing support
The release AAR and Android sources are included for each published artifact. Issue: #5246 Issue: #8353 #minor-release PiperOrigin-RevId: 358146555
This commit is contained in:
parent
7830eb7ae5
commit
7b119beffb
@ -11,6 +11,9 @@
|
|||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
|
// For publishing to Bintray.
|
||||||
|
|
||||||
if (project.ext.has("exoplayerPublishEnabled")
|
if (project.ext.has("exoplayerPublishEnabled")
|
||||||
&& project.ext.exoplayerPublishEnabled) {
|
&& project.ext.exoplayerPublishEnabled) {
|
||||||
apply plugin: 'bintray-release'
|
apply plugin: 'bintray-release'
|
||||||
@ -66,3 +69,50 @@ static void addLicense(File pom) {
|
|||||||
printer.print(xml)
|
printer.print(xml)
|
||||||
writer.close()
|
writer.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// For publishing to a Maven repository.
|
||||||
|
|
||||||
|
task androidSourcesJar(type: Jar) {
|
||||||
|
archiveClassifier.set('sources')
|
||||||
|
from android.sourceSets.main.java.srcDirs
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'maven-publish'
|
||||||
|
afterEvaluate {
|
||||||
|
publishing {
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
url = findProperty('mavenRepo') ?: "${buildDir}/repo"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
publications {
|
||||||
|
release(MavenPublication) {
|
||||||
|
from components.release
|
||||||
|
artifact androidSourcesJar
|
||||||
|
groupId = 'com.google.android.exoplayer'
|
||||||
|
artifactId = releaseArtifact
|
||||||
|
version releaseVersion
|
||||||
|
pom {
|
||||||
|
name = releaseArtifact
|
||||||
|
description = releaseDescription
|
||||||
|
licenses {
|
||||||
|
license {
|
||||||
|
name = 'The Apache Software License, Version 2.0'
|
||||||
|
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
|
||||||
|
distribution = 'repo'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
developers {
|
||||||
|
developer {
|
||||||
|
name = 'The Android Open Source Project'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
scm {
|
||||||
|
connection = 'scm:git:https://github.com/google/ExoPlayer.git'
|
||||||
|
url = 'https://github.com/google/ExoPlayer'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user