Skip to content

Commit

Permalink
0.0.5 代码结构调整,增加新功能
Browse files Browse the repository at this point in the history
Signed-off-by: wangkunlin <[email protected]>
  • Loading branch information
wangkunlin committed May 15, 2018
1 parent e818737 commit 7f2a8a5
Show file tree
Hide file tree
Showing 21 changed files with 654 additions and 279 deletions.
6 changes: 6 additions & 0 deletions CHANGE_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@

## 0.0.4 支持增量构建
增加了对 project 的增量构建

## 0.0.5 增加一些功能
1. application 节点支持移除
2. 新增 activity 节点属性的 增删改
3. application 以及 activity 支持配置 meta-data
4. meta-data 配置若在 Manifest 中找不到则自动创建,节点支持移除,支持 rename
45 changes: 38 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.wkl.manifest.editor:plugin:0.0.4'
classpath 'com.wkl.manifest.editor:plugin:0.0.5'
}
}
```
Expand All @@ -27,6 +27,7 @@ apply plugin: 'com.wkl.manifest.editor'
editManifest {
application {
// remove true // 支持 移除 application
delAttr 'roundIcon'
// 删除网络配置
delAttr 'networkSecurityConfig'
Expand All @@ -35,12 +36,25 @@ editManifest {
// 使 release apk 具有 debug 能力
addAttr 'debuggable', 'true'
// ...
}
activity {
// 可以是全限定名,也可以省略包名
name '.MainActivity'
remove true
metaData { // 若不存在,则自动创建
// remove true // 支持移除
name 'com.wkl.app.metadata.test'
value 'app_test_metadata'
}
activity { // 由 application 平级,移动到 application 子级
// 可以是全限定名,也可以省略包名
name '.MainActivity'
// remove true
// 支持属性的 增删改
addAttr 'theme', '@style/AppTheme'
metaData { // 同上
name 'com.wkl.activity.metadata.test'
value 'activity_test_metadata'
}
}
}
}
```
Expand All @@ -53,8 +67,25 @@ method | desc
delAttr(name)|删除指定属性
modAttr(name, value)|修改指定属性
addAttr(name, value)|增加一个属性
remove(remove)|移除节点
metaData(closure)|配置 meta-data
### activity 节点
删除 activity

method | desc
-----|-----
delAttr(name)|删除指定属性
modAttr(name, value)|修改指定属性
addAttr(name, value)|增加一个属性
remove(remove)|移除节点
metaData(closure)|配置 meta-data
### meta-data 节点
method | desc
-----|-----
name(name)|指定 meta-data 的 name
rename(name)|重命名 meta-data
value(value)|设置 meta-data 的 value
resource(resource)|设置 meta-data 的 resource
remove(remove)|移除节点

## 兼容
理论上支持 com.android.tools.build:gradle:2.2.0 及以上版本,已经适配了 3.1.1
Expand Down
18 changes: 14 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,21 @@ editManifest {
modAttr 'allowBackup', 'false'
addAttr 'supportsRtl', 'false'
addAttr 'debuggable', 'true'
}

activity {
name '.MainActivity'
remove true
activity {
name '.MainActivity'
addAttr 'theme', '@style/AppTheme'

metaData {
name 'com.wkl.activity.metadata.test'
value 'activity_test_metadata'
}
}

metaData {
name 'com.wkl.app.metadata.test'
value 'app_test_metadata'
}
}
}

Expand Down
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
buildscript {

repositories {
// maven {
// url uri("./repo")
// }
jcenter()
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'

classpath 'com.wkl.manifest.editor:plugin:0.0.4'
classpath 'com.wkl.manifest.editor:plugin:0.0.5'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
11 changes: 10 additions & 1 deletion maven.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@ apply plugin: 'maven-publish'
apply plugin: 'java'

group = 'com.wkl.manifest.editor'
version = '0.0.4'
version = '0.0.5'

//
//uploadArchives {
// repositories {
// mavenDeployer {
// repository(url: uri("../repo"))
// }
// }
//}

def siteUrl = 'https://github.com/wangkunlin/EditManifestPlugin' // 项目的主页
def gitUrl = '[email protected]:wangkunlin/EditManifestPlugin.git' // Git仓库的url
Expand Down
170 changes: 0 additions & 170 deletions plugin/src/main/java/com/wkl/manifest/Processer.java

This file was deleted.

Loading

0 comments on commit 7f2a8a5

Please sign in to comment.