@@ -14,12 +14,16 @@ def disableVideoModule() {
1414 return gradle. ext != null && gradle. ext. has(" disableVideoModule" ) && gradle. ext. disableVideoModule;
1515}
1616
17+ def deployArtifacts () {
18+ return gradle. ext != null && gradle. ext. has(" deployArtifacts" ) && gradle. ext. deployArtifacts;
19+ }
20+
1721android {
1822 compileSdkVersion rootProject. ext. android. compileSdkVersion
1923 buildToolsVersion rootProject. ext. android. buildToolsVersion
2024
2125 if (usingCMakeCompile()) {
22- ndkVersion " 23.1.7779620 "
26+ ndkVersion rootProject . ext . android . ndkVersion
2327 }
2428
2529 defaultConfig {
@@ -77,7 +81,7 @@ android {
7781 externalNativeBuild {
7882 cmake {
7983 path ' src/main/jni/CMakeLists.txt'
80- version " 3.22.1 "
84+ version rootProject . ext . android . cmakeVersion
8185 }
8286 }
8387 }
@@ -101,10 +105,94 @@ android {
101105 sourceCompatibility JavaVersion . VERSION_1_8
102106 targetCompatibility JavaVersion . VERSION_1_8
103107 }
104- namespace ' org.wysaid.library'
108+
109+ namespace = ' org.wysaid.library'
105110}
106111
107112dependencies {
108113 implementation fileTree(dir : ' libs' , include : [' *.jar' ])
109114 implementation ' androidx.appcompat:appcompat:' + rootProject. ext. android. appcompatX
110115}
116+
117+ if (deployArtifacts()) {
118+ apply plugin : ' maven-publish'
119+
120+ def siteUrl = ' https://github.com/wysaid/android-gpuimage-plus'
121+ def gitUrl = ' https://github.com/wysaid/android-gpuimage-plus.git'
122+ group = " org.wysaid"
123+ version = rootProject. ext. android. versionName
124+
125+ publishing {
126+ publications {
127+ release(MavenPublication ) {
128+ artifactId = ' gpuimage-plus'
129+ groupId = ' org.wysaid'
130+ version = rootProject. ext. android. versionName
131+
132+ afterEvaluate {
133+ from components. release
134+ // artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")
135+ }
136+
137+ pom {
138+ name = ' gpuimage-plus'
139+ description = ' A C++ & Java library for Image/Camera/Video filters.'
140+ url = siteUrl
141+
142+ developers {
143+ developer {
144+ id = ' wysaid'
145+ name = ' Wang Yang'
146+ email = ' wysaid@gmail.com'
147+ }
148+ }
149+
150+ scm {
151+ connection = gitUrl
152+ developerConnection = gitUrl
153+ url = siteUrl
154+ }
155+
156+ licenses {
157+ license {
158+ name = ' The MIT License'
159+ url = ' https://github.com/wysaid/android-gpuimage-plus/blob/master/LICENSE'
160+ }
161+ }
162+ }
163+ }
164+ }
165+ repositories {
166+ maven {
167+ name = " local_repo"
168+ url = gradle. ext. localRepoDir
169+ // credentials {
170+ // username = gradle.ext.repoUsername
171+ // password = gradle.ext.repoPassword
172+ // }
173+ }
174+ }
175+ }
176+
177+ task sourcesJar(type : Jar ) {
178+ from android. sourceSets. main. java. srcDirs
179+ classifier = ' sources'
180+ }
181+
182+ task javadoc(type : Javadoc ) {
183+ source = android. sourceSets. main. java. srcDirs
184+ classpath + = project. files(android. getBootClasspath(). join(File . pathSeparator))
185+ }
186+
187+ task javadocJar(type : Jar , dependsOn : javadoc) {
188+ classifier = ' javadoc'
189+ from javadoc. destinationDir
190+ }
191+
192+ artifacts {
193+ archives javadocJar
194+ archives sourcesJar
195+ }
196+
197+ }
198+
0 commit comments