Comments (33)
不用,只是我自己用的是3.5而已
from excludeaar.
具体用法怎么用的呢,我想删除两个aar包中的某个冲突的包下面的文件,应该怎么用呢
from excludeaar.
你按照我demo中的方法配置就行了。
1,你把:library-exclude-aar工程拷贝到你的项目中
2,把:library-exclude-aar中的BaiduLBS_Android_release.aar替换成你自己的aar包
3,把:library-exclude-aar中build.gradle文件名也改成你自己aar包的名称
4,然后在:library-exclude-aar中的excludeAar.gradle文件里面配置过滤规则
5,在你自己的主工程 implementation project(configuration: 'exclude', path: ':library-exclude-aar')
6,最后运行excludeAar任务执行过滤
ok!完成
from excludeaar.
我后面把它写成一个gradle插件吧。^_^
from excludeaar.
library-exclude-aar这个放到我项目中那个目录下面呢
from excludeaar.
如果你严格按照我上面说的步骤,你就应该放在根目录下面(因为':library-exclude-aar'这个path对应的就是这儿),但是要记住library-exclude-aar这个工程也要在setting.gradle注册一下
from excludeaar.
我要过滤的是xwalk_core_library_release.aar,这个aar中的org.chromium这个包,我应该在library-exclude-aar中的excludeAar.gradle中改哪些东西?
from excludeaar.
//需要过滤的包名
def excludePackages = ['com.baidu']
//需要过滤的类(需要全类名)
def excludeClasses = []
在过滤包的地方填入org.chromium就可以了
from excludeaar.
from excludeaar.
你要在setting.gradle注册一下
from excludeaar.
配置完了之后还要运行一下excludeAar任务额
from excludeaar.
from excludeaar.
你多放了一级,改成:library-exclude-aar,注:我有2级是因为我放在libraries下面
from excludeaar.
麻烦问下有啥联系方式吗?这样太费劲了
from excludeaar.
运行一下就可以了,生成过滤包就行了,以后就不用管了。
from excludeaar.
from excludeaar.
from excludeaar.
from excludeaar.
from excludeaar.
你自己用as新建一个包含aar的module吧,不要复制我的module了,这样路径就不会错了
然后你在把excludeAar.gradle这个脚本拷贝过滤,其实主要功能就是这个脚本完成的
from excludeaar.
然后你在你新建的module中找到build.gradle文件,
添加 apply from: "${project.projectDir.absoluteFile}\excludeAar.gradle" 这句。(就是把excludeAar.gradle引入的意思)
注意excludeAar.gradle的路径不要放错了和build.gradle文件平级的。
from excludeaar.
from excludeaar.
谁要你到这个包的,ε=(´ο`*)))
我脚本里面没有导入任何包
from excludeaar.
from excludeaar.
删了应该就可以了
from excludeaar.
我擦,自己导的吗?我直接复制过来的
from excludeaar.
行吧,希望可以解决你的问题,如果有帮到你就star一下,后面我会改成插件的形式,然后支持多架包过滤
from excludeaar.
好了是好了,但是我发现我这个是aar中的Jar里面的一个包,那样运行后并不能删除,唉
from excludeaar.
那是因为你的aar包不是release打出来的。我写的脚本只能过滤classes.jar里面的包和class。并不能过滤其它的,因为我不可能知道你的aar中还可能有拿些其它名称的jar(如:你的xwalk_core_library.jar)
from excludeaar.
嗯嗯,但是还是感谢
from excludeaar.
如果是realease打出来的,aar中的三方jar会被合并到classesjar中,像这样:
不过你的需求我知道,我会后面支持对aar中自定jar包名称进行过滤,而不默认只对classes.jar过滤。
from excludeaar.
from excludeaar.
感谢,已经完美解决了我的问题,改了你的脚本
from excludeaar.
Related Issues (20)
- 执行任务后,aar里面要过滤的包名是没看到了,但是点击as “运行”按钮,出现:Duplicate class cn.sirius.nga.BuildConfig found in modules jetified-exclude_GDTSDK_unionNormal-runtime.jar (exclude_GDTSDK_unionNormal.aar) and jetified-XXX_sdk_v3.1.0-runtime.jar (:XXX_sdk_v3.1.0:) HOT 9
- 先自动化检测主module跟放在libs/exclude文件夹内的aar文件之间存在的冲突包名,然后再过滤那些冲突的包名,这种该怎么实现呢? HOT 13
- 需要导出为aar的library中需要导入另外的aar,应该如何配置? HOT 3
- platform update
- 请问一下大佬,java.lang.NoClassDefFoundError 该怎么办 HOT 3
- 内部类好像去不掉 HOT 1
- 支持过滤aar里面res里面的文件吗? HOT 1
- 路径文件不存在
- jcenter不是要关闭服务了嘛?您可以换个仓库吗?
- 执行任务报错
- 请问下如果不想使用NamedDomainObjectContainer HOT 1
- 报错 Cannot add task 'unZip_jar_libchips' as a task with that name already exists.
- Task 'excludeAar_BaiduLBS_Android_debug' not found in root project 'ExcludeAar'.
- aar的使用方式是否需要修改 HOT 1
- 构建时合并AndroidManifest.xml出现org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; 前言中不允许有内容 HOT 4
- 不支持mac吗? HOT 2
- demo看不懂?怎么才能运行 HOT 1
- 编译不过
- 可以编译一个低版本gradle的包吗,你的gradle版本有点高 HOT 1
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 excludeaar.