Skip to content

Instantly share code, notes, and snippets.

@uchidev
Last active November 11, 2015 05:36
Show Gist options
  • Save uchidev/501c9cb9d8834ac5e91d to your computer and use it in GitHub Desktop.
Save uchidev/501c9cb9d8834ac5e91d to your computer and use it in GitHub Desktop.
build.config files
apply plugin: 'com.android.application'
android {
compileSdkVersion 15
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.uchidev.api15"
minSdkVersion 8
targetSdkVersion 15
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'
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
defaultConfig {
minSdkVersion 8
targetSdkVersion 23
versionCode 107
versionName "1.0.7-SNAPSHOT"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
signingConfigs {
release {
if (System.getenv("KEYSTORE") != null) {
storeFile file(System.getenv("KEYSTORE"))
storePassword System.getenv("KEYSTORE_PASSWORD")
keyAlias System.getenv("KEYALIAS_GIFANIM")
keyPassword System.getenv("KEYALIAS_GIFANIM_PASSWORD")
} else {
storeFile file("dummy.keystore")
storePassword "dummy.keystore.password"
keyAlias "dummy.keyalias"
keyPassword "dummy.keyalias.password"
}
}
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
}
repositories {
maven { url 'file://D:/maven/REPO' }
maven { url 'file://D:/maven/SNAPSHOT' }
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.uchidev.gifanim:gifanimfgmt:2.7.0-SNAPSHOT'
}
import org.apache.tools.ant.taskdefs.condition.Os
apply plugin: 'com.android.library'
apply plugin: 'maven'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
minSdkVersion 8
targetSdkVersion 23
versionCode 216
versionName "2.7.0-SNAPSHOT"
ndk {
moduleName "giftool"
}
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets.main {
//jniLibs.srcDir 'src/main/libs'
jni.srcDirs = ['src/main/jni'] //disable automatic ndk-build call
}
sourceSets.androidTest {
java.srcDirs = ['src/androidTest/java']
resources.srcDirs = ['src/androidTest/res']
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.1.0'
testCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.0'
androidTestCompile 'com.android.support.test:testing-support-lib:0.1'
androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
androidTestCompile 'org.mockito:mockito-core:1.10.19'
}
task ndkBuild (type: Exec) {
def ndkBuildPath = android.ndkDirectory.getAbsolutePath()
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
ndkBuildPath += "/ndk-build.cmd"
} else {
ndkBuildPath += "/ndk-build"
}
commandLine ndkBuildPath, '-C', file('src/main').absolutePath
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn ndkBuild
}
uploadArchives {
repositories {
mavenDeployer {
pom.groupId = 'com.uchidev.gifanim'
pom.artifactId = 'gifanimfgmt'
pom.version = android.defaultConfig.versionName
if (project.hasProperty('local.maven.repository')) {
repository(url: project.property('local.maven.repository'))
if (project.hasProperty('local.maven.snapshotrepository')) {
snapshotRepository(url: project.property('local.maven.snapshotrepository'))
}
} else {
def repo = new File(rootDir, "repository")
repository(url: "file://${repo.absolutePath}")
}
}
}
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
artifacts {
archives sourcesJar
}
android.useDeprecatedNdk=true
local.maven.repository=file://D:/maven/REPO
local.maven.snapshotrepository=file://D:/maven/SNAPSHOT
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.uchidev.mapsample01"
minSdkVersion 9
targetSdkVersion 22
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:appcompat-v7:22.2.0'
compile 'com.google.android.gms:play-services:8.1.0'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment