Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TP 2.0 #320

Merged
merged 1 commit into from
Feb 1, 2019
Merged

TP 2.0 #320

merged 1 commit into from
Feb 1, 2019

Conversation

dlemures
Copy link
Collaborator

@dlemures dlemures commented Jan 30, 2019

  • support incremental annotation processing. All processors are now incremental and isolating.
  • remove all registries, TP 2.x doesn't use registries any more. They were actually slower than not using them after
    we reworked on registries to enable obfuscation. Reflection is now used to load the factories and member injectors,
    this is normal (and all other annotation processor based libs do that too) and there is no impact on performance.
  • support multiple rounds of annotation processing.
  • generated classes now use __ instead of $$ to make TP more compliant with some tools.
  • removed the generate ContextSingleton annotation
  • smoothie now binds the ClipClipboardManager service. Thx to Cody Henthrone for this. Sorry we were late merging this !
  • smoothie now contains non support and non android x bindings. We have introduced 2 new artifacts:
    smoothie-support and smoothie-androidx that respectively support the old legacy support library and the new android X libs).
  • toothpick-testing now only contains core testing classes. New artifacts have been introduced to support junit 4 nd junit 5 (resp. : toothpick-testing-junit4, toothpick-testing-junit5)
  • Update CI & make it green
  • Wiki update
  • version number update
  • test in MGA (snapshot + proguard + artifacts: junit-4, androidx, template new modules)
  • go through PR list and issue list
  • deal with the PR / feature request Add Toothpick.hasScope method for check scope in scopes tree. #318
  • README update
  • add a consumer proguard file: https://github.com/JakeWharton/butterknife/search?q=proguard-rules.txt&unscoped_q=proguard-rules.txt
  • update other libs
  • make the sample work with incremental compilation (there is a bug in my fork of incap that I can repro with smoothie-sample !). This won't be fixed now.
  • make the sample work with junit 5
  • make the sample work with android x
  • use composite builds for samples
  • why do we need to use default configuration ? Is compositve build solving that ?
  • declare the project as incremental on gradle list : Help popular annotation processors adopt incremental processing gradle/gradle#5277

@dlemures dlemures changed the title TP 1.2 TP 2.0 Jan 30, 2019
@coveralls
Copy link

coveralls commented Jan 31, 2019

Coverage Status

Coverage increased (+0.3%) to 95.842% when pulling 056229f on dlemures/removing-registries into 2483d2d on master.

testImplementation deps.easymock
testImplementation deps.powermock
testImplementation deps.hamcrest
testImplementation files(Jvm.current().getToolsJar())
testImplementation 'org.powermock:powermock-module-junit4-rule-agent:1.6.4'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should go inside deps

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

testAnnotationProcessor project(':toothpick-compiler')
}

test {
jvmArgs '-noverify'
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we keep this?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, powermock breaks the java 7 byte code frames otherwise.

jacocoTestReport {
reports {
xml.enabled = false
html.enabled = false
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont need this anymore?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no

POM_ARTIFACT_ID=smoothie-androidx
POM_NAME=smoothie android X
POM_DESCRIPTION='Toothpick package providing Android providers for the android X library'
POM_PACKAGING='aar'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

assertThat(loaderManager, notNullValue());
assertThat(layoutInflater, notNullValue());
}
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

import toothpick.registries.FactoryRegistryLocator;
import toothpick.registries.MemberInjectorRegistryLocator;
import toothpick.locators.FactoryLocator;
import toothpick.locators.MemberInjectorLocator;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed

POM_ARTIFACT_ID=smoothie-support
POM_NAME=smoothie support
POM_DESCRIPTION='Toothpick package providing Android providers for the support library'
POM_PACKAGING='aar'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

@@ -0,0 +1,2 @@
toothpick.compiler.factory.FactoryProcessor,isolating
toothpick.compiler.memberinjector.MemberInjectorProcessor,isolating
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

options.annotationProcessorPath = configurations.testAnnotationProcessor
options.compilerArgs = ['-Atoothpick_registry_package_name=toothpick.test',
'-Atoothpick_annotations=toothpick.data.CustomScope',]
options.compilerArgs = ['-Atoothpick_annotations=toothpick.data.CustomScope',]
}

apply from: rootProject.file('gradle/gradle-mvn-push.gradle')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

//THEN
assertThat(memberInjector, nullValue());
}
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

//THEN
fail("Should throw an exception");
}
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

TestModule() {
bind(Computer.class).toInstance(mockComputer);
}
}
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

POM_ARTIFACT_ID=toothpick-testing-junit4
POM_NAME=Toothpick Testing Junit 4
POM_DESCRIPTION='Junit 4 Testing support for Toothpick'
POM_PACKAGING='jar'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

POM_ARTIFACT_ID=toothpick-testing-junit5
POM_NAME=Toothpick Testing Junit 5
POM_DESCRIPTION='Junit 5 Testing support for Toothpick'
POM_PACKAGING='jar'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

@stephanenicolas
Copy link
Owner

really you rock @dlemures

@dlemures
Copy link
Collaborator Author

dlemures commented Feb 1, 2019

You are the one that rocks little penguin 🐥

@dlemures dlemures merged commit dbbe1d2 into master Feb 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants