Qihoo360/RePlugin 简单项目构建
来源:互联网 发布:大乐透 简单公式算法 编辑:程序博客网 时间:2024/06/06 00:55
本示例基于Qihoo360/RePlugin tag v2.2.0 GIT地址
新建2个项目在同一个工程里面app,appplugin
主项目的build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.3.3' classpath 'com.qihoo360.replugin:replugin-host-gradle:2.2.0' classpath 'com.qihoo360.replugin:replugin-plugin-gradle:2.2.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }}allprojects { repositories { jcenter() }}task clean(type: Delete) { delete rootProject.buildDir}
app/build.gradle 配置如下
apply plugin: 'com.android.application'android { compileSdkVersion 26 buildToolsVersion "26.0.0" defaultConfig { applicationId "energy.trinabess.com.retest" minSdkVersion 14 targetSdkVersion 26 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } }}apply plugin: 'replugin-host-gradle'repluginHostConfig { useAppCompat =true countNotTranslucentStandard =6 countNotTranslucentSingleTop =2 countNotTranslucentSingleTask =3 countNotTranslucentSingleInstance =2}dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:26.+' compile 'com.android.support.constraint:constraint-layout:1.0.2' testCompile 'junit:junit:4.12' compile 'com.qihoo360.replugin:replugin-host-lib:2.2.0'}
appplugin/build.gradle 配置如下
apply plugin: 'com.android.application'android { compileSdkVersion 26 buildToolsVersion "26.0.0" defaultConfig { applicationId "energy.trinabess.com.appplugin" minSdkVersion 14 targetSdkVersion 26 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } }}dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:26.+' compile 'com.android.support.constraint:constraint-layout:1.0.2' testCompile 'junit:junit:4.12' compile 'com.qihoo360.replugin:replugin-plugin-lib:2.2.0'}// 这个plugin需要放在android配置之后,因为需要读取android中的配置项apply plugin: 'replugin-plugin-gradle'repluginPluginConfig { //插件名 pluginName = "appplugin" //宿主app的包名 hostApplicationId = "energy.trinabess.com.retest" //宿主app的启动activity hostAppLauncherActivity = "energy.trinabess.com.appplugin.MainActivity"}
同时appplugin/AndroidManifest.xml 配置如下
<meta-data android:name="com.qihoo360.plugin.name" android:value="appplugin" /> <meta-data android:name="com.qihoo360.plugin.version.ver" android:value="100" />
同时也要给予一些基本权限给予主项目:
<!-- ======= REPLUGIN ======= --> <!-- SDK Only (4Stats)。也是“常用的”几个权限 --> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" />
至此项目基本配置完成,可以运行项目了。
开始Replugin之旅!!!!!!!!!!!!!!!
阅读全文
0 0
- Qihoo360/RePlugin 简单项目构建
- 基于MySQL协议的数据库中间层项目 Qihoo360 / Atlas
- 使用Ant构建简单项目
- 使用Ant构建简单项目
- Replugin Demo的简单使用与分析(一)
- Replugin Demo的简单使用与分析(二)
- maven构建struts2+spring项目简单实例
- Maven构建一个简单的Java项目
- Maven构建简单的多模块项目
- eclipse maven 构建简单的web项目
- Eclipse+Maven构建简单Web项目
- maven实践 简单的maven项目构建
- Maven构建简单的多模块项目
- Maven构建简单的多模块项目
- 使用Gradle构建简单Java项目
- Maven构建简单的多模块项目
- Maven简单、快速构建spring mvc项目
- 使用Ant构建简单的java项目
- 使用QQ企业邮箱465端口发送邮件失败
- 在Windows上部署python开发环境
- Android开发,自定义View的学习合集
- CAD高版本转低版本怎么转好
- 解决输入框和按钮不在同一行的问题
- Qihoo360/RePlugin 简单项目构建
- 机器视觉专栏(一)opencv基础操作
- BZOJ 2901: 矩阵求和 前缀和
- 题目1046:求最大值
- MyBatis笔记
- Hadoop 2.7.3-Kerberos认证
- androidstudio Parcelable
- 动态内存开辟(malloc calloc realloc)
- 关于dorado studio5.4启动后未自动打开浏览器问题解决