Skip to content

Commit

Permalink
Gradle Code Style
Browse files Browse the repository at this point in the history
  • Loading branch information
davideas committed Jul 27, 2017
1 parent bef7c68 commit 713b677
Show file tree
Hide file tree
Showing 9 changed files with 380 additions and 411 deletions.
118 changes: 59 additions & 59 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,80 +1,80 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
ext {
// Author
developerId = "davideas"
developerName = "Davide Steduto"
developerEmail = "dave.dna@gmail.com"
// Author
developerId = "davideas"
developerName = "Davide Steduto"
developerEmail = "dave.dna@gmail.com"

// Library Repository
libraryName = "FlexibleAdapter"
bintrayRepo = "maven"
packageExt = "aar"
siteUrl = "https://github.com/davideas/FlexibleAdapter"
gitUrl = "https://github.com/davideas/FlexibleAdapter.git"
// Library Repository
libraryName = "FlexibleAdapter"
bintrayRepo = "maven"
packageExt = "aar"
siteUrl = "https://github.com/davideas/FlexibleAdapter"
gitUrl = "https://github.com/davideas/FlexibleAdapter.git"

// Support and Build tools version
minSdk = 14
targetSdk = 26
buildTools = "26.0.0"
supportLib = "25.4.0"
// Support and Build tools version
minSdk = 14
targetSdk = 26
buildTools = "26.0.0"
supportLib = "25.4.0"

// Support Libraries dependencies
supportDependencies = [
design : "com.android.support:design:${supportLib}",
recyclerview : "com.android.support:recyclerview-v7:${supportLib}",
cardview : "com.android.support:cardview-v7:${supportLib}",
appcompat : "com.android.support:appcompat-v7:${supportLib}",
customtabs : "com.android.support:customtabs:${supportLib}",
support_v4 : "com.android.support:support-v4:${supportLib}",
support_v13 : "com.android.support:support-v13:${supportLib}",
annotations : "com.android.support:support-annotations:${supportLib}"
]
// Support Libraries dependencies
supportDependencies = [
design : "com.android.support:design:${supportLib}",
recyclerview: "com.android.support:recyclerview-v7:${supportLib}",
cardview : "com.android.support:cardview-v7:${supportLib}",
appcompat : "com.android.support:appcompat-v7:${supportLib}",
customtabs : "com.android.support:customtabs:${supportLib}",
support_v4 : "com.android.support:support-v4:${supportLib}",
support_v13 : "com.android.support:support-v13:${supportLib}",
annotations : "com.android.support:support-annotations:${supportLib}"
]

licenseName = "The Apache Software License, Version 2.0"
licenseUrl = "http://www.apache.org/licenses/LICENSE-2.0.txt"
allLicenses = ["Apache-2.0"]
licenseDist = "repo"
licenseName = "The Apache Software License, Version 2.0"
licenseUrl = "http://www.apache.org/licenses/LICENSE-2.0.txt"
allLicenses = ["Apache-2.0"]
licenseDist = "repo"
}

static String getDate() {
def date = new Date()
return date.format('yyyy.MM.dd')
def date = new Date()
return date.format('yyyy.MM.dd')
}

// Avoid JavaDoc Lint failures when using Java8
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}

buildscript {
repositories {
jcenter()
maven {url "http://dl.bintray.com/davideas/maven"}
maven {url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
repositories {
jcenter()
maven { url "http://dl.bintray.com/davideas/maven" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}

dependencies {
classpath "com.android.tools.build:gradle:2.3.3"
classpath "com.neenbedankt.gradle.plugins:android-apt:1.8"
classpath "com.github.dcendents:android-maven-gradle-plugin:1.5"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3"
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.1.1"
classpath "com.vanniktech:gradle-android-javadoc-plugin:0.2.1"
classpath "eu.davidea:grabver:0.3.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
dependencies {
classpath "com.android.tools.build:gradle:2.3.3"
classpath "com.neenbedankt.gradle.plugins:android-apt:1.8"
classpath "com.github.dcendents:android-maven-gradle-plugin:1.5"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3"
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.1.1"
classpath "com.vanniktech:gradle-android-javadoc-plugin:0.2.1"
classpath "eu.davidea:grabver:0.3.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
jcenter()
maven {url "https://maven.google.com" }
maven {url "http://dl.bintray.com/davideas/maven" }
maven {url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
repositories {
jcenter()
maven { url "https://maven.google.com" }
maven { url "http://dl.bintray.com/davideas/maven" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
}
148 changes: 74 additions & 74 deletions flexible-adapter-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,96 +2,96 @@ apply plugin: 'com.android.application'
apply plugin: 'eu.davidea.grabver'

versioning {
major 5
minor 0
preRelease "SNAPSHOT"
major 5
minor 0
preRelease "SNAPSHOT"
}

android {
compileSdkVersion targetSdk
buildToolsVersion buildTools
compileSdkVersion targetSdk
buildToolsVersion buildTools

defaultConfig {
applicationId 'eu.davidea.samples.flexibleadapter'
minSdkVersion minSdk
targetSdkVersion targetSdk
versionCode versioning.code
versionName versioning.name
defaultConfig {
applicationId 'eu.davidea.samples.flexibleadapter'
minSdkVersion minSdk
targetSdkVersion targetSdk
versionCode versioning.code
versionName versioning.name

testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'

applicationVariants.all { variant ->
variant.outputs.each { output ->
def file = output.outputFile
def fileName = 'flexible-adapter-v' + versioning.name + '-c' + versioning.code + '.apk'
output.outputFile = new File(file.parentFile, fileName)
}
}
}
buildTypes {
debug {
versionNameSuffix ' #' + versioning.build + versioning.builtOn
minifyEnabled false
}
release {
zipAlignEnabled true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
testOptions {
unitTests.returnDefaultValues = true
}
applicationVariants.all { variant ->
variant.outputs.each { output ->
def file = output.outputFile
def fileName = 'flexible-adapter-v' + versioning.name + '-c' + versioning.code + '.apk'
output.outputFile = new File(file.parentFile, fileName)
}
}
}
buildTypes {
debug {
versionNameSuffix ' #' + versioning.build + versioning.builtOn
minifyEnabled false
}
release {
zipAlignEnabled true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
testOptions {
unitTests.returnDefaultValues = true
}

dataBinding {
enabled = true
}
dataBinding {
enabled = true
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(dir: 'libs', include: ['*.jar'])

// Testing
androidTestCompile supportDependencies.annotations
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'org.robolectric:robolectric:3.3.2'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:2.7.22'
// Testing
androidTestCompile supportDependencies.annotations
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'org.robolectric:robolectric:3.3.2'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:2.7.22'

// FlexibleAdapter + extensions
compile project (':flexible-adapter')
compile project (':flexible-adapter-ui')
compile project (':flexible-adapter-databinding')
// FlexibleAdapter + extensions
compile project(':flexible-adapter')
compile project(':flexible-adapter-ui')
compile project(':flexible-adapter-databinding')

// FlipView
compile 'eu.davidea:flipview:1.1.3'
// FlipView
compile 'eu.davidea:flipview:1.1.3'

// ButterKnife
compile 'com.jakewharton:butterknife:8.5.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
// ButterKnife
compile 'com.jakewharton:butterknife:8.5.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'

// Support Libraries
compile supportDependencies.appcompat
compile supportDependencies.cardview
compile (supportDependencies.design) {
exclude module: 'support-v4'
exclude module: 'support-annotations'
}
compile (supportDependencies.recyclerview) {
exclude module: 'support-v4';
exclude module: 'support-annotations'
}
// Support Libraries
compile supportDependencies.appcompat
compile supportDependencies.cardview
compile(supportDependencies.design) {
exclude module: 'support-v4'
exclude module: 'support-annotations'
}
compile(supportDependencies.recyclerview) {
exclude module: 'support-v4';
exclude module: 'support-annotations'
}

// Glide (Image Loader)
compile 'com.github.bumptech.glide:glide:3.7.0'
// Glide (Image Loader)
compile 'com.github.bumptech.glide:glide:3.7.0'

// Smooth-app-bar-layout
compile ('me.henrytao:smooth-app-bar-layout:24.1.1.0') {
exclude group: 'com.android.support'
}
// Smooth-app-bar-layout
compile('me.henrytao:smooth-app-bar-layout:24.1.1.0') {
exclude group: 'com.android.support'
}

}
62 changes: 31 additions & 31 deletions flexible-adapter-databinding/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,49 @@ apply plugin: 'com.android.library'
apply plugin: 'eu.davidea.grabver'

versioning {
major 1
minor 0
preRelease "b1"
major 1
minor 0
preRelease "b1"
}

ext {
// Library Settings
libraryName = "FlexibleAdapter DataBinding extension"
libraryDescription = "DataBinding extension for FlexibleAdapter project"
libraryLabels = ['android', 'flexibleadapter', 'adapter', 'databinding', 'binding']
// Library Settings
libraryName = "FlexibleAdapter DataBinding extension"
libraryDescription = "DataBinding extension for FlexibleAdapter project"
libraryLabels = ['android', 'flexibleadapter', 'adapter', 'databinding', 'binding']

publishedGroupId = "eu.davidea"
bintrayName = "flexible-adapter-databinding"
artifact = bintrayName
publishedGroupId = "eu.davidea"
bintrayName = "flexible-adapter-databinding"
artifact = bintrayName
}

android {
compileSdkVersion targetSdk
buildToolsVersion buildTools
compileSdkVersion targetSdk
buildToolsVersion buildTools

defaultConfig {
minSdkVersion minSdk
targetSdkVersion targetSdk
versionCode versioning.code
versionName versioning.name
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
defaultConfig {
minSdkVersion minSdk
targetSdkVersion targetSdk
versionCode versioning.code
versionName versioning.name
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
}

dependencies {
compile project (":flexible-adapter")
provided supportDependencies.recyclerview
compile project(":flexible-adapter")
provided supportDependencies.recyclerview
}

if (project.hasProperty('all') || project.hasProperty('databinding')) {
apply from: '../maven-install.gradle'
apply from: '../jfrog-bintray-publish.gradle'
apply from: '../maven-install.gradle'
apply from: '../jfrog-bintray-publish.gradle'
}
Loading

0 comments on commit 713b677

Please sign in to comment.