| | |
| | | apply from: path |
| | | } |
| | | |
| | | applyGradle("${rootPath}/utils") |
| | | applyGradle("${channelPath}/build") |
| | | applyGradle("${rootPath}/utils")//工具脚本 |
| | | applyGradle("${channelPath}/build")//渠道脚本 |
| | | |
| | | Properties localProp = loadProperties('local') |
| | | Properties channelProp = loadProperties("${channelPath}/config") |
| | | Properties localProp = loadProperties('local')//本地配置 |
| | | Properties channelProp = loadProperties("${channelPath}/config")//渠道所属的配置 |
| | | |
| | | def outPutPath = localProp.getProperty("OUTPUT_PATH")//工程sdk输出路径 |
| | | |
| | | //当前渠道所应用的插件名 |
| | | def plugins = channelProp.getProperty("PLUGINS").split(';') |
| | | |
| | | //插件脚本 |
| | | plugins.each { |
| | | applyGradle("${rootPath}/plugins/${it}/build") |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | android.libraryVariants.all { variant -> |
| | | variant.outputs.all { |
| | | outputFileName = "library-${buildType.name}-${CHANNEL_NAME}.aar" |
| | | } |
| | | } |
| | | |
| | | //拷贝清单文件作为unity直接使用 |
| | | task copyManifest(type: Copy) { |
| | | dependsOn 'assembleRelease' |
| | | from zipTree("build/outputs/aar/library-release-${CHANNEL_NAME}.aar") |
| | | include "AndroidManifest.xml" |
| | | into "${outPutPath}\\${CHANNEL_NAME}\\" |
| | | } |
| | | |
| | | //执行打包任务以及拷贝到外部 |
| | | task assembleAndCopySdk(type: Copy) { |
| | | dependsOn copyManifest |
| | | from "build/outputs/aar/" |
| | | include "library-release-${CHANNEL_NAME}.aar" |
| | | into "${outPutPath}\\${CHANNEL_NAME}\\libs\\" |
| | | } |
| | | |
| | | dependencies { |
| | | implementation 'androidx.appcompat:appcompat:1.2.0' |
| | | implementation 'com.google.android.material:material:1.2.1' |