Skip to content

Commit

Permalink
Merge pull request #2 from TestPlanB/master
Browse files Browse the repository at this point in the history
feat:修改maven地址,保持插件与api层版本号一致
  • Loading branch information
fushengzhong90 authored Dec 12, 2023
2 parents 088c994 + 21a90e0 commit ff54302
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 22 deletions.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ https://juejin.cn/post/7311343224546574346
### 编译引入插件
《声明》由于目前业务项目还在AGP版本还在7以下,所以当前仅支持7以下的插件,后续补充7以上的插件

todo 待上传地址
根目录build.gradle中配置插件
```
classpath 'cn.huolala:batteryplugin:1.0.2'
```
### gradle 配置
build.gradle里面添加插件依赖即可
使用module中build.gradle里面添加插件依赖即可
```
apply plugin: 'com.battery.plugins'
```

同时选择开启插桩的类型,见app 中build.gradle
```
BatteryHookConfig{
Expand All @@ -40,6 +44,12 @@ BatteryHookConfig{
}
```

使用module中添加aar依赖

```
implementation 'cn.huolala:batteryapi:1.0.2'
```

### 必要的框架初始化设置
#### step1

Expand Down Expand Up @@ -71,7 +81,7 @@ BatteryHookConfig{
)
```

#### step2
#### step2

设置自己需要的基准电源文件(power_profile.xml)

Expand Down
10 changes: 9 additions & 1 deletion README_English.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ Current support: location, Bluetooth, Alarm, PowerWakeLock, WifiWakeLock, Sensor

## Getting started
### Compile and import plugin
todo 待上传地址
firstly,you should import plugin in project build.gradle
```
classpath 'cn.huolala:batteryplugin:1.0.2'
```
secondly,import api aar in module build.gradle
```
implementation 'cn.huolala:batteryapi:1.0.2'
```

### gradle configuration
add this code in build.gradle
```
Expand Down
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ task clean(type: Delete) {
buildscript {
repositories {
maven {url uri('./repositories')}
google()
mavenCentral()

google()

}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.4'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10'
classpath 'cn.huolala.battryfinder:plugin:2.0.1'
classpath 'cn.huolala:batteryplugin:1.0.2'
}

}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ maven_group_id=cn.huolala
maven_res_artifact_id=batteryapi
maven_res_version=1.0.0

maven_plugin_artifact_id=battrycore
maven_plugin_artifact_id=batteryplugin
maven_plugin_version=1.0.0
13 changes: 1 addition & 12 deletions lib_battery_api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,7 @@ android {
}
}

uploadArchives {
repositories {
mavenDeployer {
repository(url: uri(maven_repository_url)) {
authentication(userName: maven_user_name, password: maven_password)
}
pom.groupId = maven_group_id
pom.artifactId = maven_res_artifact_id
pom.version = maven_res_version
}
}
}


dependencies {
implementation 'androidx.core:core-ktx:1.3.0'
Expand Down
6 changes: 3 additions & 3 deletions lib_battery_plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ uploadArchives {
mavenDeployer {
//本地Maven
repository(url: uri('../repositories'))
pom.groupId = 'cn.huolala.battryfinder'
pom.artifactId = 'plugin'
pom.version = '2.0.1'
pom.groupId = 'cn.huolala'
pom.artifactId = 'batteryplugin'
pom.version = '1.0.2'
}
}
}
Expand Down

0 comments on commit ff54302

Please sign in to comment.