Discussion:
fatjar task for android project
schujk
2013-10-14 20:02:59 UTC
Permalink
Not sure what I am doing incorrectly...I've included a jar task but the final
jar file is missing a significant amount of compiled classes that are in
.../build/classes/debug/...

build.gradle below:

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}

apply plugin: 'android'

dependencies{
compile fileTree(dir: 'libs', include: '*.jar')
}

android {
compileSdkVersion 17
buildToolsVersion "17.0.0"

defaultConfig {
minSdkVersion 9
targetSdkVersion 17
}

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
}
signingConfigs {
release
}

buildTypes {
debug {
packageNameSuffix ".debug"
versionNameSuffix "-debug"
}

release {
packageNameSuffix ".release"
versionNameSuffix = "-release"
signingConfig signingConfigs.release

runProguard true
proguardFile getDefaultProguardFile('proguard-android.txt')
}
}
}


task jar(type: Jar) {
appendix = "fat"
from android.sourceSets.main.java
from { configurations.compile.collect { it.isDirectory() ? it :
zipTree(it) } }
}



--
View this message in context: http://gradle.1045684.n5.nabble.com/fatjar-task-for-android-project-tp5711941.html
Sent from the gradle-user mailing list archive at Nabble.com.
Luke Daley
2013-10-15 11:15:33 UTC
Permalink
Hi,

This list is no longer operational.

Please use http://forums.gradle.org.

Thanks.
Post by schujk
Not sure what I am doing incorrectly...I've included a jar task but the final
jar file is missing a significant amount of compiled classes that are in
.../build/classes/debug/...
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android'
dependencies{
compile fileTree(dir: 'libs', include: '*.jar')
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 9
targetSdkVersion 17
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
}
signingConfigs {
release
}
buildTypes {
debug {
packageNameSuffix ".debug"
versionNameSuffix "-debug"
}
release {
packageNameSuffix ".release"
versionNameSuffix = "-release"
signingConfig signingConfigs.release
runProguard true
proguardFile getDefaultProguardFile('proguard-android.txt')
}
}
}
task jar(type: Jar) {
appendix = "fat"
from android.sourceSets.main.java
zipTree(it) } }
}
--
View this message in context: http://gradle.1045684.n5.nabble.com/fatjar-task-for-android-project-tp5711941.html
Sent from the gradle-user mailing list archive at Nabble.com.
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
--
Luke Daley
Principal Engineer, Gradleware
http://gradleware.com

Join us at the Gradle eXchange 2013, Oct 28th in London, UK: http://skillsmatter.com/event/java-jee/gradle-exchange-2013
Loading...