Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fb8b19f
commit 7d01cb4
Showing
7 changed files
with
87 additions
and
79 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
1 change: 0 additions & 1 deletion
1
activitystarter-compiler/src/main/java/activitystarter/compiler/model/param/FieldAccessor.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,103 +1,115 @@ | ||
import org.gradle.internal.jvm.Jvm | ||
|
||
buildscript { | ||
dependencies { | ||
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' | ||
} | ||
dependencies { | ||
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' | ||
} | ||
} | ||
|
||
apply plugin: 'com.android.library' | ||
apply plugin: 'kotlin-android' | ||
apply plugin: 'com.github.dcendents.android-maven' | ||
|
||
group='com.marcinmoskala' | ||
group = 'com.marcinmoskala' | ||
|
||
android { | ||
compileSdkVersion rootProject.ext.compileSdkVersion | ||
compileSdkVersion rootProject.ext.compileSdkVersion | ||
|
||
defaultConfig { | ||
minSdkVersion rootProject.ext.minSdkVersion | ||
minSdkVersion rootProject.ext.minSdkVersion | ||
|
||
consumerProguardFiles 'proguard-rules.txt' | ||
consumerProguardFiles 'proguard-rules.txt' | ||
|
||
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' | ||
} | ||
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' | ||
} | ||
|
||
sourceSets { | ||
main.java.srcDirs += 'src/main/kotlin' | ||
test.java.srcDirs += 'src/test/kotlin' | ||
} | ||
buildToolsVersion '27.0.3' | ||
} | ||
|
||
dependencies { | ||
api project(':activitystarter-annotations') | ||
implementation deps.supportAnnotations | ||
implementation deps.supportCompat | ||
implementation deps.supportAppcompatv7 | ||
|
||
androidTestImplementation deps.junit | ||
androidTestImplementation deps.truth | ||
androidTestImplementation deps.supportTestRunner | ||
|
||
testImplementation deps.junit | ||
testImplementation deps.truth | ||
testImplementation deps.compiletesting | ||
testImplementation project(':activitystarter-compiler') | ||
testImplementation deps.kotlin | ||
testImplementation deps.kotlin_junit | ||
testImplementation deps.parceler | ||
testImplementation deps.parceler_processor | ||
api project(':activitystarter-annotations') | ||
implementation deps.supportAnnotations | ||
implementation deps.supportCompat | ||
implementation deps.supportAppcompatv7 | ||
|
||
androidTestImplementation deps.junit | ||
androidTestImplementation deps.truth | ||
androidTestImplementation deps.supportTestRunner | ||
|
||
testImplementation deps.junit | ||
testImplementation deps.truth | ||
testImplementation deps.compiletesting | ||
testCompile files(getRuntimeJar()) | ||
testCompile files(Jvm.current().getToolsJar()) | ||
testImplementation project(':activitystarter-compiler') | ||
testImplementation deps.kotlin | ||
testImplementation deps.kotlin_junit | ||
testImplementation deps.parceler | ||
testImplementation deps.parceler_processor | ||
} | ||
|
||
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); | ||
} | ||
} | ||
|
||
// Fancy test print | ||
tasks.withType(Test) { | ||
testLogging { | ||
// set options for log level LIFECYCLE | ||
events "passed", "skipped", "failed", "standardOut" | ||
showExceptions true | ||
exceptionFormat "full" | ||
showCauses true | ||
showStackTraces true | ||
|
||
// set options for log level DEBUG and INFO | ||
debug { | ||
events "started", "passed", "skipped", "failed", "standardOut", "standardError" | ||
exceptionFormat "full" | ||
} | ||
info.events = debug.events | ||
info.exceptionFormat = debug.exceptionFormat | ||
|
||
afterSuite { desc, result -> | ||
if (!desc.parent) { // will match the outermost suite | ||
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)" | ||
def startItem = '| ', endItem = ' |' | ||
def repeatLength = startItem.length() + output.length() + endItem.length() | ||
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength)) | ||
} | ||
testLogging { | ||
// set options for log level LIFECYCLE | ||
events "passed", "skipped", "failed", "standardOut" | ||
showExceptions true | ||
exceptionFormat "full" | ||
showCauses true | ||
showStackTraces true | ||
|
||
// set options for log level DEBUG and INFO | ||
debug { | ||
events "started", "passed", "skipped", "failed", "standardOut", "standardError" | ||
exceptionFormat "full" | ||
} | ||
info.events = debug.events | ||
info.exceptionFormat = debug.exceptionFormat | ||
|
||
afterSuite { desc, result -> | ||
if (!desc.parent) { // will match the outermost suite | ||
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)" | ||
def startItem = '| ', endItem = ' |' | ||
def repeatLength = startItem.length() + output.length() + endItem.length() | ||
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength)) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
task sourcesJar(type: Jar) { | ||
from android.sourceSets.main.java.srcDirs | ||
classifier = 'sources' | ||
from android.sourceSets.main.java.srcDirs | ||
classifier = 'sources' | ||
} | ||
|
||
artifacts { | ||
archives sourcesJar | ||
archives sourcesJar | ||
} | ||
|
||
install { | ||
repositories.mavenInstaller { | ||
pom.project { | ||
licenses { | ||
license { | ||
name 'The Apache Software License, Version 2.0' | ||
url 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
distribution 'repo' | ||
repositories.mavenInstaller { | ||
pom.project { | ||
licenses { | ||
license { | ||
name 'The Apache Software License, Version 2.0' | ||
url 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
distribution 'repo' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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
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