Skip to content

Commit

Permalink
lint checking, removed test code
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessandro Crugnola committed Mar 15, 2016
1 parent ad917a0 commit a291c02
Show file tree
Hide file tree
Showing 14 changed files with 520 additions and 793 deletions.
30 changes: 30 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
language: android

jdk:
- oraclejdk8

android:
components:
- tools
- build-tools-23.0.2
- android-23
- extra-android-m2repository
- extra-google-m2repository
- extra-android-support

notifications:
email:
- [email protected]

cache: false
sudo: false

install:
# Ensure Gradle wrapper is executable, download wrapper and show version
- chmod +x ./gradlew; ls -l gradlew; ./gradlew wrapper -v

# Download and show android dependencies
- ./gradlew androidDependencies

script:
- ./gradlew library:check library:assemble
16 changes: 5 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,20 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:+'
classpath 'com.android.tools.build:gradle:2.1.0-alpha2'
}
}

allprojects {
apply plugin: 'maven'
apply plugin: 'maven-publish'
version = VERSION_NAME
group = GROUP

repositories {
jcenter()
mavenCentral()
mavenLocal()
maven {
url uri("https://oss.sonatype.org/content/repositories/snapshots")
}
maven {
url uri("https://oss.sonatype.org/content/repositories/releases")
}
}
}

task wrapper(type: Wrapper) {
gradleVersion = '2.9'
gradleVersion = '2.11'
}
26 changes: 26 additions & 0 deletions checkstyle.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apply plugin: 'checkstyle'

checkstyle {
toolVersion '6.8'
configFile rootProject.file('gradle/checkstyle.xml')
showViolations true
configProperties = [
'checkstyle.cache.file': rootProject.file('build/checkstyle.cache'),
]
}

def variants = (project.plugins.hasPlugin('android-library') ?
project.android.libraryVariants :
project.android.applicationVariants)

variants.all { variant ->
def name = variant.buildType.name

def checkstyle = project.tasks.create "checkstyle${name.capitalize()}", Checkstyle
checkstyle.dependsOn variant.javaCompile
checkstyle.source variant.javaCompile.source
checkstyle.classpath = project.fileTree(variant.javaCompile.destinationDir)
checkstyle.exclude('**/BuildConfig.java')
checkstyle.exclude('**/R.java')
project.tasks.getByName("check").dependsOn checkstyle
}
8 changes: 4 additions & 4 deletions demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ dependencies {
}

android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
compileSdkVersion ANDROID_BUILD_SDK_VERSION as int
buildToolsVersion ANDROID_BUILD_TOOLS_VERSION

defaultConfig {
versionCode 1
versionName '1.0.0'
minSdkVersion 14
targetSdkVersion 23
minSdkVersion 16
targetSdkVersion ANDROID_BUILD_TARGET_SDK_VERSION as int
}

sourceSets {
Expand Down
Loading

0 comments on commit a291c02

Please sign in to comment.