forked from scwang90/SmartRefreshLayout
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
189 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,72 @@ | ||
@ECHO OFF | ||
@if "%DEBUG%" == "" @echo off | ||
@rem ########################################################################## | ||
@rem | ||
@rem Method Count Starter | ||
@rem | ||
@rem ########################################################################## | ||
|
||
SET sdk=null | ||
SET tool=null | ||
@rem Set local scope for the variables with windows NT shell | ||
if "%OS%"=="Windows_NT" setlocal enabledelayedexpansion | ||
|
||
FOR /F "delims== tokens=2" %%i IN ('findstr /i "sdk.dir" local.properties') DO SET sdk=%%i | ||
FOR /F "delims=' tokens=2" %%i IN ('findstr /i "buildToolsVersion" %~dp0app\build.gradle') DO SET tool=%%i | ||
set SDK= | ||
set TOOL= | ||
|
||
echo tool=%tool% | ||
echo sdk=%sdk% | ||
for /F "delims== tokens=2" %%i IN ('findstr /i "sdk.dir" local.properties') DO SET SDK=%%i | ||
for /F "delims=' tokens=2" %%i IN ('findstr /i "buildToolsVersion" %~dp0app\build.gradle') DO SET TOOL=%%i | ||
|
||
IF %sdk% == null ( | ||
ECHO 没找到 Android Sdk 路径,脚本中止! | ||
GOTO END | ||
echo TOOL=%TOOL% | ||
echo SDK=%SDK% | ||
|
||
if "%SDK%" == "" ( | ||
echo 没找到 Android Sdk 路径,脚本中止! | ||
goto end | ||
) | ||
IF %tool% == null ( | ||
ECHO 没找到 Android Build Tool 版本,脚本中止! | ||
GOTO END | ||
if "%TOOL%" == "" ( | ||
echo 没找到 Android Build Tool 版本,脚本中止! | ||
goto end | ||
) | ||
|
||
SET sdk=%sdk:\\=\% | ||
SET sdk=%sdk:\:=:% | ||
set SDK=%SDK:\\=\% | ||
set SDK=%SDK:\:=:% | ||
|
||
set MODULE=refresh-layout | ||
set OUTPUT=methods-apk.txt | ||
|
||
set PATH_TOOL=%SDK%\build-tools\%TOOL%\dx.bat | ||
set PATH_JAR=%MODULE%/build/intermediates/intermediate-jars/debug/classes.jar | ||
set PATH_DEX=%PATH_JAR%.dex | ||
REM echo PATH_JAR=%PATH_JAR% | ||
REM echo PATH_DEX=%PATH_DEX% | ||
|
||
echo 正在构建。。。 | ||
|
||
SET module=refresh-layout | ||
call ./gradlew assemble | ||
if "%ERRORLEVEL%" == "0" ( | ||
echo. | ||
echo 构建成功!,开始生成DEX文件。。。 | ||
) else ( | ||
echo. | ||
echo 构建失败,脚本中止! | ||
goto end | ||
) | ||
|
||
call %PATH_TOOL% --dex --verbose --no-strict --output=%PATH_DEX% %PATH_JAR% >NUL | ||
if "%ERRORLEVEL%" == "0" ( | ||
echo. | ||
echo 生成DEX文件成功!,开始统计。。。 | ||
) else ( | ||
echo. | ||
echo 生成DEX失败,脚本中止! | ||
goto end | ||
) | ||
|
||
SET toolPath=%sdk%\build-tools\%tool%\dx.bat | ||
SET jarPath=%module%/build/intermediates/intermediate-jars/debug/classes.jar | ||
SET dexPath=%jarPath%.dex | ||
|
||
ECHO jarPath=%jarPath% | ||
ECHO dexPath=%dexPath% | ||
REM set PATH_DEX=%~dp0art/app-debug.apk | ||
|
||
CALL ./gradlew assemble | ||
call java -jar ./art/dex-method-counts.jar --filter=all --include-classes --include-detail --output-style=tree --package-filter=android %PATH_DEX% > %OUTPUT% | ||
|
||
CALL %toolPath% --dex --verbose --no-strict --output=%dexPath% %jarPath% | ||
call ./method-count-words.bat %OUTPUT% %OUTPUT:.txt=-count.txt% | ||
|
||
CALL java -jar ./art/dex-method-counts.jar --filter=all --include-classes --output-style=tree %dexPath% | ||
:end | ||
|
||
:END | ||
if "%OS%"=="Windows_NT" endlocal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
@echo off & | ||
setlocal enabledelayedexpansion | ||
|
||
set FILE=%1 | ||
set OUTPUT=%2 | ||
|
||
if "%FILE%" == "" ( | ||
echo "请输入参数!" | ||
goto :eof | ||
) | ||
REM if "%OUTPUT%" == "" ( | ||
REM echo "使用默认参数OUTPUT" | ||
REM set OUTPUT=methods-words.txt | ||
REM ) | ||
|
||
echo 正在统计单词数量。。。 | ||
|
||
call :test | ||
|
||
echo. | ||
echo 输出统计结果 | ||
|
||
set number=1 | ||
|
||
for /f "skip=1 tokens=1,* delims=_=" %%i in ('set _') do set /a number+=1 | ||
|
||
if "%OUTPUT%" == "" ( | ||
echo %number% : Total Words | ||
) else ( | ||
echo %number% : Total Words > "%OUTPUT%" | ||
) | ||
|
||
for /f "skip=1 tokens=1,* delims=_=" %%i in ('set _') do if "%OUTPUT%" == "" ( | ||
|
||
set "var=%%i" | ||
set "var=!var:$$$=<!" | ||
set "var=!var:###=>!" | ||
|
||
echo %%j : !var! | ||
) else ( | ||
set "var=%%i" | ||
set "var=!var:$$$=<!" | ||
set "var=!var:###=>!" | ||
|
||
echo %%j : !var!>>"%OUTPUT%" | ||
) | ||
|
||
if not "%OUTPUT%" == "" ( | ||
echo 开始排序结果 | ||
sort -rg "%OUTPUT%">"%OUTPUT:.txt=-sort.txt%" | ||
echo 结果排序结束 | ||
) | ||
|
||
echo 输出统计结果完成 | ||
|
||
goto :eof | ||
|
||
:test | ||
|
||
for /f "delims=" %%l in (%FILE%) do ( | ||
set str=%%l | ||
call :calc | ||
|
||
) | ||
|
||
goto :eof | ||
|
||
:calc | ||
|
||
for /f "tokens=1,* delims=':.-=%% " %%i in ("%str%") do ( | ||
REM echo. | ||
REM echo i=%%i | ||
set /p="." <nul | ||
|
||
set "var=%%i" | ||
set "var=!var:<=$$$!" | ||
set "var=!var:>=###!" | ||
REM echo "var=%var%" | ||
REM echo "var=!var!" | ||
|
||
REM set /a "_!var!+=1" | ||
|
||
REM echo "!var!"|findstr /be "\"[0-9]*\"">nul && ECHO "!var! 是纯数字" || ECHO "!var! 不是数字" | ||
echo "!var!"|findstr /be "\"[0-9]*\"">nul && echo "find">nul || set /a "_!var!+=1" | ||
|
||
set "str=%%j" && echo "find">nul || pause | ||
REM echo str=%str% | ||
REM echo str=!str! | ||
|
||
if not "%str%"=="" call :calc | ||
) | ||
|
||
goto :eof |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters