Skip to content

Commit

Permalink
Merge 225eb88 into 54476ca
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemures committed Jul 30, 2019
2 parents 54476ca + 225eb88 commit dc3ed09
Show file tree
Hide file tree
Showing 285 changed files with 15,673 additions and 5,431 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
language: android
dist: trusty

android:
components:
Expand Down Expand Up @@ -38,8 +39,9 @@ cache:

script:
- ./gradlew clean check
- ./gradlew -b toothpick-sample/build.gradle clean check
- ./gradlew -b toothpick-sample/build.gradle clean check
- ./gradlew -b smoothie-sample/build.gradle clean check -x lint
- ./gradlew -b toothpick-kotlin-android-sample/build.gradle clean check -x lint

after_success:
- ./gradlew jacocoTestReport coveralls
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
<!-- Continue from top -->

## Release version 3.0.0-RC1 (July 29th, 2019)
* TODO finish the changelog
* change scopes
* kotlin support. I believe method injections is not supported fully in kotlin because there are no member injectors
* support for method injections when methods throw throwables
* add support for Android X life cycle owners to close a scope automatically when the owner is destroyed
* add support for Android X view models to close a scope automatically when the view model is cleared
* better binding API, 1:1 relation with annotations
* better scope API: fluent API to define scopes, allow to define subscopes, allow lambdas to configure a scope on creation
* support for releasables
* etc

## Release version 2.1.0 (Feb 4th, 2019)

* Add Toothpick.isScopeOpen method to check whether a scope is already open. Thx to terrakok for this.
Expand Down
38 changes: 24 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
apply plugin: 'jacoco'
apply plugin: 'com.github.kt3k.coveralls'

buildscript {
apply from: 'deps.gradle'
repositories {
google()
jcenter()
}
dependencies {
classpath deps.android_plugin
classpath deps.kotlin_plugin
classpath deps.coverallPlugin
classpath deps.spotlessPlugin
}
}

apply plugin: 'jacoco'
apply plugin: 'com.github.kt3k.coveralls'

repositories {
jcenter()
}
Expand Down Expand Up @@ -80,26 +83,33 @@ subprojects { project ->
}

apply plugin: 'jacoco'
apply plugin: 'checkstyle'
apply plugin: 'maven'
apply plugin: 'com.diffplug.gradle.spotless'

