1- apply plugin : ' com.android.library'
2- apply plugin : ' maven-publish'
3- apply plugin : ' signing'
1+ plugins {
2+ id ' com.android.library'
3+ id " com.vanniktech.maven.publish" version " 0.33.0"
4+ }
45
56android {
7+ namespace " tv.danmaku.ijk.media.player_armv7a"
68 // http://tools.android.com/tech-docs/new-build-system/tips
79 // noinspection GroovyAssignabilityCheck
810 compileSdkVersion rootProject. ext. compileSdkVersion
@@ -28,108 +30,40 @@ android {
2830}
2931
3032dependencies {
31- compile fileTree(dir : ' libs' , include : [' *.jar' ])
33+ implementation fileTree(dir : ' libs' , include : [' *.jar' ])
3234}
3335
3436apply from : new File (rootProject. projectDir, " tools/gradle-on-demand.gradle" );
3537
36-
37- task androidJavadocs (type : Javadoc ) {
38- failOnError false
39- source = android. sourceSets. main. java. srcDirs
40- classpath + = project. files(android. getBootClasspath(). join(File . pathSeparator))
41- android. libraryVariants. all { variant ->
42- if (variant. name == ' release' ) {
43- owner. classpath + = variant. javaCompile. classpath
44- }
45- }
46- exclude ' **/R.html' , ' **/R.*.html' , ' **/index.html'
47- }
48-
49- task androidJavadocsJar (type : Jar , dependsOn : androidJavadocs) {
50- classifier = ' javadoc'
51- from androidJavadocs. destinationDir
52- }
53-
54- task androidSourcesJar (type : Jar ) {
55- classifier = ' sources'
56- from android. sourceSets. main. java. srcDirs
57- }
58-
5938def libVersion = rootProject. ext. sdk. version
6039ext. isReleaseVersion = ! libVersion. endsWith(" SNAPSHOT" )
61- publishing {
62- publications {
63- aar(MavenPublication ) {
64- groupId ' com.tencent.iot.thirdparty.android'
65- artifactId ' ijkplayer-armv7a'
66- version libVersion
67- artifact(androidSourcesJar)
68- artifact(androidJavadocsJar)
69- artifact file(' build/outputs/aar/ijkplayer-armv7a-release.aar' )
70-
71- pom {
72- name = ' ijkplayer'
73- description = ' Tencent Link Android library'
74- url = ' https://github.com/tencentyun/iot-ijkplayer'
75- licenses {
76- license {
77- name = ' Tencent Binary License'
78- url = ' https://github.com/tencentyun/iot-link-android/blob/master/explorer-link-android/LICENSE'
79- }
80- }
81- developers {
82- developer {
83- id = ' tencent_archurtan'
84- name = ' Tencent archurtan'
85- email = ' archurtan@tencent.com'
86- }
87- }
88- scm {
89- url = ' scm:git@github.com:tencentyun/iot-ijkplayer.git'
90- connection = ' scm:git@github.com:tencentyun/iot-ijkplayer.git'
91- developerConnection = ' scm:git@github.com:tencentyun/iot-ijkplayer.git'
92- }
93- }
40+ mavenPublishing {
9441
95- pom. withXml {
96- def dependenciesNode = asNode(). appendNode(' dependencies' )
97- configurations. implementation. allDependencies. withType(ModuleDependency ) { ModuleDependency dp ->
98- if (dp. version != " unspecified" ) { // 过滤项目内library引用
99- def dependencyNode = dependenciesNode. appendNode(' dependency' )
100- dependencyNode. appendNode(' groupId' , dp. group)
101- dependencyNode. appendNode(' artifactId' , dp. name)
102- dependencyNode. appendNode(' version' , dp. version)
42+ coordinates(" com.tencent.iot.thirdparty.android" , " ijkplayer-armv7a" , libVersion)
43+ publishToMavenCentral()
44+ signAllPublications()
10345
104- // for exclusions
105- if (dp. excludeRules. size() > 0 ) {
106- def exclusions = dependencyNode. appendNode(' exclusions' )
107- dp. excludeRules. each { ExcludeRule ex ->
108- def exclusion = exclusions. appendNode(' exclusion' )
109- exclusion. appendNode(' groupId' , ex. group)
110- exclusion. appendNode(' artifactId' , ex. module)
111- }
112- }
113- }
114- }
46+ pom {
47+ name = ' ijkplayer'
48+ description = ' Tencent Link Android library'
49+ url = ' https://github.com/tencentyun/iot-ijkplayer'
50+ licenses {
51+ license {
52+ name = ' Tencent Binary License'
53+ url = ' https://github.com/tencentyun/iot-link-android/blob/master/explorer-link-android/LICENSE'
11554 }
11655 }
117- }
118- repositories {
119- maven {
120- def releasesRepoUrl = " https://oss.sonatype.org/service/local/staging/deploy/maven2"
121- def snapshotsRepoUrl = " https://oss.sonatype.org/content/repositories/snapshots"
122- url = libVersion. endsWith(' SNAPSHOT' ) ? snapshotsRepoUrl : releasesRepoUrl
123- credentials {
124- username = System . getenv(" IOT_SONATYPE_USERNAME" )
125- password = System . getenv(" IOT_SONATYPE_PASSWORD" )
56+ developers {
57+ developer {
58+ id = ' tencent_archurtan'
59+ name = ' Tencent archurtan'
60+ email = ' archurtan@tencent.com'
12661 }
12762 }
128- }
129- }
130-
131- signing {
132- if (isReleaseVersion) {
133- sign publishing. publications. aar
63+ scm {
64+ url = ' scm:git@github.com:tencentyun/iot-ijkplayer.git'
65+ connection = ' scm:git@github.com:tencentyun/iot-ijkplayer.git'
66+ developerConnection = ' scm:git@github.com:tencentyun/iot-ijkplayer.git'
67+ }
13468 }
13569}
0 commit comments