/* * Copyright 2014 serso aka se.solovyev * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Contact details * * Email: se.solovyev@gmail.com * Site: http://se.solovyev.org */ apply plugin: 'com.android.application' apply plugin: 'maven' apply plugin: 'signing' apply plugin: 'com.neenbedankt.android-apt' android { compileSdkVersion 23 buildToolsVersion '23.0.2' defaultConfig { minSdkVersion 9 targetSdkVersion 23 versionCode 143 versionName '2.1.4' testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" generatedDensities = [] } buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard.cfg' zipAlignEnabled true } debug { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-debug.cfg' } } lintOptions { abortOnError false warning 'MissingTranslation' } compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } // This is handled for you by the 2.0+ Gradle Plugin aaptOptions { additionalParameters "--no-version-vectors" } } dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile 'com.android.support:support-v4:23.2.0' compile 'com.android.support:appcompat-v7:23.2.0' compile 'com.android.support:cardview-v7:23.2.0' compile 'com.android.support:design:23.2.0' compile('ch.acra:acra:4.7.0') { exclude group: 'org.json' } compile ':measure:' compile ':drag-button:1.1@aar' compile ':square-otto:1.3.9-SNAPSHOT' apt ':square-otto-compiler:1.3.9-SNAPSHOT' apt 'com.squareup:javapoet:1.5.1' compile(project(':jscl')) { exclude(module: 'xercesImpl') } compile 'org.solovyev.android:checkout:0.7.5@aar' compile 'org.solovyev.android:material:0.1.4@aar' compile 'com.google.android.gms:play-services-ads:8.4.0' compile 'com.google.android.gms:play-services-base:8.4.0' compile 'com.google.android.gms:play-services-analytics:8.4.0' compile(name: 'plotter', ext: 'aar') compile 'com.google.guava:guava:19.0' compile('org.simpleframework:simple-xml:2.6.1') { exclude(module: 'stax') exclude(module: 'stax-api') exclude(module: 'xpp3') } compile 'com.jakewharton:butterknife:7.0.1' compile 'com.google.dagger:dagger:2.0.2' apt "com.google.dagger:dagger-compiler:2.0.2" compile 'javax.annotation:jsr250-api:1.0' testCompile 'junit:junit:4.12' testCompile 'net.sf.opencsv:opencsv:2.0' testCompile 'org.mockito:mockito-core:1.9.0' testCompile 'org.robolectric:robolectric:3.0' testCompile 'org.mockito:mockito-all:1.9.5' testCompile 'org.skyscreamer:jsonassert:1.2.3' testCompile(name: 'org.apache.http.legacy', ext: 'jar') androidTestCompile 'com.android.support:support-annotations:23.2.0' androidTestCompile 'com.android.support.test:runner:0.4.1' androidTestCompile 'com.android.support.test:rules:0.4.1' androidTestCompile 'org.hamcrest:hamcrest-library:1.3' androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1' } apt { arguments { 'otto.generate' 'anonymous' } } tasks.withType(Test) { scanForTestClasses = false include "**/*Test.class" exclude "**/*AndroidCalculatorEditorViewTest*" exclude "**/*CalculatorWizardActivityTest*" exclude "**/*OnScreenCalculatorWizardStepTest*" exclude "**/*CalculatorWizardTest*" exclude "**/*WizardStepTest*" exclude "**/*AngleUnitsButtonTest*" exclude "**/*NumeralBasesButtonTest*" } task androidJavadocs(type: Javadoc) { source = android.sourceSets.main.java.srcDirs classpath += project.files(android.bootClasspath.join(File.pathSeparator)) configurations.compile.each { File file -> classpath += project.files(file.path) } } task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { classifier = 'javadoc' from androidJavadocs.destinationDir } task androidSourcesJar(type: Jar) { classifier = 'sources' from android.sourceSets.main.java.srcDirs } artifacts { archives androidSourcesJar archives file: file('build/outputs/apk/calculatorpp-release.apk'), name: 'calculatorpp-app', classifier: 'signed', type: 'apk' archives file: file('build/outputs/mapping/release/mapping.txt'), name: 'calculatorpp-app', classifier: 'proguard', type: 'txt' } signing { sign configurations.archives } gradle.taskGraph.afterTask { Task task -> if (task.project.name == 'app') { if (task.name == 'mergeReleaseResources') { cleanGoogleServicesResources('release') } else if (task.name == 'mergeDebugResources') { cleanGoogleServicesResources('debug') } } } private void cleanGoogleServicesResources(buildType) { ant.delete(includeEmptyDirs: 'true') { fileset(dir: file('./build/intermediates/res/merged/' + buildType), includes: '**/common_*') } } group = "org.solovyev.android" version = android.defaultConfig.versionName uploadArchives { repositories { mavenDeployer { beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { authentication(userName: ossrhUsername, password: ossrhPassword) } snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { authentication(userName: ossrhUsername, password: ossrhPassword) } pom.project { artifactId = 'calculatorpp-app' name 'Calculator++ Application' packaging 'apk' description 'Calculator for Android' url 'https://github.com/serso/android-calculatorpp' scm { url 'https://github.com/serso/android-calculatorpp' connection 'scm:https://serso@github.com/serso/android-calculatorpp.git' developerConnection 'scm:git://github.com/serso/android-calculatorpp.git' } licenses { license { name 'The Apache Software License, Version 2.0' url 'http://www.apache.org/licenses/LICENSE-2.0.txt' distribution 'repo' } } developers { developer { id 'se.solovyev' name 'Sergey Solovyev' email 'se.solovyev@gmail.com' } } } } } }