def isWinOs = System.properties['os.name'].toLowerCase().contains('windows') apply plugin: 'com.android.library' android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { minSdkVersion 17 targetSdkVersion 23 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:support-v4:+' } task cleanDistDir (type: Delete) { delete "../dist/" } task copyAar << { copy { from "../package.json" into "../dist" } copy { from "build/outputs/aar/widgets-release.aar" into "../dist/platforms/android/" } } task packFramework (type: Exec) { workingDir "../dist" if(isWinOs) { commandLine "cmd", "/c", "npm", "pack" } else { commandLine "npm", "pack" } } assembleRelease.dependsOn(cleanDistDir) copyAar.dependsOn(assembleRelease) packFramework.dependsOn(copyAar)