插件框架small搭建
常用命令收集(mac系统)
./gradlew cleanLib -q //清除公共库
./gradlew buildLib -q -Dbundle.arch=x86 //编译公共库(86平台)
./gradlew cleanBundle -q //清空业务单元
./gradlew buildBundle -q -Dbundle.arch=x86 //编译业务单元
./gradlew -p 组件名 assembleRelease //单独编译某一个组件
问题1.
Error:Dependency MySmall2:lib.style:unspecified on project app.main resolves to an APK archive which is not supported as a compilation dependency. File: /Users/lxrent/Downloads/MySmall2/lib.style/build/outputs/apk/lib.style-release-unsigned.apk
答案看这里:
https://blog.csdn.net/u012336923/article/details/48049479
问题2.
抽取公共组件lib.style的时候遇到一个错误,如下log?
./gradlew buildLib -q
[Small] building library 1 of 3 - app (0x7f)
[Small] building library 2 of 3 - lib.style (0x79)
[lib.style] split library res files... [ OK ]
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':lib.style:processReleaseResources'.
> No support deleting resources on lib.* now
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
可以去看iss53.
https://github.com/wequick/Small/issues/53
问题3.
是关于版本适配的问题了,如下图的log ?
classpath 'com.android.tools.build:gradle:2.3.1' //目前版本适配还没有道3.0.1,所以建议使用已经适配的版本.
下面是根目录完整的build.gradle文件,其他问题目前还没有碰到.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'net.wequick.tools.build:gradle-small:1.3.0-beta6'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
apply plugin: 'net.wequick.small'
small {
aarVersion = '1.3.0-beta6'
}
small {
buildToAssets = false
strictSplitResources = false
android {
compileSdkVersion = 26
buildToolsVersion = "25.0.2"
supportVersion = "25.1.0"
}
}
ext {
// SDK And Tools
minSdkVersion = 19
targetSdkVersion = 23
compileSdkVersion = 23
buildToolsVersion = '25.1.0'
//Dependencies
supportLibraryVersion = '23.2.1'
}