Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
唐文
/
AiyoZhuaWaWa
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f7b87623
authored
Dec 08, 2017
by
chengfengpiaopiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sdk编译版本改为25
parent
85058ee8
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
66 deletions
.idea/misc.xml
.idea/modules.xml
app/build.gradle
app/libs/tbs_sdk_thirdapp_v3.1.0.1034_43100_sharewithdownload_obfs_20170301_182143.jar
app/src/main/AndroidManifest.xml
build.gradle
.idea/misc.xml
View file @
f7b87623
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"EntryPointsManager"
>
<entry_points
version=
"2.0"
/>
</component>
<component
name=
"NullableNotNullManager"
>
<option
name=
"myDefaultNullable"
value=
"android.support.annotation.Nullable"
/>
<option
name=
"myDefaultNotNull"
value=
"android.support.annotation.NonNull"
/>
...
...
@@ -27,7 +24,7 @@
</value>
</option>
</component>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_
7"
default=
"true"
assert-keyword=
"true"
jdk-15
=
"true"
project-jdk-name=
"1.8"
project-jdk-type=
"JavaSDK"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_
8"
default
=
"true"
project-jdk-name=
"1.8"
project-jdk-type=
"JavaSDK"
>
<output
url=
"file://$PROJECT_DIR$/build/classes"
/>
</component>
<component
name=
"ProjectType"
>
...
...
.idea/modules.xml
View file @
f7b87623
...
...
@@ -3,7 +3,7 @@
<component
name=
"ProjectModuleManager"
>
<modules>
<module
fileurl=
"file://$PROJECT_DIR$/DuoBaoJingCai.iml"
filepath=
"$PROJECT_DIR$/DuoBaoJingCai.iml"
/>
<module
fileurl=
"file://
$PROJECT_DIR$/DuoBaoJingCai2.iml"
filepath=
"$PROJECT_DIR$/
DuoBaoJingCai2.iml"
/>
<module
fileurl=
"file://
G:\Product\Android\DuoBaoJingCai\DuoBaoJingCai2.iml"
filepath=
"G:\Product\Android\DuoBaoJingCai\
DuoBaoJingCai2.iml"
/>
<module
fileurl=
"file://$PROJECT_DIR$/app/app.iml"
filepath=
"$PROJECT_DIR$/app/app.iml"
/>
<module
fileurl=
"file://$PROJECT_DIR$/multi-image-selector/multi-image-selector.iml"
filepath=
"$PROJECT_DIR$/multi-image-selector/multi-image-selector.iml"
/>
</modules>
...
...
app/build.gradle
View file @
f7b87623
apply
plugin:
'com.android.application'
apply
plugin:
'walle'
//walle
def
customPropsFile
=
file
(
"buildcustom.properties"
);
Properties
customProps
=
new
Properties
()
def
networkType
=
'2'
;
def
suffixName
=
[
'2'
:
'_release'
,
'0'
:
'_test'
,
'1'
:
'_out_test'
]
if
(
customPropsFile
.
canRead
())
{
customProps
.
load
(
new
FileInputStream
(
customPropsFile
))
networkType
=
customProps
[
'networkType'
].
toString
()
}
println
(
"suffixName: "
+
suffixName
[
networkType
])
//初始化gradle.properties参数
def
projectName
=
PROJECT_NAME
def
env
=
ENVIRONMENT
...
...
@@ -19,17 +16,15 @@ def packTime = getDate()
def
is_jenkins
=
IS_JENKINS
def
projectNameLowerCase
=
projectName
.
toLowerCase
()
def
fileToJiaGuBaoWalle
def
getDate
()
{
def
date
=
new
Date
()
def
formattedDate
=
date
.
format
(
'yyyyMMdd'
)
return
formattedDate
}
def
createFile
(
path
,
is_jenkins
){
def
createFile
(
path
,
is_jenkins
)
{
println
(
path
)
File
file
=
new
File
(
path
);
if
(!
file
.
exists
())
{
//判断是否待删除目录是否存在
if
(!
file
.
exists
())
{
//判断是否待删除目录是否存在
File
fileParent
=
file
.
getParentFile
();
fileParent
.
mkdirs
();
return
false
;
...
...
@@ -39,20 +34,19 @@ def createFile(path,is_jenkins){
}
String
[]
content
=
file
.
list
();
//取得当前目录下所有文件和文件夹
for
(
String
name
:
content
)
{
for
(
String
name
:
content
)
{
File
temp
=
new
File
(
path
,
name
);
if
(
temp
.
isDirectory
())
{
//判断是否是目录
if
(
temp
.
isDirectory
())
{
//判断是否是目录
deleteDir
(
temp
.
getAbsolutePath
());
//递归调用,删除目录里的内容
temp
.
delete
();
//删除空目录
}
else
{
if
(!
temp
.
delete
())
{
//直接删除文件
}
else
{
if
(!
temp
.
delete
())
{
//直接删除文件
System
.
err
.
println
(
"Failed to delete "
+
name
);
}
}
}
return
true
;
}
android
{
compileSdkVersion
rootProject
.
ext
.
compileSdkVersion
buildToolsVersion
rootProject
.
ext
.
buildToolsVersion
...
...
@@ -118,7 +112,8 @@ android {
def
fileName
println
(
"is_jenkins: "
+
is_jenkins
)
//build.gralde根据module的个数,执行的次数为module.mount+1
println
(
"projectName: "
+
projectName
)
if
(
"false"
.
equals
(
is_jenkins
))
{
//groovy boolean 如果你把一个对象放在一个boolean表达式中,Groovy 会检查这个对象是否为null. 它会把null当做false,否则为true
if
(
"false"
.
equals
(
is_jenkins
))
{
//groovy boolean 如果你把一个对象放在一个boolean表达式中,Groovy 会检查这个对象是否为null. 它会把null当做false,否则为true
fileName
=
"${projectNameLowerCase}_${channelName}_v${defaultConfig.versionName}${suffixName[networkType]}.apk"
outputFile
=
"G:/Apks/${projectName}"
}
else
{
...
...
@@ -128,14 +123,14 @@ android {
outputFile
=
"/var/jenkins_home/walleApps/${projectName}"
if
(
"release"
.
equals
(
env
))
{
fileName
=
"${projectNameLowerCase}_${channelName}_v${defaultConfig.versionName}_${env}_${packTime}.apk"
outputFile
=
outputFile
+
"/"
+
"${env}"
outputFile
=
outputFile
+
"/"
+
"${env}"
}
else
{
fileName
=
"${projectNameLowerCase}_${channelName}_v${defaultConfig.versionName}_${env}_${packTime}.apk"
outputFile
=
outputFile
+
"/"
+
"${env}"
outputFile
=
outputFile
+
"/"
+
"${env}"
}
}
createFile
(
outputFile
,
is_jenkins
);
println
(
"outputFileFinally ---> "
+
outputFile
);
createFile
(
outputFile
,
is_jenkins
);
println
(
"outputFileFinally ---> "
+
outputFile
);
fileToJiaGuBaoWalle
=
outputFile
output
.
outputFile
=
new
File
(
outputFile
,
fileName
)
}
...
...
@@ -170,28 +165,22 @@ android {
compile
'com.tbruyelle.rxpermissions2:rxpermissions:0.9.3@aar'
}
}
task
hello1
<<
{
println
'hello1'
+
"app.build.gradle"
println
'hello1'
+
"app.build.gradle"
}
task
startApp
(
type:
Exec
){
task
startApp
(
type:
Exec
)
{
task
->
workingDir
'.'
commandLine
'cd'
}
task
upper
<<
{
String
someString
=
'mY_nAmE'
println
"Original: "
+
someString
println
"Upper case: "
+
someString
.
toUpperCase
()
}
task
count
<<
{
4
.
times
{
print
"$it "
}
}
/**
* gradlew assembleRelease jiagubao_walle
* 一键实现多渠道打包
...
...
@@ -199,50 +188,45 @@ task count << {
def
BASE_LOCAL
=
"G:/Apks/"
def
BUILD_TOOLS
=
"/build-tools/25.0.0"
def
SDK_PATH_COMPONENY
=
"D:/2_android/as_client/sdk"
def
SDK_PATH_COMPONENY_BUILDTOOLS
=
SDK_PATH_COMPONENY
+
BUILD_TOOLS
def
SDK_PATH_COMPONENY_BUILDTOOLS
=
SDK_PATH_COMPONENY
+
BUILD_TOOLS
def
SDK_PATH_HOME
=
"D:/Android/AndroidSDK"
def
SDK_PATH_HOME_BUILDTOOLS
=
SDK_PATH_HOME
+
BUILD_TOOLS
def
SDK_PATH_HOME_BUILDTOOLS
=
SDK_PATH_HOME
+
BUILD_TOOLS
def
apkName
=
"${projectNameLowerCase}_baseflavor_v${APP_VERSION}${suffixName[networkType]}"
//基础包
def
apkBasePath
=
BASE_LOCAL
+
projectName
+
"/"
def
apkBasePath
=
BASE_LOCAL
+
projectName
+
"/"
def
apkV2Name
=
"${projectNameLowerCase}_v${APP_VERSION}${suffixName[networkType]}_v2"
//v2包(已注销)
def
apkV2Path
=
BASE_LOCAL
+
projectName
+
"/"
+
"v2/"
def
apkV2Path
=
BASE_LOCAL
+
projectName
+
"/"
+
"v2/"
def
apkWallleName
=
"${projectNameLowerCase}_v${APP_VERSION}${suffixName[networkType]}"
//walle基础包(已注销)
def
apkWallePath
=
BASE_LOCAL
+
projectName
+
"/"
+
"walleBase/"
def
walleChalles
=
BASE_LOCAL
+
projectName
+
"/"
+
"walleChalles"
//多渠道打包后的apks所在目录(已注销)
def
currentSdkBuildToolsPath
=
"true"
.
equals
(
IN_COMPONENY
)
?
SDK_PATH_COMPONENY_BUILDTOOLS
:
SDK_PATH_HOME_BUILDTOOLS
//当前SDK/build.tools路径
def
utilsPath
=
BASE_LOCAL
+
projectName
+
"/tools/"
//需要使用的工具
def
apkWallePath
=
BASE_LOCAL
+
projectName
+
"/"
+
"walleBase/"
def
walleChalles
=
BASE_LOCAL
+
projectName
+
"/"
+
"walleChalles"
//多渠道打包后的apks所在目录(已注销)
def
currentSdkBuildToolsPath
=
"true"
.
equals
(
IN_COMPONENY
)
?
SDK_PATH_COMPONENY_BUILDTOOLS
:
SDK_PATH_HOME_BUILDTOOLS
//当前SDK/build.tools路径
def
utilsPath
=
BASE_LOCAL
+
projectName
+
"/tools/"
//需要使用的工具
def
scriptName
=
"jiagubao-walle.bat"
//脚本名称
def
cmdParams
=
scriptName
+
" "
+
apkName
+
" "
+
apkBasePath
+
" "
+
apkV2Name
+
" "
+
apkV2Path
+
" "
+
apkWallleName
+
" "
+
apkWallePath
+
" "
+
currentSdkBuildToolsPath
+
" "
+
def
cmdParams
=
scriptName
+
" "
+
apkName
+
" "
+
apkBasePath
+
" "
+
apkV2Name
+
" "
+
apkV2Path
+
" "
+
apkWallleName
+
" "
+
apkWallePath
+
" "
+
currentSdkBuildToolsPath
+
" "
+
utilsPath
task
jiagubao_walle
(
dependsOn:
'cleanFile'
)
<<
{
String
date
=
cmdParams
.
execute
().
text
.
trim
().
toString
()
//带返回值
print
date
print
date
}
task
cleanFile
<<
{
println
(
"cleanFile"
)
createFile
(
apkV2Path
,
true
);
createFile
(
apkWallePath
,
true
);
createFile
(
walleChalles
,
true
);
createFile
(
apkV2Path
,
true
);
createFile
(
apkWallePath
,
true
);
createFile
(
walleChalles
,
true
);
}
//Python脚本
def
jenkinsJobName
=
"DuoBaoJingCai"
def
jenkinsBuild
=
"release"
def
jenkinsJobName
=
"DuoBaoJingCai"
def
jenkinsBuild
=
"release"
task
uploadpython
(
type:
Exec
)
{
workingDir
'../'
commandLine
"python"
,
"pythondemo.py"
,
"$jenkinsJobName"
,
"$jenkinsBuild"
commandLine
"python"
,
"pythondemo.py"
,
"$jenkinsJobName"
,
"$jenkinsBuild"
}
//CMD控制台
//String cmd2 = 'explorer .'
//task hello2(){
...
...
@@ -251,16 +235,15 @@ task uploadpython(type: Exec) {
// println cmdResult
// println "hello end"
//}
//Shell脚本
/**
* explorer .
* sh shell.sh DuoBaoJingCai release
* F:\Tool\SSH\Git\Git\bin\sh.exe G:\Product\Android\DuoBaoJingCai\shell.sh DuoBaoJingCai release
*/
task
execShell
(
type:
Exec
)
{
task
execShell
(
type:
Exec
)
{
executable
'sh'
args
"-c"
,
"../shell.sh $APP_VERSION $networkType"
}
dependencies
{
}
\ No newline at end of file
app/libs/tbs_sdk_thirdapp_v3.1.0.1034_43100_sharewithdownload_obfs_20170301_182143.jar
0 → 100644
View file @
f7b87623
File added
app/src/main/AndroidManifest.xml
View file @
f7b87623
...
...
@@ -70,7 +70,7 @@
<activity
android:name=
".view.activity.MainActivity"
android:exported=
"true"
android:launchMode=
"singleT
op
"
android:launchMode=
"singleT
ask
"
android:theme=
"@android:style/Theme.Translucent"
android:screenOrientation=
"portrait"
>
<intent-filter>
...
...
build.gradle
View file @
f7b87623
...
...
@@ -25,9 +25,9 @@ task clean(type: Delete) {
ext
{
//版本
compileSdkVersion
=
2
3
buildToolsVersion
=
"2
3.0.3
"
//23.0.3
targetSdkVersion
=
2
3
compileSdkVersion
=
2
5
buildToolsVersion
=
"2
5.0.1
"
//23.0.3
targetSdkVersion
=
2
5
//项目依赖
ButterKnife
=
"6.1.0"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment