Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xiaoxuan_i809
AndroidUtilCode
提交
2d09b624
A
AndroidUtilCode
项目概览
xiaoxuan_i809
/
AndroidUtilCode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
AndroidUtilCode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2d09b624
编写于
12月 30, 2019
作者:
B
Blankj
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
see 12/30 log
上级
5444390e
变更
20
隐藏空白更改
内联
并排
Showing
20 changed file
with
130 addition
and
79 deletion
+130
-79
.gitignore
.gitignore
+2
-1
CHANGELOG.md
CHANGELOG.md
+1
-0
buildSrc/src/main/groovy/Config.groovy
buildSrc/src/main/groovy/Config.groovy
+4
-4
config.json
config.json
+2
-2
feature/main/pkg/src/main/java/com/blankj/main/pkg/MainActivity.kt
...ain/pkg/src/main/java/com/blankj/main/pkg/MainActivity.kt
+1
-4
feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/feature/shadow/ShadowActivity.kt
.../com/blankj/utilcode/pkg/feature/shadow/ShadowActivity.kt
+1
-1
lib/utilcode/README-CN.md
lib/utilcode/README-CN.md
+7
-2
lib/utilcode/README.md
lib/utilcode/README.md
+5
-0
lib/utilcode/build.gradle
lib/utilcode/build.gradle
+22
-0
lib/utilcode/src/main/java/com/blankj/utilcode/util/ActivityUtils.java
...src/main/java/com/blankj/utilcode/util/ActivityUtils.java
+12
-0
lib/utilcode/src/main/java/com/blankj/utilcode/util/ApiUtils.java
...code/src/main/java/com/blankj/utilcode/util/ApiUtils.java
+3
-3
lib/utilcode/src/main/java/com/blankj/utilcode/util/JsonUtils.java
...ode/src/main/java/com/blankj/utilcode/util/JsonUtils.java
+8
-1
lib/utilcode/src/main/java/com/blankj/utilcode/util/LanguageUtils.java
...src/main/java/com/blankj/utilcode/util/LanguageUtils.java
+15
-13
lib/utilcode/src/main/java/com/blankj/utilcode/util/ResourceUtils.java
...src/main/java/com/blankj/utilcode/util/ResourceUtils.java
+14
-15
lib/utilcode/src/main/java/com/blankj/utilcode/util/SpanUtils.java
...ode/src/main/java/com/blankj/utilcode/util/SpanUtils.java
+2
-2
lib/utilcode/src/main/java/com/blankj/utilcode/util/ThreadUtils.java
...e/src/main/java/com/blankj/utilcode/util/ThreadUtils.java
+8
-0
plugin/api-gradle-plugin/.gitignore
plugin/api-gradle-plugin/.gitignore
+1
-2
plugin/api-gradle-plugin/src/main/java/com/blankj/api/ApiInfo.java
...i-gradle-plugin/src/main/java/com/blankj/api/ApiInfo.java
+4
-0
plugin/api-gradle-plugin/src/main/java/com/blankj/api/ApiTransform.groovy
...e-plugin/src/main/java/com/blankj/api/ApiTransform.groovy
+18
-18
plugin/api-gradle-plugin/src/test/java/com/blankj/api/ApiUtils.java
...-gradle-plugin/src/test/java/com/blankj/api/ApiUtils.java
+0
-11
未找到文件。
.gitignore
浏览文件 @
2d09b624
...
...
@@ -11,4 +11,5 @@ local.properties
/apk
*.phrof
/maven
/reports
\ No newline at end of file
/reports
*/reports
\ No newline at end of file
CHANGELOG.md
浏览文件 @
2d09b624
*
`19/12/08`
[add] Publish bus plugin v2.5.
*
`19/12/06`
[add] Publish api plugin v1.3.
*
`19/11/30`
[add] Publish bus plugin v2.4. Publish api plugin v1.2.
*
`19/11/28`
[add] Publish v1.26.0.
...
...
buildSrc/src/main/groovy/Config.groovy
浏览文件 @
2d09b624
...
...
@@ -15,7 +15,7 @@ class Config {
static
minSdkVersion
=
14
static
targetSdkVersion
=
28
static
versionCode
=
1
_026_001
static
versionName
=
'1.26.1'
// E.g. 1.9.72 => 1,009,072
static
versionName
=
'1.26.1
-alpha1
'
// E.g. 1.9.72 => 1,009,072
// lib version
static
gradlePluginVersion
=
'3.5.2'
...
...
@@ -26,8 +26,8 @@ class Config {
static
depConfig
=
[
/*Never delete this line*/
/*Generated by "config.json"*/
plugin_api_gradle_plugin
:
new
DepConfig
(
fals
e
,
true
,
":plugin:api-gradle-plugin"
),
plugin_bus_gradle_plugin
:
new
DepConfig
(
fals
e
,
true
,
":plugin:bus-gradle-plugin"
),
plugin_api_gradle_plugin
:
new
DepConfig
(
tru
e
,
true
,
":plugin:api-gradle-plugin"
),
plugin_bus_gradle_plugin
:
new
DepConfig
(
tru
e
,
true
,
":plugin:bus-gradle-plugin"
),
feature_mock
:
new
DepConfig
(
false
,
true
,
":feature:mock"
),
feature_launcher_app
:
new
DepConfig
(
true
,
true
,
":feature:launcher:app"
),
feature_main_app
:
new
DepConfig
(
false
,
true
,
":feature:main:app"
),
...
...
@@ -55,7 +55,7 @@ class Config {
// 本地上传成功之后 isApply = true 即可应用插件来调试,后续版本更新无需设置 isApply = false
// 发布版本的话把 isApply = false, useLocal = false,更新版本号,发布成功后 isApply = true 即可使用远程库版本
plugin_api
:
new
DepConfig
(
isApply:
true
,
useLocal:
false
,
pluginPath:
"com.blankj:api-gradle-plugin:1.3"
,
pluginId:
"com.blankj.api"
),
plugin_bus
:
new
DepConfig
(
isApply:
true
,
useLocal:
false
,
pluginPath:
"com.blankj:bus-gradle-plugin:2.
4
"
,
pluginId:
"com.blankj.bus"
),
plugin_bus
:
new
DepConfig
(
isApply:
true
,
useLocal:
false
,
pluginPath:
"com.blankj:bus-gradle-plugin:2.
5
"
,
pluginId:
"com.blankj.bus"
),
support_appcompat_v7
:
new
DepConfig
(
"com.android.support:appcompat-v7:$supportVersion"
),
support_design
:
new
DepConfig
(
"com.android.support:design:$supportVersion"
),
...
...
config.json
浏览文件 @
2d09b624
...
...
@@ -5,8 +5,8 @@
"pkgConfig"
:
[],
"proConfigDesc"
:
"proConfig 配置的是使用本地还是仓库,优先级低于 appConfig 和 pkgConfig"
,
"proConfig"
:
[
{
"isApply"
:
fals
e
,
"useLocal"
:
true
,
"localPath"
:
":plugin:api-gradle-plugin"
},
{
"isApply"
:
fals
e
,
"useLocal"
:
true
,
"localPath"
:
":plugin:bus-gradle-plugin"
},
{
"isApply"
:
tru
e
,
"useLocal"
:
true
,
"localPath"
:
":plugin:api-gradle-plugin"
},
{
"isApply"
:
tru
e
,
"useLocal"
:
true
,
"localPath"
:
":plugin:bus-gradle-plugin"
},
{
"isApply"
:
true
,
"useLocal"
:
true
,
"localPath"
:
":feature:mock"
},
{
"isApply"
:
true
,
"useLocal"
:
true
,
"localPath"
:
":feature:launcher:app"
},
{
"isApply"
:
true
,
"useLocal"
:
true
,
"localPath"
:
":feature:main:app"
},
...
...
feature/main/pkg/src/main/java/com/blankj/main/pkg/MainActivity.kt
浏览文件 @
2d09b624
...
...
@@ -9,10 +9,7 @@ import com.blankj.common.item.CommonItem
import
com.blankj.common.item.CommonItemClick
import
com.blankj.subutil.export.api.SubUtilApi
import
com.blankj.utilcode.export.api.UtilCodeApi
import
com.blankj.utilcode.util.ActivityUtils
import
com.blankj.utilcode.util.ApiUtils
import
com.blankj.utilcode.util.BarUtils
import
com.blankj.utilcode.util.CollectionUtils
import
com.blankj.utilcode.util.*
import
kotlinx.android.synthetic.main.activity_main.*
...
...
feature/utilcode/pkg/src/main/java/com/blankj/utilcode/pkg/feature/shadow/ShadowActivity.kt
浏览文件 @
2d09b624
...
...
@@ -41,7 +41,7 @@ class ShadowActivity : CommonActivity() {
super
.
initView
(
savedInstanceState
,
contentView
)
ShadowUtils
.
apply
(
shadowRectView
,
Config
().
setShadowRadius
(
0.01f
).
setShadowColor
(
Color
.
BLUE
,
Color
.
GREEN
))
ShadowUtils
.
apply
(
shadowRoundRectView
,
Config
().
setShadowRadius
(
SizeUtils
.
dp2px
(
16f
).
toFloat
())
.
setShadowColor
(
Color
.
RED
,
Color
.
BLUE
)
)
SizeUtils
.
dp2px
(
16f
).
toFloat
()))
ShadowUtils
.
apply
(
shadowCircleView
,
Config
().
setCircle
().
setShadowColor
(
Color
.
GREEN
,
Color
.
BLUE
))
}
}
lib/utilcode/README-CN.md
浏览文件 @
2d09b624
...
...
@@ -578,8 +578,11 @@ clickBlankArea2HideSoftInput : 点击屏幕空白区域隐藏软键盘
*
### 语言相关 ->
[
LanguageUtils.java
][
language.java
]
->
[
Demo
][
language.demo
]
```
applySystemLanguage: 应用系统语言
applyLanguage : 应用语言
applySystemLanguage : 应用系统语言
applyLanguage : 应用语言
isAppliedSystemLanguage: 判断是否使用系统语言
isAppliedLanguage : 判断是否使用某语言
getCurrentLocale : 获取当前语言
```
*
### 日志相关 ->
[
LogUtils.java
][
log.java
]
->
[
Demo
][
log.demo
]
...
...
@@ -1010,6 +1013,8 @@ toSBC : 转化为全角字符
*
### 线程相关 ->
[
ThreadUtils.java
][
thread.java
]
->
[
Test
][
thread.test
]
```
isMainThread : 判断当前是否主线程
runOnUiThread : 运行在主线程
runOnUiThreadDelayed : 延时运行在主线程
getFixedPool : 获取固定线程池
getSinglePool : 获取单线程池
getCachedPool : 获取缓冲线程池
...
...
lib/utilcode/README.md
浏览文件 @
2d09b624
...
...
@@ -580,6 +580,9 @@ clickBlankArea2HideSoftInput
```
applySystemLanguage
applyLanguage
isAppliedSystemLanguage
isAppliedLanguage
getCurrentLocale
```
*
### About Log ->
[
LogUtils.java
][
log.java
]
->
[
Demo
][
log.demo
]
...
...
@@ -1010,6 +1013,8 @@ toSBC
*
### About Thread ->
[
ThreadUtils.java
][
thread.java
]
->
[
Test
][
thread.test
]
```
isMainThread
runOnUiThread
runOnUiThreadDelayed
getFixedPool
getSinglePool
getCachedPool
...
...
lib/utilcode/build.gradle
浏览文件 @
2d09b624
...
...
@@ -11,6 +11,28 @@ readme {
readmeCnFile
file
(
'./README-CN.md'
)
}
android
{
compileSdkVersion
Config
.
compileSdkVersion
defaultConfig
{
minSdkVersion
Config
.
minSdkVersion
versionCode
Config
.
versionCode
versionName
Config
.
versionName
consumerProguardFiles
'proguard-rules.pro'
}
buildTypes
{
release
{
minifyEnabled
false
proguardFiles
getDefaultProguardFile
(
'proguard-android.txt'
),
'proguard-rules.pro'
consumerProguardFiles
'proguard-rules.pro'
}
}
lintOptions
{
abortOnError
false
}
}
dependencies
{
implementation
Config
.
depConfig
.
gson
.
dep
...
...
lib/utilcode/src/main/java/com/blankj/utilcode/util/ActivityUtils.java
浏览文件 @
2d09b624
...
...
@@ -20,6 +20,8 @@ import android.text.TextUtils;
import
android.util.Log
;
import
android.view.View
;
import
java.lang.ref.WeakReference
;
import
java.lang.reflect.Field
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -55,6 +57,16 @@ public final class ActivityUtils {
*/
public
static
Activity
getActivityByContext
(
Context
context
)
{
if
(
context
instanceof
Activity
)
return
(
Activity
)
context
;
if
(
context
!=
null
&&
context
.
getClass
().
getName
().
equals
(
"com.android.internal.policy.DecorContext"
))
{
try
{
Field
mActivityContextField
=
context
.
getClass
().
getDeclaredField
(
"mActivityContext"
);
mActivityContextField
.
setAccessible
(
true
);
//noinspection unchecked
return
((
WeakReference
<
Activity
>)
mActivityContextField
.
get
(
context
)).
get
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
while
(
context
instanceof
ContextWrapper
)
{
if
(
context
instanceof
Activity
)
{
return
(
Activity
)
context
;
...
...
lib/utilcode/src/main/java/com/blankj/utilcode/util/ApiUtils.java
浏览文件 @
2d09b624
...
...
@@ -33,15 +33,15 @@ public final class ApiUtils {
private
ApiUtils
()
{
}
private
void
register
Impl
(
Class
implClass
)
{
private
void
register
ApiInner
(
Class
implClass
)
{
if
(
implClass
==
null
)
return
;
Class
superclass
=
implClass
.
getSuperclass
();
if
(
superclass
==
null
)
return
;
mInjectApiImplMap
.
put
(
superclass
,
implClass
);
}
public
static
void
register
(
Class
implClass
)
{
getInstance
().
register
Impl
(
implClass
);
public
static
void
register
Api
(
Class
implClass
)
{
getInstance
().
register
ApiInner
(
implClass
);
}
/**
...
...
lib/utilcode/src/main/java/com/blankj/utilcode/util/JsonUtils.java
浏览文件 @
2d09b624
package
com.blankj.utilcode.util
;
import
android.util.Log
;
import
org.json.JSONArray
;
import
org.json.JSONException
;
import
org.json.JSONObject
;
/**
* <pre>
* author: Blankj
* blog : http://blankj.com
* time : 2019/01/07
* desc : utils about json
* </pre>
*/
public
final
class
JsonUtils
{
private
static
final
byte
TYPE_BOOLEAN
=
0x00
;
...
...
lib/utilcode/src/main/java/com/blankj/utilcode/util/LanguageUtils.java
浏览文件 @
2d09b624
package
com.blankj.utilcode.util
;
import
android.app.Activity
;
import
android.app.Application
;
import
android.content.ComponentName
;
import
android.content.Context
;
import
android.content.Intent
;
...
...
@@ -10,6 +9,7 @@ import android.content.pm.ResolveInfo;
import
android.content.res.Configuration
;
import
android.content.res.Resources
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.support.annotation.NonNull
;
import
android.text.TextUtils
;
import
android.util.DisplayMetrics
;
...
...
@@ -36,23 +36,14 @@ public class LanguageUtils {
}
/**
* Apply the system language in the {@link Application#onCreate()}.
* Apply the system language.
* It will not restart Activity. u can put it in ur {@link Activity#onCreate(Bundle)}.
*/
public
static
void
applySystemLanguage
InAppOnCreate
()
{
public
static
void
applySystemLanguage
()
{
if
(
isAppliedSystemLanguage
())
return
;
applyLanguage
(
Resources
.
getSystem
().
getConfiguration
().
locale
,
""
,
true
,
false
);
}
/**
* Apply the language in the {@link Application#onCreate()}.
*
* @param locale The language of locale.
*/
public
static
void
applyLanguageInAppOnCreate
(
@NonNull
final
Locale
locale
)
{
if
(
isAppliedLanguage
())
return
;
applyLanguage
(
locale
,
""
,
false
,
false
);
}
/**
* Apply the system language.
*
...
...
@@ -71,6 +62,17 @@ public class LanguageUtils {
applyLanguage
(
Resources
.
getSystem
().
getConfiguration
().
locale
,
activityClassName
,
true
,
true
);
}
/**
* Apply the language.
* It will not restart Activity. u can put it in ur {@link Activity#onCreate(Bundle)}.
*
* @param locale The language of locale.
*/
public
static
void
applyLanguage
(
@NonNull
final
Locale
locale
)
{
if
(
isAppliedLanguage
())
return
;
applyLanguage
(
locale
,
""
,
false
,
false
);
}
/**
* Apply the language.
*
...
...
lib/utilcode/src/main/java/com/blankj/utilcode/util/ResourceUtils.java
浏览文件 @
2d09b624
...
...
@@ -191,25 +191,24 @@ public final class ResourceUtils {
* @return the content of assets
*/
public
static
String
readAssets2String
(
final
String
assetsFilePath
,
final
String
charsetName
)
{
InputStream
is
;
try
{
is
=
Utils
.
getApp
().
getAssets
().
open
(
assetsFilePath
);
InputStream
is
=
Utils
.
getApp
().
getAssets
().
open
(
assetsFilePath
);
byte
[]
bytes
=
is2Bytes
(
is
);
// close stream in it
if
(
bytes
==
null
)
return
null
;
if
(
isSpace
(
charsetName
))
{
return
new
String
(
bytes
);
}
else
{
try
{
return
new
String
(
bytes
,
charsetName
);
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
return
""
;
}
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
return
null
;
}
byte
[]
bytes
=
is2Bytes
(
is
);
if
(
bytes
==
null
)
return
null
;
if
(
isSpace
(
charsetName
))
{
return
new
String
(
bytes
);
}
else
{
try
{
return
new
String
(
bytes
,
charsetName
);
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
return
""
;
}
}
}
/**
...
...
@@ -274,7 +273,7 @@ public final class ResourceUtils {
*/
public
static
String
readRaw2String
(
@RawRes
final
int
resId
,
final
String
charsetName
)
{
InputStream
is
=
Utils
.
getApp
().
getResources
().
openRawResource
(
resId
);
byte
[]
bytes
=
is2Bytes
(
is
);
byte
[]
bytes
=
is2Bytes
(
is
);
// close stream in it
if
(
bytes
==
null
)
return
null
;
if
(
isSpace
(
charsetName
))
{
return
new
String
(
bytes
);
...
...
lib/utilcode/src/main/java/com/blankj/utilcode/util/SpanUtils.java
浏览文件 @
2d09b624
...
...
@@ -1009,7 +1009,7 @@ public final class SpanUtils {
@Override
public
void
chooseHeight
(
final
CharSequence
text
,
final
int
start
,
final
int
end
,
final
int
spanstartv
,
final
int
v
,
final
Paint
.
FontMetricsInt
fm
)
{
LogUtils
.
e
(
fm
,
sfm
);
//
LogUtils.e(fm, sfm);
if
(
sfm
==
null
)
{
sfm
=
new
Paint
.
FontMetricsInt
();
sfm
.
top
=
fm
.
top
;
...
...
@@ -1049,7 +1049,7 @@ public final class SpanUtils {
if
(
end
==
((
Spanned
)
text
).
getSpanEnd
(
this
))
{
sfm
=
null
;
}
LogUtils
.
e
(
fm
,
sfm
);
//
LogUtils.e(fm, sfm);
}
}
...
...
lib/utilcode/src/main/java/com/blankj/utilcode/util/ThreadUtils.java
浏览文件 @
2d09b624
...
...
@@ -56,6 +56,14 @@ public final class ThreadUtils {
return
Looper
.
myLooper
()
==
Looper
.
getMainLooper
();
}
public
static
void
runOnUiThread
(
final
Runnable
runnable
)
{
Utils
.
runOnUiThread
(
runnable
);
}
public
static
void
runOnUiThreadDelayed
(
final
Runnable
runnable
,
long
delayMillis
)
{
Utils
.
runOnUiThreadDelayed
(
runnable
,
delayMillis
);
}
/**
* Return a thread pool that reuses a fixed number of threads
* operating off a shared unbounded queue, using the provided
...
...
plugin/api-gradle-plugin/.gitignore
浏览文件 @
2d09b624
/build
ApiUtils2333.class
\ No newline at end of file
/build
\ No newline at end of file
plugin/api-gradle-plugin/src/main/java/com/blankj/api/ApiInfo.java
浏览文件 @
2d09b624
...
...
@@ -18,6 +18,10 @@ public class ApiInfo {
this
.
isMock
=
isMock
;
}
public
String
getFileDesc
()
{
return
implApiClass
+
"-"
+
isMock
;
}
@Override
public
String
toString
()
{
return
"{ implApiClass: "
+
implApiClass
+
...
...
plugin/api-gradle-plugin/src/main/java/com/blankj/api/ApiTransform.groovy
浏览文件 @
2d09b624
...
...
@@ -116,31 +116,14 @@ class ApiTransform extends Transform {
if
(
javaResJar
==
null
)
{
LogUtils
.
w
(
"javaResJar didn't existed."
)
}
else
{
injectApis2Assets
(
javaResJar
,
apiScan
)
print2__api__
(
apiScan
,
ext
,
jsonFile
)
injectApis2Assets
(
javaResJar
,
apiScan
)
}
}
LogUtils
.
l
(
getName
()
+
" finished: "
+
(
System
.
currentTimeMillis
()
-
stTime
)
+
"ms"
)
}
private
static
void
injectApis2Assets
(
File
javaResJar
,
ApiScan
apiScan
)
{
String
javaResPath
=
javaResJar
.
getAbsolutePath
()
File
unzipJavaResDir
=
new
File
(
javaResPath
.
substring
(
0
,
javaResPath
.
lastIndexOf
(
"."
)))
unzipJavaResDir
.
mkdirs
()
ZipUtils
.
unzipFile
(
javaResJar
,
unzipJavaResDir
)
File
apiDir
=
new
File
(
unzipJavaResDir
,
Config
.
API_PATH
)
apiDir
.
mkdirs
()
apiScan
.
apiImplMap
.
each
{
key
,
value
->
File
apiClassDir
=
new
File
(
apiDir
,
key
)
apiClassDir
.
mkdir
()
File
apiClassImplDir
=
new
File
(
apiClassDir
,
value
.
implApiClass
+
"-"
+
value
.
isMock
)
apiClassImplDir
.
createNewFile
()
}
javaResJar
.
delete
()
ZipUtils
.
zipFiles
(
Arrays
.
asList
(
unzipJavaResDir
.
listFiles
()),
javaResJar
)
}
private
static
void
print2__api__
(
ApiScan
apiScan
,
ApiExtension
ext
,
File
jsonFile
)
{
Map
implApis
=
[:]
List
<
String
>
noImplApis
=
[]
...
...
@@ -166,6 +149,23 @@ class ApiTransform extends Transform {
}
}
private
static
void
injectApis2Assets
(
File
javaResJar
,
ApiScan
apiScan
)
{
String
javaResPath
=
javaResJar
.
getAbsolutePath
()
File
unzipJavaResDir
=
new
File
(
javaResPath
.
substring
(
0
,
javaResPath
.
lastIndexOf
(
"."
)))
unzipJavaResDir
.
mkdirs
()
ZipUtils
.
unzipFile
(
javaResJar
,
unzipJavaResDir
)
File
apiDir
=
new
File
(
unzipJavaResDir
,
Config
.
API_PATH
)
apiDir
.
mkdirs
()
apiScan
.
apiImplMap
.
each
{
key
,
value
->
File
apiClassDir
=
new
File
(
apiDir
,
key
)
apiClassDir
.
mkdir
()
File
apiClassImplFile
=
new
File
(
apiClassDir
,
value
.
getFileDesc
())
apiClassImplFile
.
createNewFile
()
}
javaResJar
.
delete
()
ZipUtils
.
zipFiles
(
Arrays
.
asList
(
unzipJavaResDir
.
listFiles
()),
javaResJar
)
}
private
static
jumpScan
(
String
jarName
,
ApiExtension
ext
)
{
if
(
ext
.
onlyScanLibRegex
!=
null
&&
ext
.
onlyScanLibRegex
.
trim
().
length
()
>
0
)
{
return
!
Pattern
.
matches
(
ext
.
onlyScanLibRegex
,
jarName
)
...
...
plugin/api-gradle-plugin/src/test/java/com/blankj/api/ApiUtils.java
浏览文件 @
2d09b624
...
...
@@ -26,17 +26,6 @@ public class ApiUtils {
private
Map
<
Class
,
Class
>
mInjectApiImplMap
=
new
HashMap
<>();
private
ApiUtils
()
{
init
();
}
/**
* It'll be injected the implClasses who have {@link ApiUtils.Api} annotation
* by function of {@link ApiUtils#registerImpl} when execute transform task.
*/
private
void
init
()
{
/*inject*/
}
private
void
registerImpl
(
Class
implClass
)
{
mInjectApiImplMap
.
put
(
implClass
.
getSuperclass
(),
implClass
);
}
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录