first commit
This commit is contained in:
@@ -1,85 +1,98 @@
|
||||
if (isRelease) { // 如果是发布版本时,各个模块都不能独立运行
|
||||
apply plugin: 'com.android.library'
|
||||
} else {
|
||||
apply plugin: 'com.android.application'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion app_android.compileSdkVersion
|
||||
buildToolsVersion app_android.buildToolsVersion
|
||||
defaultConfig {
|
||||
// applicationId app_appid.personal
|
||||
if (!isRelease) { // 如果是集成化模式,不能有applicationId
|
||||
applicationId app_appid.personal // 组件化模式能独立运行才能有applicationId
|
||||
}
|
||||
|
||||
minSdkVersion app_android.minSdkVersion
|
||||
targetSdkVersion app_android.targetSdkVersion
|
||||
versionCode app_android.versionCode
|
||||
versionName app_android.versionName
|
||||
testInstrumentationRunner app_android.testInstrumentationRunner
|
||||
|
||||
// 这个方法接收三个非空的参数,第一个:确定值的类型,第二个:指定key的名字,第三个:传值(必须是String)
|
||||
// 为什么需要定义这个?因为src代码中有可能需要用到跨模块交互,如果是组件化模块显然不行
|
||||
// 切记:不能在android根节点,只能在defaultConfig或buildTypes节点下
|
||||
buildConfigField("boolean", "isRelease", String.valueOf(isRelease))
|
||||
|
||||
/// 在gradle文件中配置选项参数值(用于APT传参接收)
|
||||
// 同学们注意:切记:必须写在defaultConfig节点下
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
arguments = [moduleName: project.getName(), packageNameForAPT: packageNameForAPT]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
// 配置资源路径,方便测试环境,打包不集成到正式环境
|
||||
sourceSets {
|
||||
main {
|
||||
if (!isRelease) {
|
||||
// 如果是组件化模式,需要单独运行时
|
||||
manifest.srcFile 'src/main/debug/AndroidManifest.xml'
|
||||
} else {
|
||||
// 集成化模式,整个项目打包apk
|
||||
manifest.srcFile 'src/main/AndroidManifest.xml'
|
||||
java {
|
||||
// release 时 debug 目录下文件不需要合并到主工程
|
||||
exclude '**/debug/**'
|
||||
}
|
||||
/*resources {
|
||||
exclude '**/ debug/**'}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
/*implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'*/
|
||||
|
||||
// 循环引入第三方库
|
||||
app_dependencies.each {k, v ->implementation v}
|
||||
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'androidx.test:runner:1.2.0'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
|
||||
// 公共基础库
|
||||
implementation project(":common")
|
||||
|
||||
// 注解模块
|
||||
implementation project(":arouter_annotation")
|
||||
|
||||
// 使用注解处理器
|
||||
// 注解处理器
|
||||
annotationProcessor project(':arouter_compiler')
|
||||
}
|
||||
if (isRelease) { // 如果是发布版本时,各个模块都不能独立运行
|
||||
apply plugin: 'com.android.library'
|
||||
} else {
|
||||
apply plugin: 'com.android.application'
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'com.fisherbone.fuzhu.personal'
|
||||
compileSdk app_android.compileSdkVersion
|
||||
compileSdkVersion app_android.compileSdkVersion
|
||||
buildToolsVersion app_android.buildToolsVersion
|
||||
defaultConfig {
|
||||
// applicationId app_appid.personal
|
||||
if (!isRelease) { // 如果是集成化模式,不能有applicationId
|
||||
applicationId app_appid.personal // 组件化模式能独立运行才能有applicationId
|
||||
}
|
||||
|
||||
minSdk app_android.minSdkVersion
|
||||
minSdkVersion app_android.minSdkVersion
|
||||
targetSdk app_android.targetSdkVersion
|
||||
targetSdkVersion app_android.targetSdkVersion
|
||||
versionCode app_android.versionCode
|
||||
versionName app_android.versionName
|
||||
testInstrumentationRunner app_android.testInstrumentationRunner
|
||||
|
||||
// 这个方法接收三个非空的参数,第一个:确定值的类型,第二个:指定key的名字,第三个:传值(必须是String)
|
||||
// 为什么需要定义这个?因为src代码中有可能需要用到跨模块交互,如果是组件化模块显然不行
|
||||
// 切记:不能在android根节点,只能在defaultConfig或buildTypes节点下
|
||||
buildConfigField("boolean", "isRelease", String.valueOf(isRelease))
|
||||
|
||||
/// 在gradle文件中配置选项参数值(用于APT传参接收)
|
||||
// 同学们注意:切记:必须写在defaultConfig节点下
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
arguments = [moduleName: project.getName(), packageNameForAPT: packageNameForAPT]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
// 配置资源路径,方便测试环境,打包不集成到正式环境
|
||||
sourceSets {
|
||||
main {
|
||||
if (!isRelease) {
|
||||
// 如果是组件化模式,需要单独运行时
|
||||
manifest.srcFile 'src/main/debug/AndroidManifest.xml'
|
||||
} else {
|
||||
// 集成化模式,整个项目打包apk
|
||||
manifest.srcFile 'src/main/AndroidManifest.xml'
|
||||
java {
|
||||
// release 时 debug 目录下文件不需要合并到主工程
|
||||
exclude '**/debug/**'
|
||||
}
|
||||
/*resources {
|
||||
exclude '**/ debug/**'}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
buildConfig true
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
/*implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'*/
|
||||
|
||||
// 循环引入第三方库
|
||||
app_dependencies.each {k, v ->implementation v}
|
||||
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'androidx.test:runner:1.2.0'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
|
||||
// 公共基础库
|
||||
implementation project(":common")
|
||||
|
||||
// 注解模块
|
||||
implementation project(":arouter_annotation")
|
||||
|
||||
// 使用注解处理器
|
||||
// 注解处理器
|
||||
annotationProcessor project(':arouter_compiler')
|
||||
}
|
||||
|
||||
@@ -1,23 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.fisherbone.fuzhu.personal">
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/atom_logo"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/atom_logo"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<activity android:name="com.fisherbone.fuzhu.personal.Personal_Main2Activity"></activity>
|
||||
<activity android:name="com.fisherbone.fuzhu.personal.Personal_MainActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name="com.fisherbone.fuzhu.personal.debug.Personal_DebugActivity" />
|
||||
</application>
|
||||
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.fisherbone.fuzhu.personal">
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/atom_logo"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/atom_logo"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<activity android:name="com.fisherbone.fuzhu.personal.Personal_Main2Activity"
|
||||
android:exported="false"></activity>
|
||||
<activity android:name="com.fisherbone.fuzhu.personal.Personal_MainActivity"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name="com.fisherbone.fuzhu.personal.debug.Personal_DebugActivity"
|
||||
android:exported="false" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
Reference in New Issue
Block a user