-
-
Save tasyjean/5d92ef96c008c2865904b8e865047fa1 to your computer and use it in GitHub Desktop.
Gradle : build.gradle file for a AAR Module Library Project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.library' | |
android { | |
signingConfigs { | |
release { | |
try { | |
keyAlias KEYSTORE_ALIAS | |
keyPassword KEY_PASSWORD | |
storeFile file(KEYSTORE_FILEPATH) | |
storePassword KEYSTORE_PASSWORD | |
} | |
catch (ex) { | |
throw new InvalidUserDataException("You should define KEYSTORE_ALIAS, KEYSTORE_FILEPATH, KEYSTORE_PASSWORD and KEY_PASSWORD in gradle.properties.") | |
} | |
} | |
} | |
compileSdkVersion 22 | |
buildToolsVersion "21.1.2" | |
defaultConfig { | |
minSdkVersion 10 | |
targetSdkVersion 22 | |
versionCode 1 | |
versionName "1.0.0" | |
archivesBaseName = "Project Name" | |
version = android.defaultConfig.versionName | |
} | |
buildTypes { | |
debug { | |
minifyEnabled false | |
} | |
release { | |
signingConfig signingConfigs.release | |
minifyEnabled true | |
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | |
} | |
} | |
libraryVariants.all { variant -> | |
variant.outputs.each { output -> | |
def outputFile = output.outputFile | |
if (outputFile != null && outputFile.name.endsWith('.aar')) { | |
def fileName = "${archivesBaseName}-${version}-${variant.buildType.name}.aar" | |
output.outputFile = new File(outputFile.parent, fileName) | |
} | |
} | |
} | |
} | |
dependencies { | |
compile fileTree(dir: 'libs', include: ['*.jar']) | |
compile 'com.android.support:appcompat-v7:22.0.0' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment