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
93ed3568
authored
Nov 28, 2017
by
chengfengpiaopiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jenkinsns gradle打包配置
parent
56f1988c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
46 deletions
.idea/dictionaries/Administrator.xml
.idea/modules.xml
app/build.gradle
gradle.properties
.idea/dictionaries/Administrator.xml
0 → 100644
View file @
93ed3568
<component
name=
"ProjectDictionaryState"
>
<dictionary
name=
"Administrator"
/>
</component>
\ No newline at end of file
.idea/modules.xml
View file @
93ed3568
...
...
@@ -2,7 +2,7 @@
<project
version=
"4"
>
<component
name=
"ProjectModuleManager"
>
<modules>
<module
fileurl=
"file://$PROJECT_DIR$/DuoBaoJingCai
2.iml"
filepath=
"$PROJECT_DIR$/DuoBaoJingCai2
.iml"
/>
<module
fileurl=
"file://$PROJECT_DIR$/DuoBaoJingCai
.iml"
filepath=
"$PROJECT_DIR$/DuoBaoJingCai
.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 @
93ed3568
...
...
@@ -5,7 +5,7 @@ def customPropsFile = file("buildcustom.properties");
Properties
customProps
=
new
Properties
()
def
networkType
=
'2'
;
def
suffixName
=
[
'2'
:
''
,
'0'
:
'_test'
,
'1'
:
'_out_test'
]
def
suffixName
=
[
'2'
:
'
_release
'
,
'0'
:
'_test'
,
'1'
:
'_out_test'
]
if
(
customPropsFile
.
canRead
())
{
customProps
.
load
(
new
FileInputStream
(
customPropsFile
))
networkType
=
customProps
[
'networkType'
].
toString
()
...
...
@@ -20,21 +20,17 @@ android {
minSdkVersion
16
targetSdkVersion
23
versionCode
1
versionName
"1.0"
versionName
APP_VERSION
manifestPlaceholders
=
[
UMENG_CHANNEL_VALUE:
"base"
]
//默认名称
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled
true
//方法数超过65535
}
lintOptions
{
checkReleaseBuilds
false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError
false
}
//配置keystore签名
signingConfigs
{
release
{
...
...
@@ -46,48 +42,57 @@ android {
}
//多渠道配置
// productFlavors {
// wandoujia {}
// baidu {}
// c360 {}
// uc {}
// xiaomi {}
// huawei {}
// productFlavors.all { flavor ->
// flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: name]
// }
// }
productFlavors
{
baseflavor
{}
productFlavors
.
all
{
flavor
->
flavor
.
manifestPlaceholders
=
[
UMENG_CHANNEL_VALUE:
name
]
}
}
buildTypes
{
release
{
minifyEnabled
false
//是否混淆
zipAlignEnabled
true
//Zipalign优化
//是否混淆
minifyEnabled
false
//Zipalign优化
zipAlignEnabled
true
proguardFiles
getDefaultProguardFile
(
'proguard-android.txt'
),
'proguard-rules.pro'
signingConfig
signingConfigs
.
release
buildConfigField
"int"
,
"network_type"
,
networkType
buildConfigField
"boolean"
,
"ENABLE_DEBUG"
,
"false"
signingConfig
signingConfigs
.
release
}
debug
{
minifyEnabled
false
//
shrinkResources true
有了minifyEnabled就不要这个,混淆的时候会过滤无用处资源
signingConfig
signingConfigs
.
releas
e
//有了minifyEnabled就不要这个,混淆的时候会过滤无用处资源
//shrinkResources tru
e
buildConfigField
"int"
,
"network_type"
,
networkType
buildConfigField
"boolean"
,
"ENABLE_DEBUG"
,
"true"
signingConfig
signingConfigs
.
release
}
}
//
// android.applicationVariants.all { variant ->
// variant.outputs.each { output ->
// def outputFile = output.outputFile
// def channelName = variant.productFlavors[0].name;
// //这里修改文件名
// def fileName = "duobaojingcai_${channelName}_v${defaultConfig.versionName}${suffixName[networkType]}.apk"
// output.outputFile = new File(outputFile.parent, fileName)
// }
// }
android
.
applicationVariants
.
all
{
variant
->
variant
.
outputs
.
each
{
output
->
def
outputFile
=
output
.
outputFile
def
channelName
=
variant
.
productFlavors
[
0
].
name
if
(
"false"
.
equals
(
IS_JENKINS
)){
def
fileName
=
"duobaojingcai_${channelName}_v${defaultConfig.versionName}${suffixName[networkType]}.apk"
output
.
outputFile
=
new
File
(
outputFile
.
parent
,
fileName
)
}
else
{
channelName
=
PRODUCT_FLAAVOR_BUILD
def
env
=
ENVIRONMENT
def
packTime
=
JENKINS_TIME
def
fileName
;
//outputFile = "/vagrant/jenkins/jenkins-workspace/walleApps"
outputFile
=
"/var/jenkins_home/walleApps"
if
(
"release"
.
equals
(
env
)){
fileName
=
"duobaojingcai_${channelName}_v${defaultConfig.versionName}_${env}.apk"
}
else
{
fileName
=
"duobaojingcai_${channelName}_v${defaultConfig.versionName}_${env}_${packTime}.apk"
}
output
.
outputFile
=
new
File
(
outputFile
,
fileName
)
}
}
}
}
...
...
@@ -97,27 +102,26 @@ dependencies {
exclude
group:
'com.android.support'
,
module:
'support-annotations'
})
compile
"com.android.support:support-v13:23.1.0"
testCompile
'junit:junit:4.12'
compile
"com.jakewharton:butterknife:6.1.0"
compile
"com.squareup.retrofit2:retrofit:2.0.2"
compile
"com.squareup.retrofit2:converter-gson:2.0.2"
compile
"com.squareup.retrofit2:adapter-rxjava:2.0.2"
compile
'io.reactivex:rxandroid:1.2.1'
compile
'io.reactivex:rxjava:1.1.9'
compile
'com.google.code.gson:gson:2.6.2'
compile
"com.squareup.okhttp3:logging-interceptor:3.2.0"
compile
"com.squareup.okhttp3:logging-interceptor:3.1.0"
compile
'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:1.0.2'
compile
'cz.msebera.android:httpclient:4.4.1.1'
//底部tab选择器
compile
'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar'
//友盟统计
compile
'com.umeng.analytics:analytics:latest.integration'
compile
'com.meituan.android.walle:library:1.1.5'
//walle
//walle
compile
'com.meituan.android.walle:library:1.1.5'
//图片选择器
compile
project
(
path:
':multi-image-selector'
)
//权限申请
compile
'com.tbruyelle.rxpermissions2:rxpermissions:0.9.3@aar'
}
gradle.properties
View file @
93ed3568
...
...
@@ -23,4 +23,14 @@ org.gradle.daemon=false
org.gradle.jvmargs
=
-XX:MaxPermSize=1024m
?
android.useDeprecatedNdk
=
true
\ No newline at end of file
?
android.useDeprecatedNdk
=
true
#jenkins
APP_VERSION
=
2.0.0
IS_JENKINS
=
false
ENVIRONMENT
=
"debug"
PRODUCT_FLAAVOR_BUILD
=
"base"
JENKINS_TIME
=
""
\ No newline at end of file
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