안드로이드 프로젝트를jar 패키지로 만들기
1017 단어 안드로이드 프로젝트jar 패키지
2、library에 있는build.gradle 파일에서 설정
def SDK_BASENAME = "idcardcamera";
def SDK_VERSION = "_v1.0";
def OUTPUT_PATH = "build";
def INPUT_PATH = file('build/intermediates/packaged-classes/release/classes.jar')
//
task deleteBuild(type: Delete) {
delete OUTPUT_PATH + SDK_BASENAME + SDK_VERSION + ".jar"
}
//
task makeJar(type: Jar) {
// classes.jar
from zipTree(INPUT_PATH)
// assets jar
from fileTree(dir: 'src/main',include: ['assets/**'])
from fileTree(dir: 'src/main',include: ['res/**'])
from fileTree(dir: 'src/main',include: ['AndroidManifest.xml'])
//
exclude('test/', 'BuildConfig.class')
//
baseName = SDK_BASENAME + SDK_VERSION
//
destinationDir = file(OUTPUT_PATH)
}
makeJar.dependsOn(deleteBuild, build)
3,gradle/library/other/makeJar를 클릭하면jar패키지 생성