Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

插件中pluginMode有没有可动态设置的方案 #13

Closed
assdd215 opened this issue Aug 5, 2019 · 2 comments
Closed

插件中pluginMode有没有可动态设置的方案 #13

assdd215 opened this issue Aug 5, 2019 · 2 comments

Comments

@assdd215
Copy link

assdd215 commented Aug 5, 2019

开发过程中经常需要插件工程独立运行,此时需要将pluginMode的值设置为false
开发完成后希望在宿主工程中运行,编译时又需要将pluginMode的值改为true
请问有没有什么方案可以动态设置该值,在debug时自动判断为false,其他方式打包判断为true

@zjupure
Copy link
Collaborator

zjupure commented Aug 8, 2019

pluginMode是一个配置项,熟悉gradle脚本的话,你可以设置一个函数给它,gradle执行task时动态获取运行的值

def buildPlugin = project.gradle.startParameter.taskNames.contains("installDebugPlugin") // you can define any function here to read config from you build parameters and decide the mode
neptune {
    pluginMode = buildPlugin      // In plugin apk build mode
    packageId = 0x30       // The packge id of Resources
    hostDependencies = "{group1}:{artifact1};{group2}:{artifact2}" // host app resources dependencies
}

@assdd215
Copy link
Author

感谢,已解决问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants