title: How to export a jar that can include the whole project using android studio?
body: <p>This application is a customized View which has a 3d effect:
  <a href="http://i.stack.imgur.com/E7i7f.png" rel="nofollow">enter image description here</a></p>
  
  <p>Please notice the contents which are surrounded by the red box.
  *.so is a C++ SDK which contains some 3d animation effects.</p>
  
  <p>I want to make this whole project into a widget SDK, so I can simply reuse it in my other project.</p>
  
  <p>Could anybody give me some suggestions how to make it happened?</p>
  
  <p>Here is my build.gradle, unfortunately this gradle export a jar I can not use, which I think the reason that it is lacked of *.so.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>apply plugin: 'com.android.library'
  
  android {
      compileSdkVersion 22
      buildToolsVersion "23.0.0 rc2"
  
      defaultConfig {
  
          minSdkVersion 19
          targetSdkVersion 22
  
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  
      sourceSets{
          main{
              jniLibs.srcDirs=['libs']
          }
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      compile 'com.android.support:appcompat-v7:22.2.0'
  }
  
  //task to delete the old jar
  task deleteOldJar(type:Delete){
      delete 'release/AndroidPlugin.jar'
  }
  
  //task to export contents as jar
  task exportJar(type:Copy){
      from('build/intermediates/bundles/release/')
      into('release/')
      include('classes.jar')
      //give whatever name you want to give
      rename('classes.jar','icreatorSDK.jar')
  }
  
  exportJar.dependsOn(deleteOldJar,build)</code></pre>
  </div>
  </div>
  </p>
  
  <p>Waiting for your advice. Thank you!</p>