Skip to content

Commit

Permalink
Refactor dependency related code
Browse files Browse the repository at this point in the history
  • Loading branch information
xfumihiro committed Nov 3, 2015
1 parent 361c562 commit 371a511
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 44 deletions.
24 changes: 23 additions & 1 deletion build.gradle
Expand Up @@ -15,7 +15,7 @@ configure(subprojects.findAll { it.name != 'sample' }) {
repositories {
jcenter()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
url SNAPSHOT_REPOSITORY_URL
}
}

Expand All @@ -28,9 +28,31 @@ configure(subprojects.findAll { it.name != 'sample' }) {
}

ext {
androidPlugin = 'com.android.tools.build:gradle:1.3.1'
minSdkVersion = 14
compileSdkVersion = 21
buildToolsVersion = '23.0.1'

// Android dependencies
appcompatV72103 = 'com.android.support:appcompat-v7:21.0.3'
appcompatV72310 = 'com.android.support:appcompat-v7:23.1.0'

// AspectJ dependencies
aspectjTools = 'org.aspectj:aspectjtools:1.8.6'
aspectjRuntime = 'org.aspectj:aspectjrt:1.8.6'

// Dagger dependencies
dagger = 'com.google.dagger:dagger:2.0.1'
daggerCompiler = 'com.google.dagger:dagger-compiler:2.0.1'
javaxAnnotation = 'org.glassfish:javax.annotation:10.0-b28'

// Third-party dependencies
dexmaker = 'com.google.dexmaker:dexmaker:1.1'
scalpel = 'com.jakewharton.scalpel:scalpel:1.1.2'
rxPreference = 'com.f2prateek.rx.preferences:rx-preferences:1.0.0'
autoParcel = 'com.github.frankiesardo:auto-parcel:0.3'
autoParcelProcessor = 'com.github.frankiesardo:auto-parcel-processor:0.3'

pomConfig = {
name POM_NAME
description POM_DESCRIPTION
Expand Down
10 changes: 5 additions & 5 deletions sample/build.gradle
Expand Up @@ -2,20 +2,20 @@ buildscript {
repositories {
jcenter()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
url SNAPSHOT_REPOSITORY_URL
}
}

dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
classpath rootProject.ext.androidPlugin
classpath 'com.github.xfumihiro.view-inspector:view-inspector-plugin:0.2.0-SNAPSHOT'
}
}

repositories {
jcenter()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
url SNAPSHOT_REPOSITORY_URL
}
}

