-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extracted processor tests into the separate android module
- Loading branch information
Showing
8 changed files
with
125 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import org.gradle.internal.jvm.Jvm | ||
|
||
apply plugin: 'com.android.library' | ||
apply plugin: 'checkstyle' | ||
|
||
android { | ||
compileSdkVersion rootProject.ext.compileSdkVersion | ||
|
||
defaultConfig { | ||
minSdkVersion rootProject.ext.minSdkVersion | ||
targetSdkVersion rootProject.ext.targetSdkVersion | ||
|
||
versionCode 1 | ||
versionName "1.0" | ||
|
||
// this is required for having an annotation processor in the compiling classpath | ||
javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility rootProject.ext.sourceCompatibilityVersion | ||
targetCompatibility rootProject.ext.targetCompatibilityVersion | ||
} | ||
|
||
testOptions { | ||
unitTests.returnDefaultValues = true | ||
} | ||
} | ||
|
||
checkstyle { | ||
configFile rootProject.file('checkstyle.xml') | ||
showViolations true | ||
} | ||
|
||
dependencies { | ||
testImplementation project(':lightcycle-processor') | ||
testImplementation deps.javapoet | ||
|
||
testImplementation deps.android | ||
testImplementation deps.appcompat_x | ||
testImplementation deps.compiletesting | ||
|
||
testImplementation files(getRuntimeJar()) | ||
testImplementation files(Jvm.current().getToolsJar()) | ||
} | ||
|
||
// Taken from: | ||
// https://github.com/JakeWharton/butterknife/blob/bac9b737fdc7e37a30cd8407289e626bd5a161bc/butterknife-runtime/build.gradle | ||
static def getRuntimeJar() { | ||
try { | ||
final File javaBase = new File(System.getProperty("java.home")).getCanonicalFile(); | ||
File runtimeJar = new File(javaBase, "lib/rt.jar"); | ||
if (runtimeJar.exists()) { | ||
return runtimeJar; | ||
} | ||
runtimeJar = new File(javaBase, "jre/lib/rt.jar"); | ||
return runtimeJar.exists() ? runtimeJar : null; | ||
} catch (IOException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<manifest package="com.example.lightcycle_processor_tests" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.