I want to build dependency.
I have gcm-src.jar file.and i want to show compile files('libs/gcm-src.jar') in app build.gradle.
            Asked
            
        
        
            Active
            
        
            Viewed 1,190 times
        
    0
            
            
         
    
    
        Divyesh Rudani
        
- 231
- 1
- 2
- 13
- 
                    1Refer this link and let me know, http://stackoverflow.com/a/16628496/7378951 – Meena Dev Feb 02 '17 at 12:59
- 
                    thanks @ Aanchi Dev , its work perfectly.. – Divyesh Rudani Feb 02 '17 at 13:26
- 
                    Possible duplicate of [Android Studio: Add jar as library?](http://stackoverflow.com/questions/16608135/android-studio-add-jar-as-library) – Sxntk Feb 02 '17 at 14:20
1 Answers
0
            
            
        Use this in your gradle file
// For making jar
task clearJar(type: Delete) {
    delete 'build/libs/nameOfYourJar.jar'
}
task makeJar(type: Copy) {
    from('build/intermediates/bundles/release/')
    into('release/')
    include('classes.jar')
    rename('classes.jar', 'nameOfYourJar.jar')
}
makeJar.dependsOn(clearJar, build)
 
    
    
        Aman Shekhar
        
- 2,719
- 1
- 18
- 29