Expand All @@ -37,13 +37,13 @@ android {

defaultConfig {
applicationId "com.github.xfumihiro.view_inspector.sample"
minSdkVersion 14
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
}

dependencies {
compile 'com.android.support:appcompat-v7:21.0.3'
compile rootProject.ext.appcompatV72103
}
22 changes: 15 additions & 7 deletions view-inspector-aspect-v23/build.gradle
Expand Up @@ -51,13 +51,21 @@ android.libraryVariants.all { variant ->

dependencies {
compile 'com.github.xfumihiro.view-inspector:view-inspector-runtime:0.2.0-SNAPSHOT'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.f2prateek.rx.preferences:rx-preferences:1.0.0'
compile 'org.aspectj:aspectjrt:1.8.6'
apt 'com.google.dagger:dagger-compiler:2.0.1'
compile 'com.google.dagger:dagger:2.0.1'
provided 'org.glassfish:javax.annotation:10.0-b28'
compile 'com.jakewharton.scalpel:scalpel:1.1.2'

// Android dependencies
compile rootProject.ext.appcompatV72310

// AspectJ dependencies
compile rootProject.ext.aspectjRuntime

// Dagger dependencies
compile rootProject.ext.dagger
apt rootProject.ext.daggerCompiler
provided rootProject.ext.javaxAnnotation

// Third-party dependencies
compile rootProject.ext.scalpel
compile rootProject.ext.rxPreference
}

apply from: 'publish.gradle'
22 changes: 15 additions & 7 deletions view-inspector-aspect/build.gradle
Expand Up @@ -51,13 +51,21 @@ android.libraryVariants.all { variant ->

dependencies {
compile 'com.github.xfumihiro.view-inspector:view-inspector-runtime:0.2.0-SNAPSHOT'
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.f2prateek.rx.preferences:rx-preferences:1.0.0'
compile 'org.aspectj:aspectjrt:1.8.6'
apt 'com.google.dagger:dagger-compiler:2.0.1'
compile 'com.google.dagger:dagger:2.0.1'
provided 'org.glassfish:javax.annotation:10.0-b28'
compile 'com.jakewharton.scalpel:scalpel:1.1.2'

// Android dependencies
compile rootProject.ext.appcompatV72103

// AspectJ dependencies
compile rootProject.ext.aspectjRuntime

// Dagger dependencies
compile rootProject.ext.dagger
apt rootProject.ext.daggerCompiler
provided rootProject.ext.javaxAnnotation

// Third-party dependencies
compile rootProject.ext.scalpel
compile rootProject.ext.rxPreference
}

apply from: 'publish.gradle'
6 changes: 3 additions & 3 deletions view-inspector-plugin/build.gradle
Expand Up @@ -6,9 +6,9 @@ sourceCompatibility = JavaVersion.VERSION_1_7
dependencies {
compile gradleApi()
compile localGroovy()
compile 'com.android.tools.build:gradle:1.3.1'
compile 'org.aspectj:aspectjtools:1.8.6'
compile 'org.aspectj:aspectjrt:1.8.6'
compile rootProject.ext.androidPlugin
compile rootProject.ext.aspectjTools
compile rootProject.ext.aspectjRuntime
}

apply from: 'publish.gradle'
Expand Up @@ -20,15 +20,23 @@ class ViewInspectorPlugin implements Plugin<Project> {

project.dependencies {
debugCompile 'com.github.xfumihiro.view-inspector:view-inspector-runtime:0.2.0-SNAPSHOT'
debugCompile 'org.aspectj:aspectjrt:1.8.6'
debugCompile('com.google.dexmaker:dexmaker:1.1') {

// Android dependencies
debugCompile project.rootProject.ext.appcompatV72103

// AspectJ dependencies
debugCompile project.rootProject.ext.aspectjRuntime

// Dagger dependencies
debugCompile project.rootProject.ext.dagger

// Third-party dependencies
debugCompile(project.rootProject.ext.dexmaker) {
transitive = true
}
debugCompile 'com.google.dagger:dagger:2.0.1'
debugCompile 'com.f2prateek.rx.preferences:rx-preferences:1.0.0'
debugCompile 'com.github.frankiesardo:auto-parcel:0.3'
debugCompile 'com.jakewharton.scalpel:scalpel:1.1.2'
debugCompile 'com.android.support:appcompat-v7:21.0.3'
debugCompile project.rootProject.ext.scalpel
debugCompile project.rootProject.ext.rxPreference
debugCompile project.rootProject.ext.autoParcel
}

project.extensions.create("viewInspector", ViewInspectorPluginExtension)
Expand Down
28 changes: 14 additions & 14 deletions view-inspector-runtime/build.gradle
Expand Up @@ -12,20 +12,20 @@ android {
}

dependencies {
compile 'com.google.dexmaker:dexmaker:1.1'

apt 'com.google.dagger:dagger-compiler:2.0.1'
compile 'com.google.dagger:dagger:2.0.1'
provided 'org.glassfish:javax.annotation:10.0-b28'

compile 'com.f2prateek.rx.preferences:rx-preferences:1.0.0'

compile 'com.github.frankiesardo:auto-parcel:0.3'
apt 'com.github.frankiesardo:auto-parcel-processor:0.3'

compile 'com.jakewharton.scalpel:scalpel:1.1.2'

compile 'com.android.support:appcompat-v7:21.0.3'
// Android dependencies
compile rootProject.ext.appcompatV72103

// Dagger dependencies
compile rootProject.ext.dagger
apt rootProject.ext.daggerCompiler
provided rootProject.ext.javaxAnnotation

// Third-party dependencies
compile rootProject.ext.dexmaker
compile rootProject.ext.scalpel
compile rootProject.ext.rxPreference
compile rootProject.ext.autoParcel
apt rootProject.ext.autoParcelProcessor
}

apply from: 'publish.gradle'

0 comments on commit 371a511

Please sign in to comment.