checkstyle {
configFile rootProject.file('checkstyle.xml')

tasks.withType(JavaCompile) {
options.compilerArgs << '-Xlint:unchecked'
options.deprecation = true
}

task checkstyle(type: Checkstyle) {
source 'src/main/java'
ignoreFailures true
showViolations true
include '**/*.java'
spotless {
java {
licenseHeaderFile rootProject.file('spotless.license.java.txt')
googleJavaFormat() // use a specific formatter for Java files
target '**/*.java'
}
kotlin {
// optionally takes a version
ktlint().userData(['indent_size': '2'])
target '**/*.kt'

classpath = files()
// also supports license headers
licenseHeaderFile rootProject.file('spotless.license.java.txt')
}
}

afterEvaluate {
if (project.tasks.findByName('check') && project.pluginManager.hasPlugin('java')) {
check.dependsOn('checkstyle')
check.dependsOn('spotlessCheck')
check.dependsOn('jacocoTestReport')

tasks.withType(Test) {
Expand Down
138 changes: 0 additions & 138 deletions checkstyle.xml

This file was deleted.

59 changes: 40 additions & 19 deletions deps.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,58 @@ ext.deps = [// Common

// Android
android : 'com.google.android:android:4.1.1.4',
androidPlugin : 'com.android.tools.build:gradle:3.3.0',
coverallPlugin : 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.6.3',
android_plugin : 'com.android.tools.build:gradle:3.4.2',
supportv4 : 'com.android.support:support-v4:28.0.0',
androidxv4 : 'androidx.legacy:legacy-support-v4:1.0.0',
lifecycle : 'androidx.lifecycle:lifecycle-common-java8:2.2.0-alpha02',
lifecycle_viewmodel : 'androidx.lifecycle:lifecycle-viewmodel:2.2.0-alpha02',
lifecycle_extensions: 'androidx.lifecycle:lifecycle-extensions:2.2.0-alpha02',
androidx_test_core : 'androidx.test:core:1.2.0',
butterknife : 'com.jakewharton:butterknife:10.0.0',
butterknife_compiler: 'com.jakewharton:butterknife-compiler:10.0.0',
rxandroid : 'io.reactivex:rxandroid:1.2.1',

// Kotlin
kotlin_plugin : 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.41',
kotlin_runtime : 'org.jetbrains.kotlin:kotlin-stdlib:1.3.41',

// TP artifacts for composite builds
tp_smoothie : 'com.github.stephanenicolas.toothpick:smoothie:2.0.0',
tp_smoothie_androidx: 'com.github.stephanenicolas.toothpick:smoothie-androidx:2.0.0',
tp_smoothie_support : 'com.github.stephanenicolas.toothpick:smoothie-support:2.0.0',
tp : 'com.github.stephanenicolas.toothpick:toothpick:2.0.0',
tp_runtime : 'com.github.stephanenicolas.toothpick:toothpick-runtime:2.0.0',
tp_compiler : 'com.github.stephanenicolas.toothpick:toothpick-compiler:2.0.0',
tp_testing : 'com.github.stephanenicolas.toothpick:toothpick-testing:2.0.0',
tp_testing_junit4 : 'com.github.stephanenicolas.toothpick:toothpick-testing-junit4:2.0.0',
tp_testing_junit5 : 'com.github.stephanenicolas.toothpick:toothpick-testing-junit5:2.0.0',
tp_smoothie : 'com.github.stephanenicolas.toothpick:smoothie:3.0.0',
tp_androidx : 'com.github.stephanenicolas.toothpick:smoothie-androidx:3.0.0',
tp_lifecycle : 'com.github.stephanenicolas.toothpick:smoothie-lifecycle:3.0.0',
tp_lifecycle_ktp : 'com.github.stephanenicolas.toothpick:smoothie-lifecycle-ktp:3.0.0',
tp_viewmodel : 'com.github.stephanenicolas.toothpick:smoothie-lifecycle-viewmodel:3.0.0',
tp_viewmodel_ktp : 'com.github.stephanenicolas.toothpick:smoothie-lifecycle-viewmodel-ktp:3.0.0',
tp_smoothie_support : 'com.github.stephanenicolas.toothpick:smoothie-support:3.0.0',
tp : 'com.github.stephanenicolas.toothpick:toothpick:3.0.0',
tp_runtime : 'com.github.stephanenicolas.toothpick:toothpick-runtime:3.0.0',
ktp : 'com.github.stephanenicolas.toothpick:ktp:3.0.0',
tp_compiler : 'com.github.stephanenicolas.toothpick:toothpick-compiler:3.0.0',
tp_testing : 'com.github.stephanenicolas.toothpick:toothpick-testing:3.0.0',
tp_testing_junit4 : 'com.github.stephanenicolas.toothpick:toothpick-testing-junit4:3.0.0',
tp_testing_junit5 : 'com.github.stephanenicolas.toothpick:toothpick-testing-junit5:3.0.0',

// Test dependencies
junit4 : 'junit:junit:4.12',
junit5_api : 'org.junit.jupiter:junit-jupiter-api:5.3.2',
junit5_engine : 'org.junit.jupiter:junit-jupiter-engine:5.3.2',
junit4 : 'junit:junit:4.13-beta-3',
junit5_api : 'org.junit.jupiter:junit-jupiter-api:5.5.0',
junit5_engine : 'org.junit.jupiter:junit-jupiter-engine:5.5.0',
hamcrest : 'org.hamcrest:java-hamcrest:2.0.0.0',
truth : 'com.google.truth:truth:0.42',
compiletesting : 'com.google.testing.compile:compile-testing:0.15',
easymock : 'org.easymock:easymock:3.4',
powermock : 'org.powermock:powermock-easymock-release-full:1.6.4',
powermock_rule : 'org.powermock:powermock-module-junit4-rule-agent:1.6.4',
robolectric : 'org.robolectric:robolectric:3.4.2',
mockito : 'org.mockito:mockito-core:2.4.0',
mockito_junit5 : 'org.mockito:mockito-junit-jupiter:2.23.0',
mockito_kotlin : 'com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0',
powermockito : 'org.powermock:powermock-api-mockito2:1.7.4',
powermock_junit : 'org.powermock:powermock-module-junit4:1.7.4',
powermock_rule : 'org.powermock:powermock-module-junit4-rule-agent:1.7.4',
kluent : 'org.amshove.kluent:kluent-android:1.51',
robolectric : 'org.robolectric:robolectric:4.2.1',

// Android Test Dependencies
espresso : 'com.android.support.test.espresso:espresso-core:2.2.2',
dexmaker : 'com.google.dexmaker:dexmaker:1.2',]
dexmaker : 'com.google.dexmaker:dexmaker:1.2',

//build
coverallPlugin : 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.6.3',
spotlessPlugin: 'com.diffplug.spotless:spotless-plugin-gradle:3.23.1',
]
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GROUP=com.github.stephanenicolas.toothpick
VERSION_NAME=2.1.1-SNAPSHOT
VERSION_NAME=3.0.0-RC2-SNAPSHOT

POM_PACKAGING=JAR
POM_DESCRIPTION=DI.
Expand Down
1 change: 1 addition & 0 deletions gradle/gradle-mvn-push.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ afterEvaluate { project ->
task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.source
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
excludes = ['**/*.kt']
}

task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-all.zip

23 changes: 23 additions & 0 deletions ktp/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apply plugin: 'java-library'
apply plugin: 'kotlin'
apply plugin: 'kotlin-kapt'

dependencies {
api project(':toothpick-runtime')
implementation deps.kotlin_runtime

testImplementation project(':toothpick-testing-junit5')
testImplementation deps.junit5_api
testRuntimeOnly deps.junit5_engine

testImplementation deps.mockito_kotlin
testImplementation deps.mockito_junit5
testImplementation deps.kluent
kaptTest project(':toothpick-compiler')
}

test {
useJUnitPlatform()
}

apply from: rootProject.file('gradle/gradle-mvn-push.gradle')
4 changes: 4 additions & 0 deletions ktp/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
POM_ARTIFACT_ID=ktp
POM_NAME=Kotlin ToothPick
POM_DESCRIPTION='Kotlin extensions for toothpick'
POM_PACKAGING='jar'

0 comments on commit dc3ed09

Please sign in to comment.