Skip to content

Instantly share code, notes, and snippets.

@eunleem
Last active May 15, 2016 23:45
Show Gist options
  • Save eunleem/8fb88365afece5ae5146607a30cbf274 to your computer and use it in GitHub Desktop.
Save eunleem/8fb88365afece5ae5146607a30cbf274 to your computer and use it in GitHub Desktop.
LETs build.gradle android example
android {
compileSdkVersion 23
buildToolsVersion '23.0.3'
signingConfigs {
beta {
// this keystore is located at module level
storeFile file("DIRECTORY/keystore.jks") //jks 파일의 패스를 설정해주세요. app폴더가 기준
storePassword "pwd"
keyAlias "keyAlias"
keyPassword "pwd"
}
release {
// RELEASE_STORE_XXXXXX 정보는 저의 gradle.properties 글로벌 버젼에 선언되어 있습니다.
// 이 파일은 git에서 관리가 되기 때문에 민감함 패스워드를 여기에 직접 넣으면 보안의 위험때문에
// gradle.properties 라는 프로젝트 폴더가 아닌 다른 폴더에 있는 곳에 변수로 설정해 두었어요.
storeFile file(RELEASE_STORE_FILE)
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
}
}
defaultConfig {
applicationId "net.team88.exampleapp"
minSdkVersion 19
targetSdkVersion 23
multiDexEnabled true
versionCode 1
versionName "1.0"
}
productFlavors { \\ 무료, 유료 버젼 나뉠 때 주로 쓰입니다만 저는 유료버전이 없어서 안써요. ㅎㅎ
}
buildTypes {
debug {
debuggable true
applicationIdSuffix ".debug" // applicationIdSuffix를 통해 빌드타입마다 ID를 바꿔주면 여러가지 버젼을 한 휴대폰이 동시에 깔 수 있습니다.
versionNameSuffix "." + getDate() + "-debug" // 디버그 버젼은 버젼이름이 1.0.20160515-debug
ext.disableCrashlytics = true // Crashlytics라는 트위터에서 fabric이라는 패키지 안에 있는 크래쉬 자동 리포트 서비스 디버그 버전에서는 비활성 시켜 놓은 것입니다.
}
alpha {
applicationIdSuffix ".alpha"
versionNameSuffix "." + getDate() + "-alpha"
}
beta {
applicationIdSuffix ".beta"
versionNameSuffix "." + getDate() + "-beta"
signingConfig signingConfigs.release // signingConfigs의 beta 키로 사인을 합니다.
}
release {
signingConfig signingConfigs.release // 릴리즈를 위해 사용하는 진짜 키로 사인합니다.
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
versionNameSuffix "." + getDate() + "-release"
}
}
}
def getDate() {
def date = new Date()
def formattedDate = date.format('yyyyMMdd')
return formattedDate
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment