Zennichimaro
Zennichimaro

Reputation: 5306

gradle task jar not working

I am trying to include a file into my .jar but failed to do so, it says BUILD SUCCESSFUL but the classes.dex is never included inside the jar... I'm really stressed from this graddle stuff... any help is very appreciated, here is my gradle task:

task jar(type: Jar) {
    println( "WHAT" + "${buildDir}\\classes\\classes.dex")
    include "${buildDir}\\classes\\classes.dex"
}

println resolved to existing classes.dex with the correct permission, so I don't see any trouble, I even tried copied out the classes.dex and refer it directly, still it failed.

I use apply plugin 'android-library' though not sure if that is the problem, if I apply plugin 'java' it works...

Upvotes: 0

Views: 1219

Answers (1)

Jenny Kim
Jenny Kim

Reputation: 1565

try to change include to from

task jar(type: Jar) {
    println( "WHAT" + "${buildDir}\\classes\\classes.dex")
    from ("${buildDir}\\classes\\classes.dex")
}

Upvotes: 1

Related Questions