Skip to content

Commit

Permalink
create: 创建 DevRetrofit module
Browse files Browse the repository at this point in the history
Former-commit-id: d83f14c
Former-commit-id: b3e041e
  • Loading branch information
afkT committed Jun 6, 2022
1 parent 5999f00 commit 6febc6c
Show file tree
Hide file tree
Showing 13 changed files with 141 additions and 1 deletion.
1 change: 1 addition & 0 deletions application/DevUtilsApp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ dependencies {
releaseImplementation project(':DevHttpCaptureCompilerRelease')

implementation project(':DevHttpManager')
implementation project(':DevRetrofit')

implementation project(':DevEnvironment')
kaptDebug project(':DevEnvironmentCompiler') // debugAnnotationProcessor
Expand Down
1 change: 0 additions & 1 deletion file/gradle/build/build_app_kotlin.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,5 @@ dependencies {
implementation project(':DevBaseMVVM')
implementation project(':DevEngine')
implementation project(':DevHttpCapture')
implementation project(':DevHttpManager')
implementation project(':DevWidget')
}
4 changes: 4 additions & 0 deletions file/gradle/versions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ ext {
dev_http_manager_versionCode : 101,
dev_http_manager_versionName : "1.0.1",

// DevRetrofit - Retrofit + Kotlin Coroutines 封装
dev_retrofit_versionCode : 100,
dev_retrofit_versionName : "1.0.0",

// DevWidget - 自定义 View UI 库
dev_widget_versionCode : 118,
dev_widget_versionName : "1.1.8",
Expand Down
1 change: 1 addition & 0 deletions lib/DevRetrofit/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
7 changes: 7 additions & 0 deletions lib/DevRetrofit/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Change Log
==========

Version 1.0.0 *(2022-06-XX)*
----------------------------

* Initial release
3 changes: 3 additions & 0 deletions lib/DevRetrofit/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@


## 摘要
40 changes: 40 additions & 0 deletions lib/DevRetrofit/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
apply from: rootProject.file(files.lib_app_kotlin_gradle)
apply plugin: 'kotlin-parcelize'

android.defaultConfig {
versionCode versions.dev_retrofit_versionCode
versionName versions.dev_retrofit_versionName
// DevRetrofit Module Version
buildConfigField "int", "DevRetrofit_VersionCode", "${versions.dev_retrofit_versionCode}"
buildConfigField "String", "DevRetrofit_Version", "\"${versions.dev_retrofit_versionName}\""
// DevApp Module Version
buildConfigField "int", "DevApp_VersionCode", "${versions.dev_app_versionCode}"
buildConfigField "String", "DevApp_Version", "\"${versions.dev_app_versionName}\""
}

// 是否发布版本
def isPublishing = false

dependencies {
// OkHttp3 网络请求框架 https://github.com/square/okhttp
api deps.lib.okhttp3
// Retrofit 网络请求库 https://github.com/square/retrofit
api deps.lib.retrofit

if (isPublishing) {
// 打包时使用
api deps.dev.dev_app_x
} else {
// 编译时使用
api project(':DevApp')
}
}

// gradlew clean
// gradlew install
// gradlew bintrayUpload
//apply from: rootProject.file(files.bintray_upload_android)
//apply from: rootProject.file(files.sonatype_upload_android)
if (isPublishing) {
apply from: rootProject.file(files.sonatype_upload_android)
}
Empty file.
10 changes: 10 additions & 0 deletions lib/DevRetrofit/project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#project
project.name=DevRetrofit
project.groupId=io.github.afkt
project.artifactId=DevRetrofit
project.packaging=aar
project.siteUrl=https://github.com/afkT/DevUtils
project.gitUrl=https://github.com/afkT/DevUtils.git

#javadoc
javadoc.name=DevRetrofit
2 changes: 2 additions & 0 deletions lib/DevRetrofit/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="dev.retrofit" />
69 changes: 69 additions & 0 deletions lib/DevRetrofit/src/main/java/dev/DevRetrofit.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package dev

import dev.retrofit.BuildConfig

/**
* detail: OkHttp 管理库 ( Retrofit 多 BaseUrl 管理、Progress 监听 )
* @author Ttt
* <p></p>
* GitHub
* @see https://github.com/afkT/DevUtils
* DevApp Api
* @see https://github.com/afkT/DevUtils/blob/master/lib/DevApp/README.md
* DevAssist Api
* @see https://github.com/afkT/DevUtils/blob/master/lib/DevAssist/README.md
* DevBase README
* @see https://github.com/afkT/DevUtils/blob/master/lib/DevBase/README.md
* DevBaseMVVM README
* @see https://github.com/afkT/DevUtils/blob/master/lib/DevBaseMVVM/README.md
* DevEngine README
* @see https://github.com/afkT/DevUtils/blob/master/lib/DevEngine/README.md
* DevHttpCapture Api
* @see https://github.com/afkT/DevUtils/blob/master/lib/DevHttpCapture/README.md
* DevHttpManager Api
* @see https://github.com/afkT/DevUtils/blob/master/lib/DevHttpManager/README.md
* DevJava Api
* @see https://github.com/afkT/DevUtils/blob/master/lib/DevJava/README.md
* DevWidget Api
* @see https://github.com/afkT/DevUtils/blob/master/lib/DevWidget/README_API.md
* DevEnvironment Api
* @see https://github.com/afkT/DevUtils/blob/master/lib/Environment
*/
object DevRetrofit {

// ============
// = 工具类版本 =
// ============

/**
* 获取 DevRetrofit 版本号
* @return DevRetrofit versionCode
*/
fun getDevRetrofitVersionCode(): Int {
return BuildConfig.DevRetrofit_VersionCode
}

/**
* 获取 DevRetrofit 版本
* @return DevRetrofit versionName
*/
fun getDevRetrofitVersion(): String {
return BuildConfig.DevRetrofit_Version
}

/**
* 获取 DevApp 版本号
* @return DevApp versionCode
*/
fun getDevAppVersionCode(): Int {
return BuildConfig.DevApp_VersionCode
}

/**
* 获取 DevApp 版本
* @return DevApp versionName
*/
fun getDevAppVersion(): String {
return BuildConfig.DevApp_Version
}
}
3 changes: 3 additions & 0 deletions lib/DevRetrofit/src/main/java/dev/retrofit/Temp.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package dev.retrofit

class Temp
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def libs = [
"DevEngine",
"DevHttpCapture",
"DevHttpManager",
"DevRetrofit",
"DevJava",
"DevWidget",
]
Expand Down

0 comments on commit 6febc6c

Please sign in to comment.