SVN以及SVN China,以及组件化
SVN介绍以及SVN China介绍
SVN是subversion的缩写,是一个开放源代码的版本控制系统,通过采用分支管理系统的高效管理,简而言之就是用于多个人共同开发同一个项目,实现共享资源,实现最终集中式的管理
SVN China相当于服务器,可以将项目提交上去,也可以通过版本库URL下载项目,修改了项目再提交(可以文件右击提交,也可以Studio里提交),下载的更新最新版本(先更新最新版本再修改提交,不然冲突)
组件化
为什么组件化?
随着APP版本不断的迭代,新功能的不断增加,业务也会变的越来越复杂,APP业务模块的数量有可能还会继续增加,而且每个模块的代码也变的越来越多,这样发展下去单一工程下的APP架构势必会影响开发效率,增加项目的维护成本,每个工程师都要熟悉如此之多的代码,将很难进行多人协作开发,而且Android项目在编译代码的时候电脑会非常卡,又因为单一工程下代码耦合严重,每修改一处代码后都要重新编译打包测试,导致非常耗时,最重要的是这样的代码想要做单元测试根本无从下手,所以必须要有更灵活的架构代替过去单一的工程架构。
组件化模块配置
Project:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
plugins {
id "calces.appconfig" version "1.0.11"
}
//calces组件化配置
appConfig{
//debug测试模式->开发阶段为true->各个子模块单独运行测试
debugEnable false
//组件化架构中,第三层不同业务路基组件
apps{
app{
modules ':news',':user'
}
}
modules{
//新闻资讯
news {
name ':news'
mainActivity ".MainActivity"
applicationId "com.example.news"
isRunAlone false
//是否可以单独运行
}
//用户
user {
name ':user'
mainActivity ".MainActivity"
applicationId "com.example.user"
isRunAlone false
//是否可以单独运行
}
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
news和user
apply plugin: 'calces.modules'
android {
compileSdkVersion 28
buildToolsVersion "29.0.1"
defaultConfig {
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}