Skip to content

Instantly share code, notes, and snippets.

@leeyc09
Created April 23, 2018 06:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leeyc09/a8ab2a25e6df1221747ed4c038a01178 to your computer and use it in GitHub Desktop.
Save leeyc09/a8ab2a25e6df1221747ed4c038a01178 to your computer and use it in GitHub Desktop.
L10nsample_build.gradle
//https://github.com/leeyc09/L10nStringResourceAutomation/blob/master/sample_build.gradle
ext.download_res_folder = 'src/main/res_down' //저장될 별도의 리소스 폴더
ext.script_path = 'script/languageResource.py' //스크립트 저장 경로
ext.GoogleDocId = 'Google Doc ID' //구글 스프레드시트 독 아이디
ext.json_key_path = 'script/some_auth_file.json' ///구글 키 저장 경로
task StringResourceSync(type: Exec) {
doFirst {
println ":::" + "Start to get String Resources..." + ":::"
}
// windows
// commandLine = ['cmd', '/c', 'python' , script_path, GoogleDocId,download_res_folder]
// mac
commandLine =['python', script_path, GoogleDocId, json_key_path, download_res_folder]
doLast {
println ":::" + "Finish to get String Resources..." + ":::"
}
}
preBuild.dependsOn StringResourceSync
android {
...
//추가 리소스 셋을 추가한다.
sourceSets {
main.res.srcDirs += download_res_folder
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment