├── .gitignore
├── intellij
├── ast
│ ├── README.md
│ ├── gradle.properties
│ └── build.gradle
├── README.md
├── src
│ └── main
│ │ ├── resources
│ │ └── icons
│ │ │ └── icon.svg
│ │ └── kotlin
│ │ └── motif
│ │ └── intellij
│ │ └── analytics
│ │ └── MotifAnalyticsLogger.kt
├── gradle.properties
└── build.gradle
├── samples
├── sample-lib-ksp
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── sample_lib_ksp
│ │ └── Greeter.java
├── sample
│ └── src
│ │ ├── main
│ │ └── res
│ │ │ ├── drawable-hdpi
│ │ │ └── ub__ic_launcher.png
│ │ │ ├── drawable-mdpi
│ │ │ └── ub__ic_launcher.png
│ │ │ ├── drawable-xhdpi
│ │ │ └── ub__ic_launcher.png
│ │ │ ├── drawable-xxhdpi
│ │ │ └── ub__ic_launcher.png
│ │ │ ├── drawable-xxxhdpi
│ │ │ └── ub__ic_launcher.png
│ │ │ ├── values
│ │ │ └── values.xml
│ │ │ └── layout
│ │ │ ├── photo_grid_item_overlay.xml
│ │ │ ├── root.xml
│ │ │ ├── photo_list.xml
│ │ │ ├── photo_grid.xml
│ │ │ ├── photo_list_item.xml
│ │ │ ├── bottomsheet.xml
│ │ │ └── photo_grid_item.xml
│ │ └── test
│ │ └── java
│ │ └── motif
│ │ └── sample
│ │ └── app
│ │ └── root
│ │ └── RootScopeTest.java
├── sample-lib
│ ├── src
│ │ └── main
│ │ │ ├── res
│ │ │ ├── values
│ │ │ │ └── values.xml
│ │ │ └── drawable
│ │ │ │ ├── ic_arrow_forward_black_24dp.xml
│ │ │ │ ├── ic_close_black_24dp.xml
│ │ │ │ ├── ic_local_offer_black_24dp.xml
│ │ │ │ └── ic_style_black_24dp.xml
│ │ │ ├── AndroidManifest.xml
│ │ │ └── java
│ │ │ └── motif
│ │ │ └── sample
│ │ │ └── lib
│ │ │ └── controller
│ │ │ └── ViewlessControllerObjects.java
│ └── build.gradle
├── dagger-comparison
│ ├── src
│ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ └── res
│ │ │ └── layout
│ │ │ ├── loggedin.xml
│ │ │ └── root.xml
│ └── build.gradle
├── sample-kotlin-ksp
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── res
│ │ └── layout
│ │ │ └── activity_main.xml
│ │ └── java
│ │ └── motif
│ │ └── sample
│ │ └── Greeter.kt
└── sample-kotlin
│ └── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── res
│ └── layout
│ │ └── activity_main.xml
│ └── java
│ └── motif
│ └── sample
│ └── Greeter.kt
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── compiler
├── ast
│ ├── README.md
│ ├── build.gradle
│ └── gradle.properties
├── ksp
│ ├── src
│ │ └── main
│ │ │ └── resources
│ │ │ └── META-INF
│ │ │ └── services
│ │ │ └── com.google.devtools.ksp.processing.SymbolProcessorProvider
│ └── gradle.properties
├── src
│ ├── main
│ │ └── resources
│ │ │ └── META-INF
│ │ │ └── services
│ │ │ └── javax.annotation.processing.Processor
│ └── test
│ │ ├── resources
│ │ └── default.pro
│ │ └── java
│ │ └── motif
│ │ └── compiler
│ │ └── TestParameters.kt
├── README.md
└── gradle.properties
├── tests
├── compiler
│ ├── src
│ │ └── main
│ │ │ └── resources
│ │ │ └── META-INF
│ │ │ └── services
│ │ │ └── javax.annotation.processing.Processor
│ ├── build.gradle
│ └── README.md
├── README.md
├── src
│ └── main
│ │ └── java
│ │ ├── testcases
│ │ ├── T034_dagger_as_parent
│ │ │ └── SKIP_KOTLIN
│ │ ├── T056_deferred_rounds
│ │ │ ├── SKIP_KOTLIN
│ │ │ ├── SKIP_INTELLIJ
│ │ │ ├── Child.java
│ │ │ ├── Test.java
│ │ │ └── Scope.java
│ │ ├── T071_scope_factory
│ │ │ ├── config.pro
│ │ │ └── Scope.java
│ │ ├── T072_scope_factory
│ │ │ ├── config.pro
│ │ │ └── Scope.java
│ │ ├── T074_superclass_nested_class
│ │ │ ├── config.pro
│ │ │ ├── Bar.java
│ │ │ └── Foo.java
│ │ ├── KT007_scope_factory_dependencies
│ │ │ └── config.pro
│ │ ├── T073_scope_factory_no_dependencies
│ │ │ └── config.pro
│ │ ├── T075_scope_factory_unused_dependencies
│ │ │ └── config.pro
│ │ ├── T055_binds_upcast
│ │ │ └── A.java
│ │ ├── E038_unchecked_binds
│ │ │ ├── B.java
│ │ │ └── A.java
│ │ ├── T014_override_objects
│ │ │ ├── B.java
│ │ │ ├── A.java
│ │ │ ├── ObjectsParent.java
│ │ │ └── Test.java
│ │ ├── T040_keywords
│ │ │ └── Abstract.java
│ │ ├── T051_binds_interface
│ │ │ ├── B.java
│ │ │ └── A.java
│ │ ├── T012_inheritence_objects
│ │ │ ├── A.java
│ │ │ └── B.java
│ │ ├── T054_binds_wildcards
│ │ │ ├── B.java
│ │ │ └── A.java
│ │ ├── T016_factory_method_binds
│ │ │ ├── B.java
│ │ │ └── A.java
│ │ ├── E024_scope_class
│ │ │ └── Scope.java
│ │ ├── T001_empty_scope
│ │ │ ├── Scope.java
│ │ │ └── Test.java
│ │ ├── T015_factory_method_constructor
│ │ │ └── A.java
│ │ ├── T052_binds_interface_generic
│ │ │ ├── B.java
│ │ │ └── A.java
│ │ ├── E043_binds_invalid_wildcard_super
│ │ │ └── A.java
│ │ ├── KE002_nullable_constructor_parameter
│ │ │ └── Foo.kt
│ │ ├── KT002_constructor_factory_method
│ │ │ └── Foo.kt
│ │ ├── T021_objects_interface
│ │ │ └── Dependency.java
│ │ ├── E042_binds_invalid_wildcard_extends
│ │ │ └── A.java
│ │ ├── E039_binds_different_type_parameters
│ │ │ ├── B.java
│ │ │ └── A.java
│ │ ├── T023_factory_method_binds_dependencies
│ │ │ ├── B.java
│ │ │ ├── C.java
│ │ │ └── A.java
│ │ ├── E036_no_suitable_constructor_interface
│ │ │ ├── Foo.java
│ │ │ └── Scope.java
│ │ ├── E057_scope_extends_scope
│ │ │ ├── BarScope.java
│ │ │ └── FooScope.java
│ │ ├── KT003_constructor_factory_method_generics
│ │ │ └── Foo.kt
│ │ ├── T020_naming_collisions
│ │ │ ├── c
│ │ │ │ └── SomeDependency.java
│ │ │ └── d
│ │ │ │ └── SomeDependency.java
│ │ ├── T018_spread_inheritence
│ │ │ └── Spreadable.java
│ │ ├── T022_factory_method_constructor_dependencies
│ │ │ ├── A.java
│ │ │ └── B.java
│ │ ├── E051_nullable_dynamic_dependency
│ │ │ ├── Child.java
│ │ │ └── Scope.java
│ │ ├── T053_binds_bounded_type_parameters
│ │ │ ├── B.java
│ │ │ └── A.java
│ │ ├── E003_scope_cycle
│ │ │ └── Scope.java
│ │ ├── KT004_constructor_factory_method_inheritance
│ │ │ ├── Bar.kt
│ │ │ └── Foo.kt
│ │ ├── T013_override_scope
│ │ │ ├── ScopeParent.java
│ │ │ └── Test.java
│ │ ├── E004_scope_cycle_2
│ │ │ ├── Child.java
│ │ │ └── Scope.java
│ │ ├── E017_not_exposed
│ │ │ └── Child.java
│ │ ├── E037_spread_not_exposed
│ │ │ ├── Child.java
│ │ │ └── Spreadable.java
│ │ ├── T039_factory_method_constructor_prioritize_annotation
│ │ │ └── A.java
│ │ ├── T005_custom_qualifier
│ │ │ ├── A.java
│ │ │ └── B.java
│ │ ├── T076_inner_class_dependency
│ │ │ └── Other.java
│ │ ├── E015_missing_dependency_constructor
│ │ │ └── A.java
│ │ ├── E027_invalid_scope_method
│ │ │ └── Scope.java
│ │ ├── E058_scope_extends_scope_intermediate_class
│ │ │ ├── BarScope.java
│ │ │ ├── Intermediate.java
│ │ │ └── FooScope.java
│ │ ├── T011_inheritence_scope
│ │ │ ├── ScopeGrandparent.java
│ │ │ └── ScopeParent.java
│ │ ├── T048_expose_spread_factory_method
│ │ │ ├── Child.java
│ │ │ └── Spreadable.java
│ │ ├── E028_invalid_scope_method_2
│ │ │ └── Scope.java
│ │ ├── T045_dynamic_dependency_expose
│ │ │ ├── Grandchild.java
│ │ │ └── Child.java
│ │ ├── T063_diamond_expose_to_grandchild
│ │ │ ├── ChildA.java
│ │ │ ├── ChildB.java
│ │ │ └── GrandChild.java
│ │ ├── T068_missing_dependency_no_creatable
│ │ │ ├── Scope.java
│ │ │ └── Test.java
│ │ ├── E011_dynamic_dependency_not_exposed
│ │ │ ├── Child.java
│ │ │ ├── Grandchild.java
│ │ │ └── Scope.java
│ │ ├── KT006_reference_self
│ │ │ ├── Child.kt
│ │ │ ├── Foo.kt
│ │ │ ├── Scope.kt
│ │ │ └── Test.java
│ │ ├── T060_default_objects_methods2
│ │ │ ├── IntObjects.java
│ │ │ └── StringObjects.java
│ │ ├── T065_diamond_hide_source
│ │ │ ├── Child1.java
│ │ │ └── GrandChild.java
│ │ ├── E013_missing_dependencies_multiple_scopes
│ │ │ ├── ChildA.java
│ │ │ └── ChildB.java
│ │ ├── E016_missing_dependencies_multilevel
│ │ │ ├── Grandchild.java
│ │ │ ├── Child.java
│ │ │ └── Scope.java
│ │ ├── E046_diamond_unsatisfied_sink
│ │ │ ├── Child1.java
│ │ │ ├── GrandChild.java
│ │ │ └── Scope.java
│ │ ├── E047_duplicate_factory_method_spread
│ │ │ └── Foo.java
│ │ ├── E045_dynamic_dependency_duplicate_factory_method2
│ │ │ └── Child1.java
│ │ ├── E048_duplicate_factory_method_spread2
│ │ │ └── Foo.java
│ │ ├── E049_duplicate_factory_method_spread3
│ │ │ └── Foo.java
│ │ ├── E050_unsatisfied_dependency_no_duplicates
│ │ │ ├── Grandchild.java
│ │ │ └── Scope.java
│ │ ├── E026_factory_method_missing_constructor_inject
│ │ │ └── A.java
│ │ ├── E059_unexposed_on_subset_of_paths
│ │ │ └── BazScope.java
│ │ ├── T036_dagger_spread
│ │ │ └── Test.java
│ │ ├── E023_objects_fields_inherited
│ │ │ ├── Scope.java
│ │ │ └── ObjectsParent.java
│ │ ├── T046_spread_static_spreadable_method
│ │ │ └── Spreadable.java
│ │ ├── T047_dynamic_dependency_named_component
│ │ │ └── Child.java
│ │ ├── T058_dynamic_dependency_overrides_expose
│ │ │ └── Child.java
│ │ ├── T064_diamond_child_parameter_override
│ │ │ ├── Child1.java
│ │ │ ├── GrandChild.java
│ │ │ └── Child2.java
│ │ ├── E018_not_exposed_prioritize_over_duplicate_factory_methods
│ │ │ └── Child.java
│ │ ├── T062_hide_duplicate_with_dependencies_spread
│ │ │ └── Foo.java
│ │ ├── E019_objects_fields
│ │ │ └── Scope.java
│ │ ├── E020_objects_constructor
│ │ │ └── Scope.java
│ │ ├── E029_invalid_objects_method
│ │ │ └── Scope.java
│ │ ├── E033_not_assignable
│ │ │ └── Scope.java
│ │ ├── E032_no_suitable_constructor
│ │ │ └── Scope.java
│ │ ├── E052_custom_qualifier_with_nonstring_value
│ │ │ └── CustomQualifier.java
│ │ ├── T006_custom_qualifier_with_string_value
│ │ │ └── CustomQualifier.java
│ │ ├── E053_custom_qualifier_with_nonvalue_member
│ │ │ └── CustomQualifier.java
│ │ ├── E041_nullable_spread_method
│ │ │ └── Spreadable.java
│ │ ├── E030_invalid_objects_method_2
│ │ │ └── Scope.java
│ │ ├── KE001_nullable_parameter
│ │ │ └── Scope.kt
│ │ ├── E034_void_dependencies_method
│ │ │ └── Scope.java
│ │ ├── E054_custom_qualifier_with_multiple_members
│ │ │ └── CustomQualifier.java
│ │ ├── E055_duplicated_dynamic_dependency_source
│ │ │ ├── Scope.java
│ │ │ └── Child.java
│ │ ├── E035_dependency_method_parameters
│ │ │ └── Scope.java
│ │ ├── KT005_qualifier
│ │ │ └── Test.java
│ │ ├── T004_qualifier
│ │ │ └── Test.java
│ │ ├── T017_spread
│ │ │ └── Spreadable.java
│ │ ├── T024_child
│ │ │ └── Child.java
│ │ ├── T070_creatable_child
│ │ │ └── Child.java
│ │ ├── KT001_basic_scope
│ │ │ └── Test.java
│ │ └── T002_access_method
│ │ │ └── Test.java
│ │ └── external
│ │ ├── T033_unprocessed_scope
│ │ ├── DO_NOT_PROCESS
│ │ └── Child.java
│ │ ├── T030_buck_classusage_motif
│ │ ├── A.java
│ │ └── Child.java
│ │ ├── T031_buck_classusage_dagger
│ │ └── A.java
│ │ ├── T032_buck_classusage_dagger_subcomponents
│ │ └── A.java
│ │ ├── T028_external
│ │ └── Child.java
│ │ └── T066_package_private_objects_method
│ │ └── ScopeObjects.java
└── build.gradle
├── ast
├── README.md
├── src
│ └── main
│ │ └── kotlin
│ │ └── motif
│ │ └── ast
│ │ ├── README.md
│ │ ├── IrField.kt
│ │ ├── IrParameter.kt
│ │ ├── IrEquivalence.kt
│ │ └── IrModifier.kt
├── build.gradle
└── gradle.properties
├── core
├── README.md
├── build.gradle
└── gradle.properties
├── errormessage
├── build.gradle
├── README.md
└── gradle.properties
├── models
├── README.md
├── build.gradle
├── gradle.properties
└── src
│ └── main
│ └── kotlin
│ └── motif
│ └── models
│ └── MotifError.kt
├── viewmodel
├── build.gradle
├── gradle.properties
└── src
│ └── main
│ └── kotlin
│ └── motif
│ └── viewmodel
│ ├── RequiredDependency.kt
│ └── ProvidedDependency.kt
├── lib
├── build.gradle
├── gradle.properties
└── src
│ └── main
│ └── java
│ └── motif
│ ├── Objects.java
│ ├── Creatable.java
│ ├── DoNotCache.java
│ ├── NoDependencies.java
│ ├── Expose.java
│ ├── internal
│ ├── DaggerScope.java
│ ├── None.java
│ └── Constants.java
│ ├── Spread.java
│ ├── ScopeImpl.java
│ └── Scope.java
├── config
└── spotless
│ ├── copyright.java
│ └── copyright.kt
├── .github
├── ISSUE_TEMPLATE.md
└── PULL_REQUEST_TEMPLATE.md
├── xprocessing
└── gradle.properties
├── xprocessing-testing
└── gradle.properties
└── RELEASING.md
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
2 | build/
3 | *.iml
4 | .gradle/
5 | local.properties
6 | .DS_Store
7 |
--------------------------------------------------------------------------------
/intellij/ast/README.md:
--------------------------------------------------------------------------------
1 | Intermediate representation of the Java AST based on the IntelliJ's PSI API.
2 |
--------------------------------------------------------------------------------
/samples/sample-lib-ksp/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uber/motif/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/compiler/ast/README.md:
--------------------------------------------------------------------------------
1 | Intermediate representation of the Java AST based on Java's annotation processing APIs.
2 |
--------------------------------------------------------------------------------
/tests/compiler/src/main/resources/META-INF/services/javax.annotation.processing.Processor:
--------------------------------------------------------------------------------
1 | motif.stubcompiler.StubProcessor
--------------------------------------------------------------------------------
/tests/README.md:
--------------------------------------------------------------------------------
1 | The tests in this module are run from the test harness in the `:compiler` module. To run these tests, run
2 | `./gradlew :compiler:test`
--------------------------------------------------------------------------------
/compiler/ksp/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider:
--------------------------------------------------------------------------------
1 | motif.compiler.ksp.MotifSymbolProcessorProvider
--------------------------------------------------------------------------------
/compiler/src/main/resources/META-INF/services/javax.annotation.processing.Processor:
--------------------------------------------------------------------------------
1 | motif.compiler.Processor
2 | dagger.internal.codegen.ComponentProcessor
--------------------------------------------------------------------------------
/samples/sample/src/main/res/drawable-hdpi/ub__ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uber/motif/HEAD/samples/sample/src/main/res/drawable-hdpi/ub__ic_launcher.png
--------------------------------------------------------------------------------
/samples/sample/src/main/res/drawable-mdpi/ub__ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uber/motif/HEAD/samples/sample/src/main/res/drawable-mdpi/ub__ic_launcher.png
--------------------------------------------------------------------------------
/samples/sample-lib/src/main/res/values/values.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 50dp
4 |
--------------------------------------------------------------------------------
/samples/sample/src/main/res/drawable-xhdpi/ub__ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uber/motif/HEAD/samples/sample/src/main/res/drawable-xhdpi/ub__ic_launcher.png
--------------------------------------------------------------------------------
/samples/sample/src/main/res/drawable-xxhdpi/ub__ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uber/motif/HEAD/samples/sample/src/main/res/drawable-xxhdpi/ub__ic_launcher.png
--------------------------------------------------------------------------------
/ast/README.md:
--------------------------------------------------------------------------------
1 | Intermediate representation of the Java AST. This abstraction is necessary to share graph validation logic
2 | between the compiler and the Intellij plugin.
3 |
--------------------------------------------------------------------------------
/samples/sample/src/main/res/drawable-xxxhdpi/ub__ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/uber/motif/HEAD/samples/sample/src/main/res/drawable-xxxhdpi/ub__ic_launcher.png
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T034_dagger_as_parent/SKIP_KOTLIN:
--------------------------------------------------------------------------------
1 | Kapt does not support processing code that depends on generated code. Skip this test for Kotlin code generation.
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T056_deferred_rounds/SKIP_KOTLIN:
--------------------------------------------------------------------------------
1 | Kapt does not support processing code that depends on generated code. Skip this test for Kotlin code generation.
--------------------------------------------------------------------------------
/samples/sample-lib/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/tests/src/main/java/external/T033_unprocessed_scope/DO_NOT_PROCESS:
--------------------------------------------------------------------------------
1 | The presence of this file tells the TestHarness to compile these sources without running the Motif annotation processor.
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T056_deferred_rounds/SKIP_INTELLIJ:
--------------------------------------------------------------------------------
1 | IntelliJ plugin has full graph knowledge and does not rely on multiple processing rounds. This test is not applicable for IntelliJ models.
--------------------------------------------------------------------------------
/compiler/README.md:
--------------------------------------------------------------------------------
1 | Top-level module for the Motif annotation processor. This module contains the `Processor` itself
2 | and all code generation logic. The module will also run the Dagger annotation processor.
3 |
--------------------------------------------------------------------------------
/core/README.md:
--------------------------------------------------------------------------------
1 | Motif's core graph processing logic.
2 |
3 | **Usage**
4 |
5 | ```kotlin
6 | val scopeClasses: List = getScopeClasses()
7 | val graph: ResolveGraph = ResolvedGraph.create(scopeClasses)
8 | ```
9 |
--------------------------------------------------------------------------------
/compiler/src/test/resources/default.pro:
--------------------------------------------------------------------------------
1 | -libraryjars /jmods/java.base.jmod(!**.jar;!module-info.class)
2 | -optimizations !class/merging/*
3 | -dontshrink
4 | -keep class **Test {
5 | public static void run();
6 | }
--------------------------------------------------------------------------------
/core/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'org.jetbrains.kotlin.jvm'
3 | id 'com.vanniktech.maven.publish'
4 | }
5 |
6 | dependencies {
7 | api project(':models')
8 |
9 | implementation deps.kotlin.stdlib
10 | }
11 |
--------------------------------------------------------------------------------
/errormessage/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'org.jetbrains.kotlin.jvm'
3 | id 'com.vanniktech.maven.publish'
4 | }
5 |
6 | dependencies {
7 | implementation deps.kotlin.stdlib
8 | implementation project(':core')
9 | }
10 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/samples/dagger-comparison/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
--------------------------------------------------------------------------------
/models/README.md:
--------------------------------------------------------------------------------
1 | AST model representation of [Motif concepts](https://github.com/uber/motif/wiki).
2 |
3 | **Usage**
4 |
5 | ```kotlin
6 | val scopeClasses: List = getScopeClasses()
7 | val scopes: List = Scope.fromClasses(scopeClasses)
8 | ```
9 |
--------------------------------------------------------------------------------
/ast/src/main/kotlin/motif/ast/README.md:
--------------------------------------------------------------------------------
1 | This package holds the lowest level models. The compiler and IntelliJ plugin implement these interfaces to make use of
2 | the shared parsing and graph validation logic in the `motif.models.parsing` and `motif.models.graph` packages.
3 |
--------------------------------------------------------------------------------
/errormessage/README.md:
--------------------------------------------------------------------------------
1 | API for rendering `MotifErrors` into human readable text.
2 |
3 | **Usage**
4 |
5 | ```kotlin
6 | val graph: ResolvedGraph = getGraph()
7 | val error: MotifError = getError()
8 | val message: String = ErrorMessage.get(graph, error)
9 | ```
10 |
--------------------------------------------------------------------------------
/samples/sample/src/main/res/values/values.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 100dp
4 | 175dp
5 | 150dp
6 |
--------------------------------------------------------------------------------
/intellij/README.md:
--------------------------------------------------------------------------------
1 | # Motif IntelliJ Plugin
2 |
3 | #### Supported
4 |
5 | * Navigation to parent Scopes
6 | * Navigation to child Scopes
7 | * Display Scope hierarchy
8 |
9 | #### Roadmap
10 |
11 | * Full graph validation in IDE
12 | * Navigation to dependency factory methods
13 |
--------------------------------------------------------------------------------
/viewmodel/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'org.jetbrains.kotlin.jvm'
3 | id 'com.vanniktech.maven.publish'
4 | }
5 |
6 | dependencies {
7 | api project(':core')
8 | api project(':models')
9 | api project(':errormessage')
10 |
11 | implementation deps.kotlin.stdlib
12 | }
13 |
--------------------------------------------------------------------------------
/ast/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'org.jetbrains.kotlin.jvm'
3 | id 'com.vanniktech.maven.publish'
4 | }
5 |
6 | dependencies {
7 | implementation deps.kotlin.stdlib
8 | implementation deps.dagger
9 |
10 | testImplementation deps.test.junit
11 | testImplementation deps.test.truth
12 | }
13 |
--------------------------------------------------------------------------------
/samples/sample/src/main/res/layout/photo_grid_item_overlay.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/samples/dagger-comparison/src/main/res/layout/loggedin.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/samples/dagger-comparison/src/main/res/layout/root.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T071_scope_factory/config.pro:
--------------------------------------------------------------------------------
1 | -libraryjars /jmods/java.base.jmod(!**.jar;!module-info.class)
2 | -dontshrink
3 | -keep class **Test {
4 | public static void run();
5 | }
6 |
7 | -keepnames @motif.Scope interface *
8 | -keepnames @motif.ScopeImpl class * {
9 | (...);
10 | }
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T072_scope_factory/config.pro:
--------------------------------------------------------------------------------
1 | -libraryjars /jmods/java.base.jmod(!**.jar;!module-info.class)
2 | -dontshrink
3 | -keep class **Test {
4 | public static void run();
5 | }
6 |
7 | -keepnames @motif.Scope interface *
8 | -keepnames @motif.ScopeImpl class * {
9 | (...);
10 | }
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T074_superclass_nested_class/config.pro:
--------------------------------------------------------------------------------
1 | -libraryjars /jmods/java.base.jmod(!**.jar;!module-info.class)
2 | -dontshrink
3 | -keep class **Test {
4 | public static void run();
5 | }
6 |
7 | -keepnames @motif.Scope interface *
8 | -keepnames @motif.ScopeImpl class * {
9 | (...);
10 | }
--------------------------------------------------------------------------------
/samples/sample/src/main/res/layout/root.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/KT007_scope_factory_dependencies/config.pro:
--------------------------------------------------------------------------------
1 | -libraryjars /jmods/java.base.jmod(!**.jar;!module-info.class)
2 | -dontshrink
3 | -keep class **Test {
4 | public static void run();
5 | }
6 |
7 | -keepnames @motif.Scope interface *
8 | -keepnames @motif.ScopeImpl class * {
9 | (...);
10 | }
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T073_scope_factory_no_dependencies/config.pro:
--------------------------------------------------------------------------------
1 | -libraryjars /jmods/java.base.jmod(!**.jar;!module-info.class)
2 | -dontshrink
3 | -keep class **Test {
4 | public static void run();
5 | }
6 |
7 | -keepnames @motif.Scope interface *
8 | -keepnames @motif.ScopeImpl class * {
9 | (...);
10 | }
--------------------------------------------------------------------------------
/samples/sample/src/main/res/layout/photo_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T075_scope_factory_unused_dependencies/config.pro:
--------------------------------------------------------------------------------
1 | -libraryjars /jmods/java.base.jmod(!**.jar;!module-info.class)
2 | -dontshrink
3 | -keep class **Test {
4 | public static void run();
5 | }
6 |
7 | -keepnames @motif.Scope interface *
8 | -keepnames @motif.ScopeImpl class * {
9 | (...);
10 | }
--------------------------------------------------------------------------------
/tests/compiler/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'org.jetbrains.kotlin.jvm'
3 | }
4 |
5 | dependencies {
6 | implementation deps.autoCommon
7 | implementation deps.kotlin.stdlib
8 | implementation deps.kspApi
9 | implementation deps.javapoet
10 | implementation deps.roomCompilerProcessing
11 | implementation project(':compiler-ast')
12 | implementation project(':lib')
13 | }
14 |
--------------------------------------------------------------------------------
/samples/sample/src/main/res/layout/photo_grid.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
--------------------------------------------------------------------------------
/lib/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'java-library'
3 | id 'com.vanniktech.maven.publish'
4 | }
5 |
6 | sourceCompatibility = 1.8
7 | targetCompatibility = 1.8
8 |
9 | java {
10 | toolchain.languageVersion.set(JavaLanguageVersion.of(8))
11 | }
12 |
13 | dependencies {
14 | // Dagger is part of the API since we generate code which depends on Dagger's API in the consuming gradle module.
15 | api deps.dagger
16 | }
17 |
--------------------------------------------------------------------------------
/samples/sample-lib/src/main/res/drawable/ic_arrow_forward_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/models/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'org.jetbrains.kotlin.jvm'
3 | id 'com.vanniktech.maven.publish'
4 | }
5 |
6 | dependencies {
7 | api project(':ast')
8 |
9 | implementation deps.kotlin.stdlib
10 | implementation project(':lib')
11 |
12 | testImplementation project(':compiler-ast')
13 | testImplementation deps.roomCompilerProcessing
14 | testImplementation deps.test.truth
15 | testImplementation deps.test.compileTesting
16 | }
17 |
--------------------------------------------------------------------------------
/samples/sample-lib/src/main/res/drawable/ic_close_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/tests/compiler/README.md:
--------------------------------------------------------------------------------
1 | Our integration tests are written in a Java Gradle module `:it`. This is useful for leveraging all the niceties of the
2 | IDE while writing the tests. However, we also need to be able to test cases where we expect Motif's annotation processor
3 | to throw an error. The `:stub-compiler` module was built to support this case. It generates stub `*ScopeImpl` classes so
4 | the IDE is happy when we're writing tests but doesn't do any correctness validation, so we are free test error cases as
5 | well.
6 |
--------------------------------------------------------------------------------
/samples/sample-kotlin-ksp/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/samples/sample-kotlin/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/intellij/src/main/resources/icons/icon.svg:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/samples/sample/src/main/res/layout/photo_list_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/tests/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.google.devtools.ksp'
3 | id 'java-library'
4 | id 'kotlin'
5 | id 'kotlin-kapt'
6 | }
7 |
8 | kotlin {
9 | sourceSets {
10 | main.kotlin.srcDirs += 'build/generated/ksp/main/kotlin'
11 | test.kotlin.srcDirs += 'build/generated/ksp/test/kotlin'
12 | }
13 | }
14 |
15 | dependencies {
16 | kapt project(':tests-compiler')
17 | kapt deps.daggerCompiler
18 | implementation project(':core')
19 | implementation project(':lib')
20 | implementation deps.kotlin.stdlib
21 | implementation deps.test.truth
22 | }
--------------------------------------------------------------------------------
/compiler/ast/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'org.jetbrains.kotlin.jvm'
3 | id 'com.vanniktech.maven.publish'
4 | }
5 |
6 | dependencies {
7 | implementation deps.kotlin.stdlib
8 | implementation deps.autoCommon
9 | implementation deps.javapoet
10 | implementation deps.kotlinpoetInteropMetadata
11 | implementation deps.kspApi
12 | implementation deps.roomCompilerProcessing
13 |
14 | api project(':ast')
15 |
16 | testImplementation deps.test.truth
17 | testImplementation deps.test.compileTesting
18 | testImplementation deps.test.roomCompilerProcessingTesting
19 | }
20 |
--------------------------------------------------------------------------------
/samples/sample-kotlin/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
--------------------------------------------------------------------------------
/samples/sample-kotlin-ksp/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/samples/sample/src/main/res/layout/bottomsheet.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
--------------------------------------------------------------------------------
/samples/sample-lib/src/main/res/drawable/ic_local_offer_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/config/spotless/copyright.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) $YEAR Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
--------------------------------------------------------------------------------
/config/spotless/copyright.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) $YEAR Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
--------------------------------------------------------------------------------
/lib/gradle.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2018. Uber Technologies
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | POM_NAME=Motif
18 | POM_ARTIFACT_ID=motif
19 | POM_PACKAGING=jar
--------------------------------------------------------------------------------
/ast/gradle.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2018. Uber Technologies
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | POM_NAME=Motif
18 | POM_ARTIFACT_ID=motif-ast
19 | POM_PACKAGING=jar
--------------------------------------------------------------------------------
/core/gradle.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2018. Uber Technologies
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | POM_NAME=Motif
18 | POM_ARTIFACT_ID=motif-core
19 | POM_PACKAGING=jar
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 | **Library version**:
9 |
10 |
11 | **Repro steps or stacktrace**:
12 |
--------------------------------------------------------------------------------
/models/gradle.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2018. Uber Technologies
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | POM_NAME=Motif
18 | POM_ARTIFACT_ID=motif-models
19 | POM_PACKAGING=jar
--------------------------------------------------------------------------------
/compiler/gradle.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2018. Uber Technologies
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | POM_NAME=Motif
18 | POM_ARTIFACT_ID=motif-compiler
19 | POM_PACKAGING=jar
--------------------------------------------------------------------------------
/viewmodel/gradle.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2018. Uber Technologies
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | POM_NAME=Motif
18 | POM_ARTIFACT_ID=motif-viewmodel
19 | POM_PACKAGING=jar
--------------------------------------------------------------------------------
/intellij/gradle.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2018. Uber Technologies
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | POM_NAME=Motif
18 | POM_ARTIFACT_ID=motif-intellij
19 | POM_PACKAGING=jar
20 |
--------------------------------------------------------------------------------
/xprocessing/gradle.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2022. Uber Technologies
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | POM_NAME=Motif
18 | POM_ARTIFACT_ID=motif-xprocessing
19 | POM_PACKAGING=jar
--------------------------------------------------------------------------------
/compiler/ast/gradle.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2018. Uber Technologies
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | POM_NAME=Motif
18 | POM_ARTIFACT_ID=motif-ast-compiler
19 | POM_PACKAGING=jar
--------------------------------------------------------------------------------
/compiler/ksp/gradle.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2022. Uber Technologies
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | POM_NAME=Motif
18 | POM_ARTIFACT_ID=motif-compiler-ksp
19 | POM_PACKAGING=jar
--------------------------------------------------------------------------------
/errormessage/gradle.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2018. Uber Technologies
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | POM_NAME=Motif
18 | POM_ARTIFACT_ID=motif-errormessage
19 | POM_PACKAGING=jar
--------------------------------------------------------------------------------
/intellij/ast/gradle.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2018. Uber Technologies
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | POM_NAME=Motif
18 | POM_ARTIFACT_ID=motif-ast-intellij
19 | POM_PACKAGING=jar
--------------------------------------------------------------------------------
/lib/src/main/java/motif/Objects.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package motif;
17 |
18 | public @interface Objects {}
19 |
--------------------------------------------------------------------------------
/xprocessing-testing/gradle.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2022. Uber Technologies
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | POM_NAME=Motif
18 | POM_ARTIFACT_ID=motif-xprocessing-testing
19 | POM_PACKAGING=jar
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 | **Description**:
10 |
11 |
12 | **Related issue(s)**:
13 |
14 |
15 |
--------------------------------------------------------------------------------
/lib/src/main/java/motif/Creatable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package motif;
17 |
18 | public interface Creatable {}
19 |
--------------------------------------------------------------------------------
/lib/src/main/java/motif/DoNotCache.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package motif;
17 |
18 | public @interface DoNotCache {}
19 |
--------------------------------------------------------------------------------
/RELEASING.md:
--------------------------------------------------------------------------------
1 | Releasing
2 | =========
3 |
4 | 1. Change the version in `gradle.properties` to a non-SNAPSHOT version.
5 | 2. Update the `CHANGELOG.md` for the impending release.
6 | 3. `git commit -am "Prepare for release X.Y.Z."` (where X.Y.Z is the new version)
7 | 4. `git tag -a X.Y.Z -m "Version X.Y.Z"` (where X.Y.Z is the new version)
8 | 5. `CI=true ./gradlew clean publish -Dorg.gradle.parallel=false`
9 | 6. Update the `gradle.properties` to the next SNAPSHOT version.
10 | 7. `git commit -am "Prepare next development version."`
11 | 8. `git push && git push --tags`
12 | 9. Visit [Sonatype Nexus](https://oss.sonatype.org/) and promote the artifact.
13 | - Select the artifact, click `close`, wait for it to close, then select again and click
14 | `release`.
15 |
--------------------------------------------------------------------------------
/lib/src/main/java/motif/NoDependencies.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package motif;
17 |
18 | public interface NoDependencies {}
19 |
--------------------------------------------------------------------------------
/samples/dagger-comparison/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.library'
3 | }
4 |
5 | android {
6 | compileSdkVersion deps.build.compileSdkVersion
7 | buildToolsVersion deps.build.buildToolsVersion
8 |
9 | defaultConfig {
10 | minSdkVersion deps.build.minSdkVersion
11 | targetSdkVersion deps.build.targetSdkVersion
12 | }
13 |
14 | defaultConfig {
15 | minSdkVersion deps.build.minSdkVersion
16 | targetSdkVersion deps.build.targetSdkVersion
17 | }
18 |
19 | // No need for lint. This is just a tutorial.
20 | lintOptions {
21 | abortOnError false
22 | quiet true
23 | }
24 | }
25 |
26 | dependencies {
27 | annotationProcessor project(':compiler')
28 | implementation project(':lib')
29 | }
30 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T055_binds_upcast/A.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T055_binds_upcast;
17 |
18 | public class A {}
19 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E038_unchecked_binds/B.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E038_unchecked_binds;
17 |
18 | public class B {}
19 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T014_override_objects/B.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T014_override_objects;
17 |
18 | public class B {}
19 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T040_keywords/Abstract.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T040_keywords;
17 |
18 | public class Abstract {}
19 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T051_binds_interface/B.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T051_binds_interface;
17 |
18 | public interface B {}
19 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T012_inheritence_objects/A.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T012_inheritence_objects;
17 |
18 | public class A {}
19 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T054_binds_wildcards/B.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T054_binds_wildcards;
17 |
18 | public interface B {}
19 |
--------------------------------------------------------------------------------
/tests/src/main/java/external/T030_buck_classusage_motif/A.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package external.T030_buck_classusage_motif;
17 |
18 | public class A {}
19 |
--------------------------------------------------------------------------------
/tests/src/main/java/external/T031_buck_classusage_dagger/A.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package external.T031_buck_classusage_dagger;
17 |
18 | public class A {}
19 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T012_inheritence_objects/B.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T012_inheritence_objects;
17 |
18 | public class B {
19 | }
20 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T014_override_objects/A.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T014_override_objects;
17 |
18 | public class A extends B {}
19 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T016_factory_method_binds/B.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T016_factory_method_binds;
17 |
18 | public class B {}
19 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T051_binds_interface/A.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T051_binds_interface;
17 |
18 | public class A implements B {}
19 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E024_scope_class/Scope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E024_scope_class;
17 |
18 | @motif.Scope
19 | public class Scope {}
20 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E038_unchecked_binds/A.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E038_unchecked_binds;
17 |
18 | public class A extends B {}
19 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T054_binds_wildcards/A.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T054_binds_wildcards;
17 |
18 | public class A implements B {}
19 |
--------------------------------------------------------------------------------
/lib/src/main/java/motif/Expose.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package motif;
17 |
18 | /** See https://github.com/uber/motif/wiki#expose. */
19 | public @interface Expose {}
20 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T001_empty_scope/Scope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T001_empty_scope;
17 |
18 | @motif.Scope
19 | public interface Scope {}
20 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T015_factory_method_constructor/A.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T015_factory_method_constructor;
17 |
18 | public class A {}
19 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T016_factory_method_binds/A.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T016_factory_method_binds;
17 |
18 | public class A extends B {}
19 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T052_binds_interface_generic/B.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T052_binds_interface_generic;
17 |
18 | public interface B {}
19 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E043_binds_invalid_wildcard_super/A.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E043_binds_invalid_wildcard_super;
17 |
18 | public class A {}
19 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/KE002_nullable_constructor_parameter/Foo.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.KE002_nullable_constructor_parameter
17 |
18 | class Foo(s: String?)
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/KT002_constructor_factory_method/Foo.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.KT002_constructor_factory_method
17 |
18 | class Foo(val string: String)
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T021_objects_interface/Dependency.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T021_objects_interface;
17 |
18 | public class Dependency {
19 | }
20 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E042_binds_invalid_wildcard_extends/A.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E042_binds_invalid_wildcard_extends;
17 |
18 | public class A {}
19 |
--------------------------------------------------------------------------------
/ast/src/main/kotlin/motif/ast/IrField.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package motif.ast
17 |
18 | interface IrField : IrHasModifiers {
19 | val type: IrType
20 | val name: String
21 | }
22 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E039_binds_different_type_parameters/B.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E039_binds_different_type_parameters;
17 |
18 | public class B {}
19 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T023_factory_method_binds_dependencies/B.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T023_factory_method_binds_dependencies;
17 |
18 | public class B {}
19 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T052_binds_interface_generic/A.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T052_binds_interface_generic;
17 |
18 | public class A implements B {}
19 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T074_superclass_nested_class/Bar.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T074_superclass_nested_class;
17 |
18 | public class Bar implements Foo {}
19 |
--------------------------------------------------------------------------------
/ast/src/main/kotlin/motif/ast/IrParameter.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package motif.ast
17 |
18 | interface IrParameter : IrAnnotated {
19 | val type: IrType
20 | val name: String
21 | }
22 |
--------------------------------------------------------------------------------
/intellij/ast/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id "org.jetbrains.intellij"
3 | id 'org.jetbrains.kotlin.jvm'
4 | id 'com.vanniktech.maven.publish'
5 | }
6 |
7 | intellij {
8 | version = deps.versions.gradleIntellijPlugin.ide
9 | plugins = [ 'java', 'Kotlin' ]
10 | pluginName = 'Motif Plugin'
11 | updateSinceUntilBuild = false
12 | }
13 |
14 | kotlin {
15 | jvmToolchain(17)
16 | }
17 |
18 | dependencies {
19 | implementation project(':lib')
20 | implementation project(':ast')
21 | api project(':errormessage')
22 |
23 | implementation deps.kotlin.reflection
24 |
25 | testImplementation deps.test.junit
26 | testImplementation deps.test.assertj
27 | testImplementation deps.test.truth
28 | }
29 |
30 | tasks {
31 | buildSearchableOptions {
32 | enabled = false
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/lib/src/main/java/motif/internal/DaggerScope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package motif.internal;
17 |
18 | import javax.inject.Scope;
19 |
20 | @Scope
21 | public @interface DaggerScope {}
22 |
--------------------------------------------------------------------------------
/samples/sample-lib/src/main/res/drawable/ic_style_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/samples/sample/src/main/res/layout/photo_grid_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
19 |
20 |
--------------------------------------------------------------------------------
/tests/src/main/java/external/T032_buck_classusage_dagger_subcomponents/A.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package external.T032_buck_classusage_dagger_subcomponents;
17 |
18 | public class A {}
19 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E036_no_suitable_constructor_interface/Foo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E036_no_suitable_constructor_interface;
17 |
18 | public interface Foo {}
19 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E057_scope_extends_scope/BarScope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E057_scope_extends_scope;
17 |
18 | @motif.Scope
19 | public interface BarScope {}
20 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/KT003_constructor_factory_method_generics/Foo.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.KT003_constructor_factory_method_generics
17 |
18 | class Foo(val t: T)
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T020_naming_collisions/c/SomeDependency.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T020_naming_collisions.c;
17 |
18 | public class SomeDependency {
19 | }
20 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T020_naming_collisions/d/SomeDependency.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T020_naming_collisions.d;
17 |
18 | public class SomeDependency {
19 | }
20 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T023_factory_method_binds_dependencies/C.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T023_factory_method_binds_dependencies;
17 |
18 | public class C {
19 | }
20 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E039_binds_different_type_parameters/A.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E039_binds_different_type_parameters;
17 |
18 | public class A extends B {}
19 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T018_spread_inheritence/Spreadable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T018_spread_inheritence;
17 |
18 | public class Spreadable extends SpreadableParent {}
19 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T022_factory_method_constructor_dependencies/A.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T022_factory_method_constructor_dependencies;
17 |
18 | public class A {}
19 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E051_nullable_dynamic_dependency/Child.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E051_nullable_dynamic_dependency;
17 |
18 | @motif.Scope
19 | public interface Child {}
20 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T053_binds_bounded_type_parameters/B.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T053_binds_bounded_type_parameters;
17 |
18 | public interface B {}
19 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E003_scope_cycle/Scope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E003_scope_cycle;
17 |
18 | @motif.Scope
19 | public interface Scope {
20 |
21 | Scope child();
22 | }
23 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/KT004_constructor_factory_method_inheritance/Bar.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.KT004_constructor_factory_method_inheritance
17 |
18 | open class Bar(val string: String)
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T013_override_scope/ScopeParent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T013_override_scope;
17 |
18 | public interface ScopeParent {
19 |
20 | Object o();
21 | }
22 |
--------------------------------------------------------------------------------
/samples/sample-kotlin-ksp/src/main/java/motif/sample/Greeter.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package motif.sample
17 |
18 | class Greeter(private val name: String) {
19 |
20 | fun greet(): String = "Hello $name!"
21 | }
22 |
--------------------------------------------------------------------------------
/samples/sample-kotlin/src/main/java/motif/sample/Greeter.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package motif.sample
17 |
18 | class Greeter(private val name: String) {
19 |
20 | fun greet(): String = "Hello $name!"
21 | }
22 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E004_scope_cycle_2/Child.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E004_scope_cycle_2;
17 |
18 | @motif.Scope
19 | public interface Child {
20 |
21 | Scope scope();
22 | }
23 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E004_scope_cycle_2/Scope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E004_scope_cycle_2;
17 |
18 | @motif.Scope
19 | public interface Scope {
20 |
21 | Child child();
22 | }
23 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E017_not_exposed/Child.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E017_not_exposed;
17 |
18 | @motif.Scope
19 | public interface Child {
20 |
21 | String string();
22 | }
23 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E057_scope_extends_scope/FooScope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E057_scope_extends_scope;
17 |
18 | @motif.Scope
19 | public interface FooScope extends BarScope {}
20 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/KT004_constructor_factory_method_inheritance/Foo.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.KT004_constructor_factory_method_inheritance
17 |
18 | class Foo(string: String) : Bar(string)
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T053_binds_bounded_type_parameters/A.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T053_binds_bounded_type_parameters;
17 |
18 | public class A implements B {}
19 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E037_spread_not_exposed/Child.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E037_spread_not_exposed;
17 |
18 | @motif.Scope
19 | public interface Child {
20 |
21 | String a();
22 | }
23 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T039_factory_method_constructor_prioritize_annotation/A.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T039_factory_method_constructor_prioritize_annotation;
17 |
18 | public class A {}
19 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T056_deferred_rounds/Child.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T056_deferred_rounds;
17 |
18 | @motif.Scope
19 | public interface Child {
20 |
21 | String string();
22 | }
23 |
--------------------------------------------------------------------------------
/lib/src/main/java/motif/internal/None.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package motif.internal;
17 |
18 | public final class None {
19 |
20 | public static final Object NONE = new None();
21 |
22 | private None() {}
23 | }
24 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T005_custom_qualifier/A.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T005_custom_qualifier;
17 |
18 | import javax.inject.Qualifier;
19 |
20 | @Qualifier
21 | public @interface A {
22 | }
23 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T005_custom_qualifier/B.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T005_custom_qualifier;
17 |
18 | import javax.inject.Qualifier;
19 |
20 | @Qualifier
21 | public @interface B {
22 | }
23 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T014_override_objects/ObjectsParent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T014_override_objects;
17 |
18 | public abstract class ObjectsParent {
19 |
20 | abstract B b();
21 | }
22 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T076_inner_class_dependency/Other.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T076_inner_class_dependency;
17 |
18 | public class Other {
19 |
20 | public static class Foo {}
21 | }
22 |
--------------------------------------------------------------------------------
/ast/src/main/kotlin/motif/ast/IrEquivalence.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package motif.ast
17 |
18 | interface IrEquivalence {
19 |
20 | override fun equals(other: Any?): Boolean
21 |
22 | override fun hashCode(): Int
23 | }
24 |
--------------------------------------------------------------------------------
/tests/src/main/java/external/T028_external/Child.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package external.T028_external;
17 |
18 | import motif.Scope;
19 |
20 | @Scope
21 | public interface Child {
22 |
23 | String string();
24 | }
25 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E015_missing_dependency_constructor/A.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E015_missing_dependency_constructor;
17 |
18 | public class A {
19 |
20 | public A(String string) {}
21 | }
22 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E027_invalid_scope_method/Scope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E027_invalid_scope_method;
17 |
18 | @motif.Scope
19 | public interface Scope {
20 |
21 | void invalid();
22 | }
23 |
--------------------------------------------------------------------------------
/intellij/src/main/kotlin/motif/intellij/analytics/MotifAnalyticsLogger.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package motif.intellij.analytics
17 |
18 | interface MotifAnalyticsLogger {
19 |
20 | fun log(metadata: Map)
21 | }
22 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E058_scope_extends_scope_intermediate_class/BarScope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E058_scope_extends_scope_intermediate_class;
17 |
18 | @motif.Scope
19 | public interface BarScope {}
20 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T011_inheritence_scope/ScopeGrandparent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T011_inheritence_scope;
17 |
18 | public interface ScopeGrandparent {
19 |
20 | TT grandparent();
21 | }
22 |
--------------------------------------------------------------------------------
/compiler/src/test/java/motif/compiler/TestParameters.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package motif.compiler
17 |
18 | enum class ProcessorType {
19 | AP,
20 | KSP,
21 | }
22 |
23 | enum class SourceLanguage {
24 | JAVA,
25 | KOTLIN,
26 | }
27 |
--------------------------------------------------------------------------------
/lib/src/main/java/motif/Spread.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package motif;
17 |
18 | import java.lang.annotation.ElementType;
19 | import java.lang.annotation.Target;
20 |
21 | @Target(ElementType.METHOD)
22 | public @interface Spread {}
23 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E058_scope_extends_scope_intermediate_class/Intermediate.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E058_scope_extends_scope_intermediate_class;
17 |
18 | public interface Intermediate extends BarScope {}
19 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T001_empty_scope/Test.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T001_empty_scope;
17 |
18 | public class Test {
19 |
20 | public static void run() {
21 | new ScopeImpl();
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T048_expose_spread_factory_method/Child.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T048_expose_spread_factory_method;
17 |
18 | @motif.Scope
19 | public interface Child {
20 |
21 | String a();
22 | }
23 |
--------------------------------------------------------------------------------
/lib/src/main/java/motif/internal/Constants.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package motif.internal;
17 |
18 | public class Constants {
19 |
20 | public static final String SCOPE_IMPL_SUFFIX = "Impl";
21 |
22 | private Constants() {}
23 | }
24 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E028_invalid_scope_method_2/Scope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E028_invalid_scope_method_2;
17 |
18 | @motif.Scope
19 | public interface Scope {
20 |
21 | String invalid(Integer i);
22 | }
23 |
--------------------------------------------------------------------------------
/tests/src/main/java/external/T033_unprocessed_scope/Child.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package external.T033_unprocessed_scope;
17 |
18 | import motif.Scope;
19 |
20 | @Scope
21 | public interface Child {
22 |
23 | String string();
24 | }
25 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T011_inheritence_scope/ScopeParent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T011_inheritence_scope;
17 |
18 | public interface ScopeParent extends ScopeGrandparent {
19 |
20 | T parent();
21 | }
22 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T045_dynamic_dependency_expose/Grandchild.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T045_dynamic_dependency_expose;
17 |
18 | @motif.Scope
19 | public interface Grandchild {
20 |
21 | String string();
22 | }
23 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T056_deferred_rounds/Test.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T056_deferred_rounds;
17 |
18 | public class Test {
19 |
20 | public static void run() {
21 | new ScopeImpl();
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E037_spread_not_exposed/Spreadable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E037_spread_not_exposed;
17 |
18 | public class Spreadable {
19 |
20 | public String a() {
21 | return "a";
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E058_scope_extends_scope_intermediate_class/FooScope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E058_scope_extends_scope_intermediate_class;
17 |
18 | @motif.Scope
19 | public interface FooScope extends Intermediate {}
20 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T063_diamond_expose_to_grandchild/ChildA.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T063_diamond_expose_to_grandchild;
17 |
18 | @motif.Scope
19 | public interface ChildA {
20 |
21 | GrandChild grandChild();
22 | }
23 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T063_diamond_expose_to_grandchild/ChildB.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T063_diamond_expose_to_grandchild;
17 |
18 | @motif.Scope
19 | public interface ChildB {
20 |
21 | GrandChild grandChild();
22 | }
23 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T068_missing_dependency_no_creatable/Scope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T068_missing_dependency_no_creatable;
17 |
18 | @motif.Scope
19 | public interface Scope {
20 |
21 | String string();
22 | }
23 |
--------------------------------------------------------------------------------
/samples/sample/src/test/java/motif/sample/app/root/RootScopeTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package motif.sample.app.root;
17 |
18 | import org.junit.Test;
19 |
20 | public class RootScopeTest {
21 |
22 | @Test
23 | public void testIt() {}
24 | }
25 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E011_dynamic_dependency_not_exposed/Child.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E011_dynamic_dependency_not_exposed;
17 |
18 | @motif.Scope
19 | public interface Child {
20 |
21 | Grandchild grandchild();
22 | }
23 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E011_dynamic_dependency_not_exposed/Grandchild.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E011_dynamic_dependency_not_exposed;
17 |
18 | @motif.Scope
19 | public interface Grandchild {
20 |
21 | String string();
22 | }
23 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/KT006_reference_self/Child.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.KT006_reference_self
17 |
18 | @motif.Scope
19 | interface Child {
20 |
21 | @motif.Objects
22 | abstract class Objects : ObjectComponent
23 |
24 | }
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/KT006_reference_self/Foo.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.KT006_reference_self
17 |
18 | interface Foo
19 | class Bar : Foo
20 | interface ObjectComponent> {
21 | fun generic(someFoo: T): Foo
22 | }
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T060_default_objects_methods2/IntObjects.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T060_default_objects_methods2;
17 |
18 | public interface IntObjects {
19 |
20 | default int i() {
21 | return 1;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T065_diamond_hide_source/Child1.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T065_diamond_hide_source;
17 |
18 | import motif.Scope;
19 |
20 | @Scope
21 | public interface Child1 {
22 | GrandChild grandChild();
23 | }
24 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E013_missing_dependencies_multiple_scopes/ChildA.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E013_missing_dependencies_multiple_scopes;
17 |
18 | @motif.Scope
19 | public interface ChildA {
20 |
21 | String string();
22 | }
23 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E013_missing_dependencies_multiple_scopes/ChildB.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E013_missing_dependencies_multiple_scopes;
17 |
18 | @motif.Scope
19 | public interface ChildB {
20 |
21 | String string();
22 | }
23 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E016_missing_dependencies_multilevel/Grandchild.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E016_missing_dependencies_multilevel;
17 |
18 | @motif.Scope
19 | public interface Grandchild {
20 |
21 | Integer integer();
22 | }
23 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T065_diamond_hide_source/GrandChild.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T065_diamond_hide_source;
17 |
18 | import motif.Scope;
19 |
20 | @Scope
21 | public interface GrandChild {
22 |
23 | String string();
24 | }
25 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E046_diamond_unsatisfied_sink/Child1.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E046_diamond_unsatisfied_sink;
17 |
18 | import motif.Scope;
19 |
20 | @Scope
21 | public interface Child1 {
22 | GrandChild grandChild();
23 | }
24 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E047_duplicate_factory_method_spread/Foo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E047_duplicate_factory_method_spread;
17 |
18 | public class Foo {
19 |
20 | public String string() {
21 | return "b";
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E045_dynamic_dependency_duplicate_factory_method2/Child1.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E045_dynamic_dependency_duplicate_factory_method2;
17 |
18 | @motif.Scope
19 | public interface Child1 {
20 |
21 | String s();
22 | }
23 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E046_diamond_unsatisfied_sink/GrandChild.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E046_diamond_unsatisfied_sink;
17 |
18 | import motif.Scope;
19 |
20 | @Scope
21 | public interface GrandChild {
22 |
23 | String string();
24 | }
25 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E048_duplicate_factory_method_spread2/Foo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E048_duplicate_factory_method_spread2;
17 |
18 | public class Foo {
19 |
20 | public String string() {
21 | return "b";
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E049_duplicate_factory_method_spread3/Foo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E049_duplicate_factory_method_spread3;
17 |
18 | public class Foo {
19 |
20 | public String string() {
21 | return "b";
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E050_unsatisfied_dependency_no_duplicates/Grandchild.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E050_unsatisfied_dependency_no_duplicates;
17 |
18 | @motif.Scope
19 | public interface Grandchild {
20 |
21 | String string();
22 | }
23 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T048_expose_spread_factory_method/Spreadable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T048_expose_spread_factory_method;
17 |
18 | public class Spreadable {
19 |
20 | public String a() {
21 | return "a";
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T060_default_objects_methods2/StringObjects.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T060_default_objects_methods2;
17 |
18 | public interface StringObjects {
19 |
20 | default String string() {
21 | return "s";
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E026_factory_method_missing_constructor_inject/A.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E026_factory_method_missing_constructor_inject;
17 |
18 | public class A {
19 |
20 | public A() {}
21 |
22 | public A(String string) {}
23 | }
24 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E059_unexposed_on_subset_of_paths/BazScope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E059_unexposed_on_subset_of_paths;
17 |
18 | import motif.Scope;
19 |
20 | @Scope
21 | public interface BazScope {
22 |
23 | String string();
24 | }
25 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T036_dagger_spread/Test.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T036_dagger_spread;
17 |
18 | import static com.google.common.truth.Truth.assertThat;
19 |
20 | public class Test {
21 |
22 | public static void run() {
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T045_dynamic_dependency_expose/Child.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T045_dynamic_dependency_expose;
17 |
18 | @motif.Scope
19 | public interface Child {
20 |
21 | Grandchild grandchild();
22 |
23 | String string();
24 | }
25 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T063_diamond_expose_to_grandchild/GrandChild.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T063_diamond_expose_to_grandchild;
17 |
18 | import motif.Scope;
19 |
20 | @Scope
21 | public interface GrandChild {
22 |
23 | String string();
24 | }
25 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E023_objects_fields_inherited/Scope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E023_objects_fields_inherited;
17 |
18 | @motif.Scope
19 | public interface Scope {
20 |
21 | @motif.Objects
22 | class Objects extends ObjectsParent {}
23 | }
24 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T046_spread_static_spreadable_method/Spreadable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T046_spread_static_spreadable_method;
17 |
18 | public class Spreadable {
19 |
20 | public static String a() {
21 | return "a";
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T047_dynamic_dependency_named_component/Child.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T047_dynamic_dependency_named_component;
17 |
18 | import motif.Scope;
19 |
20 | @Scope
21 | public interface Child {
22 |
23 | String string();
24 | }
25 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T058_dynamic_dependency_overrides_expose/Child.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T058_dynamic_dependency_overrides_expose;
17 |
18 | import motif.Scope;
19 |
20 | @Scope
21 | public interface Child {
22 |
23 | String string();
24 | }
25 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T064_diamond_child_parameter_override/Child1.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T064_diamond_child_parameter_override;
17 |
18 | import motif.Scope;
19 |
20 | @Scope
21 | public interface Child1 {
22 | GrandChild grandChild();
23 | }
24 |
--------------------------------------------------------------------------------
/samples/sample-lib/src/main/java/motif/sample/lib/controller/ViewlessControllerObjects.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package motif.sample.lib.controller;
17 |
18 | public abstract class ViewlessControllerObjects {
19 |
20 | public abstract C controller();
21 | }
22 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T064_diamond_child_parameter_override/GrandChild.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T064_diamond_child_parameter_override;
17 |
18 | import motif.Scope;
19 |
20 | @Scope
21 | public interface GrandChild {
22 |
23 | String string();
24 | }
25 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E016_missing_dependencies_multilevel/Child.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E016_missing_dependencies_multilevel;
17 |
18 | @motif.Scope
19 | public interface Child {
20 |
21 | Grandchild grandchild();
22 |
23 | String string();
24 | }
25 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E018_not_exposed_prioritize_over_duplicate_factory_methods/Child.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E018_not_exposed_prioritize_over_duplicate_factory_methods;
17 |
18 | @motif.Scope
19 | public interface Child {
20 |
21 | String string();
22 | }
23 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T062_hide_duplicate_with_dependencies_spread/Foo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package testcases.T062_hide_duplicate_with_dependencies_spread;
18 |
19 | public class Foo {
20 |
21 | public String string() {
22 | return "a";
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T074_superclass_nested_class/Foo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T074_superclass_nested_class;
17 |
18 | public interface Foo {
19 |
20 | class Baz {
21 |
22 | String s() {
23 | return "s";
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/tests/src/main/java/external/T066_package_private_objects_method/ScopeObjects.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package external.T066_package_private_objects_method;
17 |
18 | public class ScopeObjects {
19 |
20 | String packagePrivate() {
21 | return "package-private";
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E019_objects_fields/Scope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E019_objects_fields;
17 |
18 | @motif.Scope
19 | public interface Scope {
20 |
21 | @motif.Objects
22 | class Objects {
23 |
24 | private final String s = "s";
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E020_objects_constructor/Scope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E020_objects_constructor;
17 |
18 | @motif.Scope
19 | public interface Scope {
20 |
21 | @motif.Objects
22 | class Objects {
23 |
24 | Objects(String s) {}
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E029_invalid_objects_method/Scope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E029_invalid_objects_method;
17 |
18 | @motif.Scope
19 | public interface Scope {
20 |
21 | @motif.Objects
22 | class Objects {
23 |
24 | void invalid() {}
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T023_factory_method_binds_dependencies/A.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T023_factory_method_binds_dependencies;
17 |
18 | public class A extends B {
19 |
20 | private final C c;
21 |
22 | public A(C c) {
23 | this.c = c;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T064_diamond_child_parameter_override/Child2.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T064_diamond_child_parameter_override;
17 |
18 | import motif.Scope;
19 |
20 | @Scope
21 | public interface Child2 {
22 |
23 | GrandChild grandChild(String string);
24 | }
25 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E033_not_assignable/Scope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E033_not_assignable;
17 |
18 | @motif.Scope
19 | public interface Scope {
20 |
21 | @motif.Objects
22 | abstract class Objects {
23 |
24 | abstract String s(Integer i);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E051_nullable_dynamic_dependency/Scope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E051_nullable_dynamic_dependency;
17 |
18 | import javax.annotation.Nullable;
19 |
20 | @motif.Scope
21 | public interface Scope {
22 |
23 | Child child(@Nullable String string);
24 | }
25 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T022_factory_method_constructor_dependencies/B.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T022_factory_method_constructor_dependencies;
17 |
18 | public class B {
19 |
20 | private final A a;
21 |
22 | public B(A a) {
23 | this.a = a;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E023_objects_fields_inherited/ObjectsParent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E023_objects_fields_inherited;
17 |
18 | public class ObjectsParent {
19 |
20 | private final String s = "s";
21 |
22 | public String s() {
23 | return s;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E032_no_suitable_constructor/Scope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E032_no_suitable_constructor;
17 |
18 | @motif.Scope
19 | public interface Scope {
20 |
21 | @motif.Objects
22 | abstract class Objects {
23 |
24 | abstract int i();
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E052_custom_qualifier_with_nonstring_value/CustomQualifier.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E052_custom_qualifier_with_nonstring_value;
17 |
18 | import javax.inject.Qualifier;
19 |
20 | @Qualifier
21 | public @interface CustomQualifier {
22 |
23 | int value();
24 | }
25 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T006_custom_qualifier_with_string_value/CustomQualifier.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T006_custom_qualifier_with_string_value;
17 |
18 | import javax.inject.Qualifier;
19 |
20 | @Qualifier
21 | public @interface CustomQualifier {
22 |
23 | String value();
24 | }
25 |
--------------------------------------------------------------------------------
/viewmodel/src/main/kotlin/motif/viewmodel/RequiredDependency.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package motif.viewmodel
17 |
18 | import motif.models.Sink
19 | import motif.models.Source
20 | import motif.models.Type
21 |
22 | class RequiredDependency(val type: Type, val providedBy: List, val requiredBy: List)
23 |
--------------------------------------------------------------------------------
/lib/src/main/java/motif/ScopeImpl.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package motif;
17 |
18 | /** Annotation to provide a stable API for statically analyzing the Scope hierarchy. */
19 | public @interface ScopeImpl {
20 |
21 | Class> scope();
22 |
23 | Class> dependencies();
24 |
25 | Class>[] children();
26 | }
27 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E053_custom_qualifier_with_nonvalue_member/CustomQualifier.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E053_custom_qualifier_with_nonvalue_member;
17 |
18 | import javax.inject.Qualifier;
19 |
20 | @Qualifier
21 | public @interface CustomQualifier {
22 |
23 | String other();
24 | }
25 |
--------------------------------------------------------------------------------
/models/src/main/kotlin/motif/models/MotifError.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package motif.models
17 |
18 | /**
19 | * An error that can be produced by Motif's core parsing and graph processing logic. This is not a
20 | * sealed class because it's implementations are spread across multiple modules.
21 | */
22 | interface MotifError
23 |
--------------------------------------------------------------------------------
/tests/src/main/java/external/T030_buck_classusage_motif/Child.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package external.T030_buck_classusage_motif;
17 |
18 | import motif.Scope;
19 |
20 | @Scope
21 | public interface Child {
22 |
23 | @motif.Objects
24 | abstract class Objects {
25 |
26 | abstract A a();
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E036_no_suitable_constructor_interface/Scope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E036_no_suitable_constructor_interface;
17 |
18 | @motif.Scope
19 | public interface Scope {
20 |
21 | @motif.Objects
22 | abstract class Objects {
23 |
24 | abstract Foo i();
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E041_nullable_spread_method/Spreadable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E041_nullable_spread_method;
17 |
18 | import javax.annotation.Nullable;
19 |
20 | public class Spreadable {
21 |
22 | @Nullable
23 | public String value() {
24 | return null;
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E030_invalid_objects_method_2/Scope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E030_invalid_objects_method_2;
17 |
18 | @motif.Scope
19 | public interface Scope {
20 |
21 | @motif.Objects
22 | abstract class Objects {
23 |
24 | abstract String s(String s1, String s2);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/KE001_nullable_parameter/Scope.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.KE001_nullable_parameter
17 |
18 | @motif.Scope
19 | interface Scope {
20 |
21 | @motif.Objects
22 | class Objects {
23 |
24 | fun string(): String? {
25 | return "s"
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E034_void_dependencies_method/Scope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E034_void_dependencies_method;
17 |
18 | import motif.Creatable;
19 |
20 | @motif.Scope
21 | public interface Scope extends Creatable {
22 | interface Dependencies {
23 |
24 | void a();
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/viewmodel/src/main/kotlin/motif/viewmodel/ProvidedDependency.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package motif.viewmodel
17 |
18 | import motif.models.Sink
19 | import motif.models.Source
20 |
21 | class ProvidedDependency(
22 | val source: Source,
23 | val consumedBy: List,
24 | val requiredDependencies: List,
25 | )
26 |
--------------------------------------------------------------------------------
/samples/sample-lib-ksp/src/main/java/com/example/sample_lib_ksp/Greeter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.example.sample_lib_ksp;
17 |
18 | class Greeter {
19 | private final String name;
20 |
21 | public Greeter(String name) {
22 | this.name = name;
23 | }
24 |
25 | String greet() {
26 | return "Hello " + name + "!";
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E054_custom_qualifier_with_multiple_members/CustomQualifier.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E054_custom_qualifier_with_multiple_members;
17 |
18 | import javax.inject.Qualifier;
19 |
20 | @Qualifier
21 | public @interface CustomQualifier {
22 |
23 | String value();
24 |
25 | String other();
26 | }
27 |
--------------------------------------------------------------------------------
/intellij/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id "org.jetbrains.intellij"
3 | id 'org.jetbrains.kotlin.jvm'
4 | id 'com.vanniktech.maven.publish'
5 | }
6 |
7 | intellij {
8 | version = deps.versions.gradleIntellijPlugin.ide
9 | plugins = [ 'java', 'Kotlin' ]
10 | pluginName = 'Motif Plugin'
11 | updateSinceUntilBuild = false
12 | }
13 |
14 | kotlin {
15 | jvmToolchain(17)
16 | }
17 |
18 | group 'com.uber.motif'
19 | version '0.0.5' // Plugin version
20 |
21 | dependencies {
22 | implementation project(':lib')
23 | implementation project(':core')
24 | implementation project(':intellij-ast')
25 |
26 | implementation deps.kotlin.reflection
27 |
28 | testImplementation deps.test.truth
29 | testImplementation project(':viewmodel')
30 | }
31 |
32 | runIde {
33 | maxHeapSize = "2g"
34 | }
35 |
36 | test {
37 | inputs.files(file("$rootDir/tests/src"))
38 | }
39 |
40 | tasks {
41 | buildSearchableOptions {
42 | enabled = false
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E016_missing_dependencies_multilevel/Scope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E016_missing_dependencies_multilevel;
17 |
18 | import motif.Creatable;
19 |
20 | @motif.Scope
21 | public interface Scope extends Creatable {
22 |
23 | Child child();
24 |
25 | interface Dependencies {}
26 | }
27 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E055_duplicated_dynamic_dependency_source/Scope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E055_duplicated_dynamic_dependency_source;
17 |
18 | import javax.inject.Named;
19 |
20 | @motif.Scope
21 | public interface Scope {
22 |
23 | Child child(String string1, String string2, @Named("string3") String string3);
24 | }
25 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T056_deferred_rounds/Scope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T056_deferred_rounds;
17 |
18 | @motif.Scope
19 | public interface Scope extends ChildImpl.Dependencies {
20 |
21 | @motif.Objects
22 | class Objects {
23 |
24 | String string() {
25 | return "s";
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E035_dependency_method_parameters/Scope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E035_dependency_method_parameters;
17 |
18 | import motif.Creatable;
19 |
20 | @motif.Scope
21 | public interface Scope extends Creatable {
22 | interface Dependencies {
23 |
24 | String s(String s);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E055_duplicated_dynamic_dependency_source/Child.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E055_duplicated_dynamic_dependency_source;
17 |
18 | import javax.inject.Named;
19 |
20 | @motif.Scope
21 | public interface Child {
22 | String string1();
23 | String string2();
24 | @Named("string3") String string3();
25 | }
26 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/KT006_reference_self/Scope.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.KT006_reference_self
17 |
18 | import motif.Expose
19 |
20 | @motif.Scope
21 | interface Scope {
22 |
23 | fun child(): Child
24 |
25 | @motif.Objects
26 | abstract class Objects {
27 |
28 | @Expose
29 | fun bar(): Bar = Bar()
30 | }
31 | }
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T068_missing_dependency_no_creatable/Test.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T068_missing_dependency_no_creatable;
17 |
18 | import static com.google.common.truth.Truth.assertThat;
19 |
20 | public class Test {
21 |
22 | public static void run() {
23 | assertThat(ScopeImpl.class).isNotNull();
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T071_scope_factory/Scope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T071_scope_factory;
17 |
18 | import motif.Creatable;
19 |
20 | @motif.Scope
21 | public interface Scope extends Creatable {
22 |
23 | String string();
24 |
25 | interface Dependencies {
26 |
27 | String s();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T072_scope_factory/Scope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T072_scope_factory;
17 |
18 | import motif.Creatable;
19 |
20 | @motif.Scope
21 | public interface Scope extends Creatable {
22 |
23 | String string();
24 |
25 | interface Dependencies {
26 |
27 | String s();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E011_dynamic_dependency_not_exposed/Scope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E011_dynamic_dependency_not_exposed;
17 |
18 | import motif.Creatable;
19 |
20 | @motif.Scope
21 | public interface Scope extends Creatable {
22 |
23 | Child child(String string);
24 |
25 | interface Dependencies {}
26 | }
27 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E050_unsatisfied_dependency_no_duplicates/Scope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E050_unsatisfied_dependency_no_duplicates;
17 |
18 | import motif.Creatable;
19 |
20 | @motif.Scope
21 | public interface Scope extends Creatable {
22 |
23 | Child child();
24 |
25 | interface Dependencies {}
26 | }
27 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/KT005_qualifier/Test.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.KT005_qualifier;
17 |
18 | import static com.google.common.truth.Truth.assertThat;
19 |
20 | public class Test {
21 |
22 | public static void run() {
23 | Scope scope = new ScopeImpl();
24 | assertThat(scope.string()).isEqualTo("s");
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/KT006_reference_self/Test.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.KT006_reference_self;
17 |
18 | import static com.google.common.truth.Truth.assertThat;
19 |
20 | public class Test {
21 |
22 | public static void run() {
23 | Scope scope = new ScopeImpl();
24 | assertThat(scope.child()).isNotNull();
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T004_qualifier/Test.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T004_qualifier;
17 |
18 | import static com.google.common.truth.Truth.assertThat;
19 |
20 | public class Test {
21 |
22 | public static void run() {
23 | Scope scope = new ScopeImpl();
24 | assertThat(scope.string()).isEqualTo("ab");
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T017_spread/Spreadable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T017_spread;
17 |
18 | import javax.inject.Named;
19 |
20 | public class Spreadable {
21 | @Named("a")
22 | public String a() {
23 | return "a";
24 | }
25 |
26 | @Named("b")
27 | public String b() {
28 | return "b";
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T024_child/Child.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T024_child;
17 |
18 | import motif.Scope;
19 |
20 | @Scope
21 | public interface Child {
22 |
23 | String string();
24 |
25 | @motif.Objects
26 | class Objects {
27 |
28 | String string() {
29 | return "c";
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T070_creatable_child/Child.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T070_creatable_child;
17 |
18 | import motif.Creatable;
19 |
20 | @motif.Scope
21 | public interface Child extends Creatable {
22 |
23 | String string();
24 |
25 | interface Dependencies {
26 |
27 | String s();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/ast/src/main/kotlin/motif/ast/IrModifier.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package motif.ast
17 |
18 | enum class IrModifier {
19 | PUBLIC,
20 | PROTECTED,
21 | PRIVATE,
22 | INTERNAL,
23 | STATIC,
24 | ABSTRACT,
25 | FINAL,
26 | NATIVE,
27 | SYNCHRONIZED,
28 | STRICTFP,
29 | TRANSIENT,
30 | VOLATILE,
31 | DEFAULT,
32 | OPEN,
33 | TRANSITIVE,
34 | }
35 |
--------------------------------------------------------------------------------
/lib/src/main/java/motif/Scope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package motif;
17 |
18 | public @interface Scope {
19 | /**
20 | * @return on false, the field will be initialized with [None.NONE]. Otherwise, null &
21 | * [Initialized.INITIALIZED] will be used to skip the field initialization.
22 | */
23 | boolean useNullFieldInitialization() default false;
24 | }
25 |
--------------------------------------------------------------------------------
/samples/sample-lib/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.library'
3 | }
4 |
5 | android {
6 | compileSdkVersion deps.build.compileSdkVersion
7 | buildToolsVersion deps.build.buildToolsVersion
8 |
9 | defaultConfig {
10 | minSdkVersion deps.build.minSdkVersion
11 | targetSdkVersion deps.build.targetSdkVersion
12 | }
13 |
14 | defaultConfig {
15 | minSdkVersion deps.build.minSdkVersion
16 | targetSdkVersion deps.build.targetSdkVersion
17 | }
18 |
19 | // No need for lint. This is just a tutorial.
20 | lintOptions {
21 | abortOnError false
22 | quiet true
23 | }
24 | }
25 |
26 | dependencies {
27 | annotationProcessor project(':compiler')
28 | annotationProcessor deps.roomCompiler
29 | api project(':lib')
30 | api deps.roomRx
31 | api deps.autodispose
32 | api deps.rx.binding
33 | api deps.rx.relay
34 | api deps.support.recyclerview
35 | api deps.support.appCompat
36 | api deps.room
37 | }
38 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/E046_diamond_unsatisfied_sink/Scope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.E046_diamond_unsatisfied_sink;
17 |
18 | import motif.Creatable;
19 |
20 | @motif.Scope
21 | public interface Scope extends Creatable {
22 |
23 | Child1 child1();
24 | Child2 child2();
25 |
26 | interface Dependencies {}
27 | }
28 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/KT001_basic_scope/Test.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.KT001_basic_scope;
17 |
18 | import static com.google.common.truth.Truth.assertThat;
19 |
20 | public class Test {
21 |
22 | public static void run() {
23 | Scope scope = new ScopeImpl();
24 | assertThat(scope.string()).isEqualTo("s");
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T002_access_method/Test.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T002_access_method;
17 |
18 | import static com.google.common.truth.Truth.assertThat;
19 |
20 | public class Test {
21 |
22 | public static void run() {
23 | Scope scope = new ScopeImpl();
24 | assertThat(scope.string()).isEqualTo("s");
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T013_override_scope/Test.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T013_override_scope;
17 |
18 | import static com.google.common.truth.Truth.assertThat;
19 |
20 | public class Test {
21 |
22 | public static void run() {
23 | Scope scope = new ScopeImpl();
24 | assertThat(scope.o()).isEqualTo("s");
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/tests/src/main/java/testcases/T014_override_objects/Test.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018-2019 Uber Technologies, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package testcases.T014_override_objects;
17 |
18 | import static com.google.common.truth.Truth.assertThat;
19 |
20 | public class Test {
21 |
22 | public static void run() {
23 | Scope scope = new ScopeImpl();
24 | assertThat(scope.a()).isNotNull();
25 | }
26 | }
27 |
--------------------------------------------------------------------------------