gradle: more fun

This commit is contained in:
Hannes Janetzek 2014-11-20 01:01:27 +01:00
parent aaec15a66a
commit 711ca7f6d9
3 changed files with 35 additions and 28 deletions

View File

@ -1,6 +1,9 @@
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
configurations { providedCompile } configurations {
providedCompile
eclipseCompile
}
dependencies { dependencies {
compile project(':vtm-android') compile project(':vtm-android')
@ -8,8 +11,8 @@ dependencies {
compile project(':vtm-extras') compile project(':vtm-extras')
compile project(':vtm-themes') compile project(':vtm-themes')
compile project(':appcompat') compile 'com.android.support:support-v4:21.+'
//compile 'com.android.support:support-v4:21.+' eclipseCompile project(':appcompat')
compile 'com.noveogroup.android:android-logger:1.3.4' compile 'com.noveogroup.android:android-logger:1.3.4'
} }
@ -48,7 +51,7 @@ android {
eclipse { eclipse {
classpath { classpath {
plusConfigurations += [ configurations.compile ] plusConfigurations += [ configurations.compile, configurations.eclipseCompile ]
defaultOutputDir = file('bin/classes') defaultOutputDir = file('bin/classes')
@ -61,18 +64,20 @@ eclipse {
// and generated copies // and generated copies
beforeMerged { classpath -> beforeMerged { classpath ->
// Remove all source entries to avoid overlap // Remove all source entries to avoid overlap
classpath.entries.removeAll() { c -> classpath.entries.removeAll() { e ->
c.kind == 'src' e.kind == 'src'
} }
} }
// only used to explode jni .so into aar // only used to explode jni .so into aar
whenMerged { whenMerged {
classpath -> classpath ->
classpath.entries.findAll { entry -> classpath.entries.findAll { e ->
entry.path.contains('ANDROID_FRAMEWORK') || e.path.contains('ANDROID_FRAMEWORK')
entry.path.contains('support')
}*.exported = false }*.exported = false
classpath.entries.removeAll() { e ->
e.path.contains('support')
}
} }
// Direct manipulation of the generated classpath XML // Direct manipulation of the generated classpath XML

View File

@ -1,14 +1,16 @@
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
configurations { providedCompile } configurations {
providedCompile
eclipseCompile
}
dependencies { dependencies {
compile project(':vtm-android') compile project(':vtm-android')
compile project(':vtm-themes') compile project(':vtm-themes')
compile project(':appcompat') compile 'com.android.support:support-v4:21.+'
//compile 'com.android.support:support-v4:21.+' eclipseCompile project(':appcompat')
//compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.noveogroup.android:android-logger:1.3.4' compile 'com.noveogroup.android:android-logger:1.3.4'
} }
@ -44,7 +46,7 @@ eclipse {
// Configuring Eclipse classpath // Configuring Eclipse classpath
classpath { classpath {
plusConfigurations += [ configurations.compile ] plusConfigurations += [ configurations.compile, configurations.eclipseCompile ]
defaultOutputDir = file('bin/classes') defaultOutputDir = file('bin/classes')
@ -57,18 +59,20 @@ eclipse {
// and generated copies // and generated copies
beforeMerged { classpath -> beforeMerged { classpath ->
// Remove all source entries to avoid overlap // Remove all source entries to avoid overlap
classpath.entries.removeAll() { c -> classpath.entries.removeAll() { e ->
c.kind == 'src' e.kind == 'src'
} }
} }
// only used to explode jni .so into aar // only used to explode jni .so into aar
whenMerged { whenMerged {
classpath -> classpath ->
classpath.entries.findAll { entry -> classpath.entries.findAll { e ->
entry.path.contains('ANDROID_FRAMEWORK') || e.path.contains('ANDROID_FRAMEWORK')
entry.path.contains('support')
}*.exported = false }*.exported = false
classpath.entries.removeAll() { e ->
e.path.contains('support')
}
} }
// Direct manipulation of the generated classpath XML // Direct manipulation of the generated classpath XML

View File

@ -10,7 +10,6 @@ dependencies {
provided files("${rootDir}/vtm-ext-libs/native-libs.jar") provided files("${rootDir}/vtm-ext-libs/native-libs.jar")
compile 'com.android.support:support-v4:21.+' compile 'com.android.support:support-v4:21.+'
eclipseCompile project(':appcompat') eclipseCompile project(':appcompat')
} }
@ -59,21 +58,20 @@ eclipse {
// and generated copies // and generated copies
beforeMerged { classpath -> beforeMerged { classpath ->
// Remove all source entries to avoid overlap // Remove all source entries to avoid overlap
classpath.entries.removeAll() { c -> classpath.entries.removeAll() { e ->
c.kind == 'src' e.kind == 'src'
} }
} }
// only used to explode jni .so into aar // only used to explode jni .so into aar
whenMerged { whenMerged {
classpath -> classpath ->
classpath.entries.findAll { c -> classpath.entries.findAll { e ->
c.path.contains('native-libs') || e.path.contains('native-libs') ||
c.path.contains('ANDROID_FRAMEWORK') e.path.contains('ANDROID_FRAMEWORK')
}*.exported = false }*.exported = false
classpath.entries.removeAll() { e ->
classpath.entries.removeAll() { c -> e.path.contains('support')
c.path.contains('support')
} }
} }