lwb
2020-11-19 7d62c45726746fd3a4e9360642e81d7da6d76757
SdkProject/library/build.gradle
@@ -112,32 +112,51 @@
    }
}
//拷贝清单文件作为unity直接使用
//拷贝清单文件
task copyDebugManifest(type: Copy) {
    from zipTree("build/outputs/aar/library-debug-${CHANNEL_NAME}.aar")
    include "AndroidManifest.xml"
    into "${outPutPath}\\${CHANNEL_NAME}\\debug"
}
task copyManifest(type: Copy) {
    dependsOn 'assembleRelease'
    dependsOn 'copyDebugManifest'
    from zipTree("build/outputs/aar/library-release-${CHANNEL_NAME}.aar")
    include "AndroidManifest.xml"
    into "${outPutPath}\\${CHANNEL_NAME}\\"
    into "${outPutPath}\\${CHANNEL_NAME}\\release"
}
task copyDebugSdk(type: Copy) {
    from "build/outputs/aar/"
    include "library-debug-${CHANNEL_NAME}.aar"
    into "${outPutPath}\\${CHANNEL_NAME}\\debug\\libs\\"
}
//执行打包任务以及拷贝到外部
task assembleAndCopySdk(type: Copy) {
    dependsOn copyManifest
    delete "${outPutPath}\\${CHANNEL_NAME}"
    dependsOn 'assembleMerger'
//    dependsOn copyManifest
    dependsOn copyDebugSdk
    from "build/outputs/aar/"
    include "library-release-${CHANNEL_NAME}.aar"
    into "${outPutPath}\\${CHANNEL_NAME}\\libs\\"
    into "${outPutPath}\\${CHANNEL_NAME}\\release\\libs\\"
}
dependencies {
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.2.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.3'
    implementation 'androidx.navigation:navigation-fragment:2.3.1'
    implementation 'androidx.navigation:navigation-ui:2.3.1'
    testImplementation 'junit:junit:4.13.1'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.2.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    implementation 'androidx.navigation:navigation-fragment:2.3.1'
    implementation 'androidx.navigation:navigation-ui:2.3.1'
    implementation 'com.github.pqpo:Log4a:1.4.2@aar'
    implementation files('libs/unity-classes.jar')
    implementation fileTree(dir: 'libs', include: ['*.jar'], exclude: ['unity-classes.jar'])
    compileOnly files('libs/unity-classes.jar')
}