[메모][ANDROID] jar 를 만들기 위한 Gradle

apply plugin: 'com.android.library'

android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
//applicationId "com.example.jongun.jartest4"
minSdkVersion 15
targetSdkVersion 25
//versionCode 1
//versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
testCompile 'junit:junit:4.12'
compile files('libs/classes.jar')
}

task jar(type: Jar, dependsOn: 'assembleRelease') {
from fileTree(dir: 'build/intermediates/classes/release')
}

task deleteOldJar(type: Delete) {
//delete 'libs/moduleName.jar'
delete 'release/moduleName.jar'
}

//task to export contents as jar
task exportJar(type: Copy) {
from('build/intermediates/bundles/release/')
//into('libs/')
into('release/')
include('classes.jar')
///Give whatever name you want to give
rename('classes.jar', 'moduleName.jar')
}

exportJar.dependsOn(deleteOldJar, build)


저작자 표시
신고

'ETC' 카테고리의 다른 글

[메모][ANDROID] jar 를 만들기 위한 Gradle  (0) 2017.07.11
개발을 해도 될 자  (0) 2017.01.30
[손 노트 ]QUAD 그리는 법 정리  (0) 2015.11.23
윈도우즈에서 Hap 코덱 사용하기  (0) 2015.08.29
SUR40 의 문제  (68) 2011.11.29
[VS2010] 테마 바꾸기  (71) 2011.04.22
Yamecoder 야매코더_
ETC 2017.07.11 12:19
Powerd by Tistory, designed by criuce
rss