plugins { id 'com.android.library' id 'maven-publish' } android { namespace 'com.huantansheng.easyphotos' compileSdk 33 defaultConfig { minSdk 21 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } afterEvaluate { publishing { publications { //SDK Release 版本 sdkRelease(MavenPublication) { //这个的 Release 名称是可以随意进行定义的 // from components.release //关键是这个地方的值该如何配置的问题。 artifact("$buildDir/outputs/aar/${project.name}-release.aar") groupId = 'com.github.Tudie' artifactId = 'EasyPhotos' version = '3.1.7' } } } } dependencies { implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'com.google.android.material:material:1.8.0' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.5' androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'com.google.android.material:material:1.8.0' implementation 'androidx.recyclerview:recyclerview:1.3.0' implementation 'com.davemorrissey.labs:subsampling-scale-image-view-androidx:3.10.0' implementation 'com.github.chrisbanes:PhotoView:2.3.0' implementation 'com.github.dcendents:android-maven-gradle-plugin:2.0' }