Comments (14)
@zeng1990java 项目中是否有指定的flavor呢?有的话需要配置一下..例如:
freeline {
hack true
productFlavor "dev"
}
from freeline.
有,
productFlavors {
fir {
}
}
没看懂你说要配置什么
from freeline.
@zeng1990java 你们平时的打包命令是什么呢?比如如果是gradlew.bat assembleFirDebug
的话,则flavor为Fir,则需要配置为:
freeline {
hack true
productFlavor "fir"
}
from freeline.
多谢,成功了,但是耗时还是一样的,看输出主要是install apk和clean build task和耗时很多,你看正常吗
[-][read_project_info_task] finished. in 4.9s
[-][generate_file_stat_task] finished. in 0.0s
[-][gradle_clean_build_task] finished. in 17.5s
[-][clean_all_cache_task] finished. in 0.0s
[-][install_apk_task] finished. in 15.5s
[-][build_base_resource_task] finished. in 0.5s
[-][generate_project_info_task] finished. in 0.0s
from freeline.
@zeng1990java 你可以修改一下代码再执行一下python freeline.py
看下。
freeline并不加速全量编译,主要是加速增量编译。在增量编译前,需要有一个全量编译的底包作为基线包。经过一次全量编译后,再执行python freeline.py
就会进行增量编译了。如果遇见build.gradle
以及AndroidManifest.xml
之类的修改,freeline会自动执行全量编译重新打基线包。
from freeline.
zxbdeMBP:FreelineDemo zxb$ python freeline.py
[WARNING] check sync status failed, a clean build will be automatically executed.
[-][read_project_info_task] finished. in 4.6s
[-][generate_file_stat_task] finished. in 0.0s
[-][gradle_clean_build_task] finished. in 9.6s
[-][clean_all_cache_task] finished. in 0.0s
[-][install_apk_task] finished. in 13.9s
[-][build_base_resource_task] finished. in 0.4s
[-][generate_project_info_task] finished. in 0.0s
[DEBUG] --------------------------------------------------------
[DEBUG] Prepare tasks time: 0.3s
[DEBUG] Task engine running time: 28.1s
[DEBUG] Total time: 28.4s
[DEBUG] --------------------------------------------------------
新建了一个只有一个MainActiivty和一个Application的工程,不管有没有改代码,每次的执行结果基本都要28秒多,不用freeline的时候也是这么久,不知道是不是使用的姿势不对
from freeline.
@zeng1990java 看日志提示猜测你的目标设备上装了多个依赖freeline的app,这个会导致基线对齐失败重新打全量包。估计目标设备上还安装了freeline sample这个app,可以卸载掉后重新试试看。
from freeline.
对,我把其他使用了freeline的Demo项目删除后就是可以了,非常感谢你的解答 @lomanyong
from freeline.
@zeng1990java 方便的话在你们的项目试试,看看增量模式下,资源或代码修改耗时多少,跟你们原来相比如何
from freeline.
@charvenhe 集成了,小改动的话2秒以内。但是好像不支持打包的时候改包文件名称,需要注释掉如下代码
applicationVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
def outputDirPath = project.hasProperty('outputPath') ? outputPath : outputFile.parent
if (outputFile != null && outputFile.name.endsWith('.apk')) {
def fileName
if(project.hasProperty('outputPath')){
// 输出apk名称为Merchant_v1.0_SoftwareUpdate_release.apk
fileName = "Merchant_v${defaultConfig.versionName}_${variant.productFlavors[0].name}_${variant.buildType.name}.apk"
}else{
// 输出apk名称为Merchant_v1.0_2015-01-15_SoftwareUpdate_release.apk
fileName = "Merchant_v${defaultConfig.versionName}_${releaseTime()}_${variant.productFlavors[0].name}_${variant.buildType.name}.apk"
}
output.outputFile = new File(outputDirPath, fileName)
}
}
}
from freeline.
@zeng1990java ,apk path 你可以通过DSL指定
freeline {
...
apkPath "your apk path"
}
from freeline.
可以了,多谢 @charvenhe
from freeline.
@zeng1990java 不客气,可以在你们项目多试试,资源增量也试试看看有没问题
from freeline.
from freeline.
Related Issues (20)
- 我是先安装python2.7.9,然后安装你们github上的教程仔细来,然后点击android studio 上的freeline按钮,没反应.最最重要的是我用命令来执行python freeline.py多次还是和第一次执行的时间一样长,并且还没原始的run时间短?请教下怎么回事?
- WARNING: Configuration 'testCompile' is obsolete and has been replaced with 'testImplementation' and 'testApi'. It will be removed at the end of 2018. HOT 1
- Freeline 最新代码拉下来出错,无法下载1.0.0版本
- Freeline在Android Studio里面,无法搜索到,windows HOT 2
- gradle_tools.py 运行异常
- 不支持 Kotlin,一年没更新,卒。 HOT 3
- 好好的项目就这么凉了 HOT 3
- Jar Conflict about butterknife
- freeline提示No module named 'build_commands'无法运行 HOT 1
- 本地编译源代码,提示错误。com.antfortune.freeline:gradle:0.8.9-SNAPSHOT找不到
- Site offline
- 这么好的插件 怎么就凉了 HOT 3
- 纪念一下
- 与viewBinding 冲突 HOT 2
- Custom task is not recognized by jenkins
- JavaPoet Version collision With ViewBinding
- cannot use freeline in Android Studio 4.1.2, how to adapt Android Studio 4.1.2? HOT 2
- On Mac M1 ,Newest AndroidStudio "Could not find com.antfortune.freeline:gradle:0.8.8" HOT 1
- abnormal link
- 希望能够提供一个样例项目,第一步就配置不过去
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from freeline.