From 3e9de4cbb2bc3f6b40f51bd2fb57d0393b4d1293 Mon Sep 17 00:00:00 2001 From: Patrick Stewart Date: Tue, 24 Dec 2024 18:11:07 -0700 Subject: [PATCH] refactor: move container test implementations to incubation --- .../ioc_container/.gitignore | 0 .../ioc_container/CHANGELOG.md | 0 .../ioc_container/LICENSE.md | 0 .../ioc_container/README.md | 0 .../ioc_container/analysis_options.yaml | 0 .../ioc_container/example/.gitkeep | 0 .../ioc_container/lib/container.dart | 0 .../ioc_container/lib/src/bound_method.dart | 130 +++++++++----- .../ioc_container/lib/src/container.dart | 4 - .../lib/src/contextual_binding_builder.dart | 0 .../lib/src/entry_not_found_exception.dart | 0 .../lib/src/rewindable_generator.dart | 0 .../ioc_container/lib/src/util.dart | 0 .../ioc_container/pubspec.yaml | 1 + ...ter_resolving_attribute_callback_test.dart | 0 .../ioc_container/test/bound_method_test.dart | 163 ++++++++++++++++++ .../test/container_call_test.dart | 0 .../test/container_extend_test.dart | 0 ...ntainer_resolve_non_instantiable_test.dart | 0 .../test/container_tagging_test.dart | 0 .../ioc_container/test/container_test.dart | 0 .../contextual_attribute_binding_test.dart | 0 .../test/contextual_binding_test.dart | 0 .../test/resolving_callback_test.dart | 0 .../test/rewindable_generator_test.dart | 0 .../ioc_container/test/util_test.dart | 0 .../service_container/.gitignore | 0 .../service_container/CHANGELOG.md | 0 .../service_container/LICENSE.md | 0 .../service_container/README.md | 0 .../service_container/analysis_options.yaml | 0 .../service_container/doc/.gitkeep | 0 .../service_container/example/.gitkeep | 0 .../lib/service_container.dart | 0 .../lib/src/bound_method.dart | 0 .../service_container/lib/src/container.dart | 0 .../lib/src/contextual_binding_builder.dart | 0 .../lib/src/entry_not_found_exception.dart | 0 .../lib/src/rewindable_generator.dart | 0 .../service_container/lib/src/util.dart | 0 .../service_container/pubspec.yaml | 0 ...ter_resolving_attribute_callback_test.dart | 0 .../test/container_call_test.dart | 0 .../test/container_extend_test.dart | 0 ...ntainer_resolve_non_instantiable_test.dart | 0 .../test/container_tagging_test.dart | 0 .../test/container_test.dart | 0 .../contextual_attribute_binding_test.dart | 0 .../test/contextual_binding_test.dart | 0 .../test/resolving_callback_test.dart | 0 .../test/rewindable_generator_test.dart | 0 .../service_container/test/util_test.dart | 0 52 files changed, 255 insertions(+), 43 deletions(-) rename {packages => incubation}/ioc_container/.gitignore (100%) rename {packages => incubation}/ioc_container/CHANGELOG.md (100%) rename {packages => incubation}/ioc_container/LICENSE.md (100%) rename {packages => incubation}/ioc_container/README.md (100%) rename {packages => incubation}/ioc_container/analysis_options.yaml (100%) rename {packages => incubation}/ioc_container/example/.gitkeep (100%) rename {packages => incubation}/ioc_container/lib/container.dart (100%) rename {packages => incubation}/ioc_container/lib/src/bound_method.dart (71%) rename {packages => incubation}/ioc_container/lib/src/container.dart (99%) rename {packages => incubation}/ioc_container/lib/src/contextual_binding_builder.dart (100%) rename {packages => incubation}/ioc_container/lib/src/entry_not_found_exception.dart (100%) rename {packages => incubation}/ioc_container/lib/src/rewindable_generator.dart (100%) rename {packages => incubation}/ioc_container/lib/src/util.dart (100%) rename {packages => incubation}/ioc_container/pubspec.yaml (96%) rename {packages => incubation}/ioc_container/test/after_resolving_attribute_callback_test.dart (100%) create mode 100644 incubation/ioc_container/test/bound_method_test.dart rename {packages => incubation}/ioc_container/test/container_call_test.dart (100%) rename {packages => incubation}/ioc_container/test/container_extend_test.dart (100%) rename {packages => incubation}/ioc_container/test/container_resolve_non_instantiable_test.dart (100%) rename {packages => incubation}/ioc_container/test/container_tagging_test.dart (100%) rename {packages => incubation}/ioc_container/test/container_test.dart (100%) rename {packages => incubation}/ioc_container/test/contextual_attribute_binding_test.dart (100%) rename {packages => incubation}/ioc_container/test/contextual_binding_test.dart (100%) rename {packages => incubation}/ioc_container/test/resolving_callback_test.dart (100%) rename {packages => incubation}/ioc_container/test/rewindable_generator_test.dart (100%) rename {packages => incubation}/ioc_container/test/util_test.dart (100%) rename {packages => incubation}/service_container/.gitignore (100%) rename {packages => incubation}/service_container/CHANGELOG.md (100%) rename {packages => incubation}/service_container/LICENSE.md (100%) rename {packages => incubation}/service_container/README.md (100%) rename {packages => incubation}/service_container/analysis_options.yaml (100%) rename {packages => incubation}/service_container/doc/.gitkeep (100%) rename {packages => incubation}/service_container/example/.gitkeep (100%) rename {packages => incubation}/service_container/lib/service_container.dart (100%) rename {packages => incubation}/service_container/lib/src/bound_method.dart (100%) rename {packages => incubation}/service_container/lib/src/container.dart (100%) rename {packages => incubation}/service_container/lib/src/contextual_binding_builder.dart (100%) rename {packages => incubation}/service_container/lib/src/entry_not_found_exception.dart (100%) rename {packages => incubation}/service_container/lib/src/rewindable_generator.dart (100%) rename {packages => incubation}/service_container/lib/src/util.dart (100%) rename {packages => incubation}/service_container/pubspec.yaml (100%) rename {packages => incubation}/service_container/test/after_resolving_attribute_callback_test.dart (100%) rename {packages => incubation}/service_container/test/container_call_test.dart (100%) rename {packages => incubation}/service_container/test/container_extend_test.dart (100%) rename {packages => incubation}/service_container/test/container_resolve_non_instantiable_test.dart (100%) rename {packages => incubation}/service_container/test/container_tagging_test.dart (100%) rename {packages => incubation}/service_container/test/container_test.dart (100%) rename {packages => incubation}/service_container/test/contextual_attribute_binding_test.dart (100%) rename {packages => incubation}/service_container/test/contextual_binding_test.dart (100%) rename {packages => incubation}/service_container/test/resolving_callback_test.dart (100%) rename {packages => incubation}/service_container/test/rewindable_generator_test.dart (100%) rename {packages => incubation}/service_container/test/util_test.dart (100%) diff --git a/packages/ioc_container/.gitignore b/incubation/ioc_container/.gitignore similarity index 100% rename from packages/ioc_container/.gitignore rename to incubation/ioc_container/.gitignore diff --git a/packages/ioc_container/CHANGELOG.md b/incubation/ioc_container/CHANGELOG.md similarity index 100% rename from packages/ioc_container/CHANGELOG.md rename to incubation/ioc_container/CHANGELOG.md diff --git a/packages/ioc_container/LICENSE.md b/incubation/ioc_container/LICENSE.md similarity index 100% rename from packages/ioc_container/LICENSE.md rename to incubation/ioc_container/LICENSE.md diff --git a/packages/ioc_container/README.md b/incubation/ioc_container/README.md similarity index 100% rename from packages/ioc_container/README.md rename to incubation/ioc_container/README.md diff --git a/packages/ioc_container/analysis_options.yaml b/incubation/ioc_container/analysis_options.yaml similarity index 100% rename from packages/ioc_container/analysis_options.yaml rename to incubation/ioc_container/analysis_options.yaml diff --git a/packages/ioc_container/example/.gitkeep b/incubation/ioc_container/example/.gitkeep similarity index 100% rename from packages/ioc_container/example/.gitkeep rename to incubation/ioc_container/example/.gitkeep diff --git a/packages/ioc_container/lib/container.dart b/incubation/ioc_container/lib/container.dart similarity index 100% rename from packages/ioc_container/lib/container.dart rename to incubation/ioc_container/lib/container.dart diff --git a/packages/ioc_container/lib/src/bound_method.dart b/incubation/ioc_container/lib/src/bound_method.dart similarity index 71% rename from packages/ioc_container/lib/src/bound_method.dart rename to incubation/ioc_container/lib/src/bound_method.dart index acc7854..3e62534 100644 --- a/packages/ioc_container/lib/src/bound_method.dart +++ b/incubation/ioc_container/lib/src/bound_method.dart @@ -35,6 +35,72 @@ class BoundMethod { throw ArgumentError('Invalid callback type: ${callback.runtimeType}'); } + static dynamic _callBoundMethod( + Container container, dynamic callback, Function defaultCallback, + [List parameters = const []]) { + if (callback is List && callback.length == 2) { + var instance = callback[0]; + var method = callback[1]; + if (instance is String) { + instance = container.make(instance); + } + if (method is String) { + if (instance is Function && method == '__invoke') { + return Function.apply(instance, parameters); + } + if (instance is Map && instance.containsKey(method)) { + // Handle the case where instance is a Map and method is a key + var result = instance[method]; + return result is Function + ? Function.apply(result, parameters) + : result; + } + var instanceMirror = reflect(instance); + var methodSymbol = Symbol(method); + if (instanceMirror.type.instanceMembers.containsKey(methodSymbol)) { + var dependencies = + _getMethodDependencies(container, instance, method, parameters); + var result = Function.apply( + instanceMirror.getField(methodSymbol).reflectee, dependencies); + return result is Function + ? Function.apply(result, parameters) + : result; + } else if (method == '__invoke' && instance is Function) { + return Function.apply(instance, parameters); + } else if (instance is Type) { + // Handle static methods + var classMirror = reflectClass(instance); + if (classMirror.staticMembers.containsKey(Symbol(method))) { + var dependencies = + _getMethodDependencies(container, instance, method, parameters); + var result = Function.apply( + classMirror.getField(Symbol(method)).reflectee, dependencies); + return result is Function + ? Function.apply(result, parameters) + : result; + } + } + // Try to find the method in the global scope + var globalMethod = _findGlobalMethod(method); + if (globalMethod != null) { + var result = Function.apply(globalMethod, parameters); + return result is Function + ? Function.apply(result, parameters) + : result; + } + throw BindingResolutionException( + 'Method $method not found on ${instance.runtimeType}'); + } else if (method is Function) { + var result = Function.apply(method, [instance, ...parameters]); + return result is Function ? Function.apply(result, parameters) : result; + } + } else if (callback is Function) { + var result = Function.apply(callback, parameters); + return result is Function ? Function.apply(result, parameters) : result; + } + return Util.unwrapIfClosure(defaultCallback); + } + static dynamic _callClass(Container container, String target, List parameters, String? defaultMethod) { var segments = target.split('@'); @@ -50,8 +116,11 @@ class BoundMethod { if (container.bound(instance)) { return container.make(instance); } - throw BindingResolutionException( - 'Failed to resolve class or function: $className'); + // If it's not bound, treat it as a string value + return instance; + } + if (instance is Function && method == '__invoke') { + return Function.apply(instance, parameters); } return _callBoundMethod(container, [instance, method], () { throw BindingResolutionException( @@ -59,46 +128,17 @@ class BoundMethod { }, parameters); } - static dynamic _callBoundMethod( - Container container, dynamic callback, Function defaultCallback, - [List parameters = const []]) { - if (callback is List && callback.length == 2) { - var instance = callback[0]; - var method = callback[1]; - if (instance is String) { - instance = container.make(instance); - } - if (method is String) { - if (instance is Function && method == '__invoke') { - return Function.apply(instance, parameters); + static Function? _findGlobalMethod(String methodName) { + var currentMirror = currentMirrorSystem(); + for (var library in currentMirror.libraries.values) { + if (library.declarations.containsKey(Symbol(methodName))) { + var declaration = library.declarations[Symbol(methodName)]!; + if (declaration is MethodMirror && declaration.isTopLevel) { + return library.getField(Symbol(methodName)).reflectee as Function; } - var instanceMirror = reflect(instance); - var methodSymbol = Symbol(method); - if (instanceMirror.type.instanceMembers.containsKey(methodSymbol)) { - var dependencies = - _getMethodDependencies(container, instance, method, parameters); - return Function.apply( - instanceMirror.getField(methodSymbol).reflectee, dependencies); - } else { - throw BindingResolutionException( - 'Method $method not found on ${instance.runtimeType}'); - } - } else if (method is Function) { - return method(instance); } - } else if (callback is Function) { - var dependencies = - _getMethodDependencies(container, callback, null, parameters); - return Function.apply(callback, dependencies); } - return Util.unwrapIfClosure(defaultCallback); - } - - static dynamic _resolveInstance(Container container, dynamic instance) { - if (instance is String) { - return container.make(instance); - } - return instance; + return null; } static List _getMethodDependencies(Container container, dynamic instance, @@ -111,6 +151,11 @@ class BoundMethod { _addDependencyForCallParameter( container, parameter, parameters, dependencies); } + } else if (instance is Map && + method is String && + instance.containsKey(method)) { + // If instance is a Map and method is a key, return the value + return [instance[method]]; } else { // If we couldn't get a reflector, just return the original parameters return parameters; @@ -119,6 +164,13 @@ class BoundMethod { return dependencies; } + static dynamic _resolveInstance(Container container, dynamic instance) { + if (instance is String) { + return container.make(instance); + } + return instance; + } + static bool _hasInvokeMethod(String className) { ClassMirror? classMirror = _getClassMirror(className); return classMirror?.declarations[Symbol('__invoke')] != null; diff --git a/packages/ioc_container/lib/src/container.dart b/incubation/ioc_container/lib/src/container.dart similarity index 99% rename from packages/ioc_container/lib/src/container.dart rename to incubation/ioc_container/lib/src/container.dart index 8421c35..3fc1b3b 100644 --- a/packages/ioc_container/lib/src/container.dart +++ b/incubation/ioc_container/lib/src/container.dart @@ -642,10 +642,6 @@ class Container implements ContainerContract { fireAfterResolvingAttributeCallbacks(classAttributes, instance); _fireAfterResolvingCallbacks(concrete, instance); - // Apply after resolving callbacks - fireAfterResolvingAttributeCallbacks(classAttributes, instance); - _fireAfterResolvingCallbacks(concrete, instance); - // Apply extenders after all callbacks for (var extender in _getExtenders(concrete)) { instance = extender(instance); diff --git a/packages/ioc_container/lib/src/contextual_binding_builder.dart b/incubation/ioc_container/lib/src/contextual_binding_builder.dart similarity index 100% rename from packages/ioc_container/lib/src/contextual_binding_builder.dart rename to incubation/ioc_container/lib/src/contextual_binding_builder.dart diff --git a/packages/ioc_container/lib/src/entry_not_found_exception.dart b/incubation/ioc_container/lib/src/entry_not_found_exception.dart similarity index 100% rename from packages/ioc_container/lib/src/entry_not_found_exception.dart rename to incubation/ioc_container/lib/src/entry_not_found_exception.dart diff --git a/packages/ioc_container/lib/src/rewindable_generator.dart b/incubation/ioc_container/lib/src/rewindable_generator.dart similarity index 100% rename from packages/ioc_container/lib/src/rewindable_generator.dart rename to incubation/ioc_container/lib/src/rewindable_generator.dart diff --git a/packages/ioc_container/lib/src/util.dart b/incubation/ioc_container/lib/src/util.dart similarity index 100% rename from packages/ioc_container/lib/src/util.dart rename to incubation/ioc_container/lib/src/util.dart diff --git a/packages/ioc_container/pubspec.yaml b/incubation/ioc_container/pubspec.yaml similarity index 96% rename from packages/ioc_container/pubspec.yaml rename to incubation/ioc_container/pubspec.yaml index 4b97b25..2330142 100644 --- a/packages/ioc_container/pubspec.yaml +++ b/incubation/ioc_container/pubspec.yaml @@ -16,5 +16,6 @@ dependencies: dev_dependencies: lints: ^3.0.0 + mockito: ^5.4.0 test: ^1.24.0 platform_config: ^0.1.0 diff --git a/packages/ioc_container/test/after_resolving_attribute_callback_test.dart b/incubation/ioc_container/test/after_resolving_attribute_callback_test.dart similarity index 100% rename from packages/ioc_container/test/after_resolving_attribute_callback_test.dart rename to incubation/ioc_container/test/after_resolving_attribute_callback_test.dart diff --git a/incubation/ioc_container/test/bound_method_test.dart b/incubation/ioc_container/test/bound_method_test.dart new file mode 100644 index 0000000..9d44066 --- /dev/null +++ b/incubation/ioc_container/test/bound_method_test.dart @@ -0,0 +1,163 @@ +import 'package:test/test.dart'; +import 'package:mockito/mockito.dart'; +import 'package:ioc_container/container.dart'; +import 'package:platform_contracts/contracts.dart'; + +class MockContainer extends Mock implements Container {} + +class TestClass { + String testMethod(String param) => 'Test: $param'; + static String staticMethod(String param) => 'Static: $param'; + String __invoke(String param) => 'Invoke: $param'; +} + +class DependencyClass { + final String value; + DependencyClass(this.value); +} + +class ClassWithDependency { + String methodWithDependency(DependencyClass dep, String param) => + '${dep.value}: $param'; +} + +class NestedDependency { + final DependencyClass dep; + NestedDependency(this.dep); + String nestedMethod(String param) => '${dep.value} nested: $param'; +} + +class ClassWithOptionalParam { + String methodWithOptional(String required, [String optional = 'default']) => + '$required - $optional'; +} + +void main() { + group('Container.call', () { + late MockContainer container; + + setUp(() { + container = MockContainer(); + }); + + test('call with Function', () { + var result = container.call((String s) => 'Hello $s', ['World']); + expect(result, equals('Hello World')); + }); + + test('call with class@method string', () { + when(container.make('TestClass')).thenReturn(TestClass()); + var result = container.call('TestClass@testMethod', ['World']); + expect(result, equals('Test: World')); + }); + + test('call with List callback', () { + when(container.make('TestClass')).thenReturn(TestClass()); + var result = container.call(['TestClass', 'testMethod'], ['World']); + expect(result, equals('Test: World')); + }); + + test('call with static method', () { + when(container.make('TestClass')).thenReturn(TestClass); + var result = container.call(['TestClass', 'staticMethod'], ['World']); + expect(result, equals('Static: World')); + }); + + test('call with Map instance and method key', () { + var mapInstance = {'testMethod': (String s) => 'Map: $s'}; + when(container.make('TestMap')).thenReturn(mapInstance); + var result = container.call(['TestMap', 'testMethod'], ['World']); + expect(result, equals('Map: World')); + }); + + test('call with global function', () { + when(container.make('globalFunction')).thenReturn(globalFunction); + var result = container.call('globalFunction', ['World']); + expect(result, equals('Global: World')); + }); + + test('call with default method', () { + when(container.make('TestClass')).thenReturn(TestClass()); + var result = container.call('TestClass', ['World'], '__invoke'); + expect(result, equals('Invoke: World')); + }); + + test('call with __invoke method', () { + when(container.make('TestClass')).thenReturn(TestClass()); + var result = container.call('TestClass', ['World']); + expect(result, equals('Invoke: World')); + }); + + test('call with non-existent method throws BindingResolutionException', () { + when(container.make('TestClass')).thenReturn(TestClass()); + expect(() => container.call('TestClass@nonExistentMethod', ['World']), + throwsA(isA())); + }); + + test('call with invalid callback type throws ArgumentError', () { + expect( + () => container.call(123, ['World']), throwsA(isA())); + }); + + test('call method with dependencies', () { + when(container.make('ClassWithDependency')) + .thenReturn(ClassWithDependency()); + when(container.make('DependencyClass')) + .thenReturn(DependencyClass('Dependency')); + var result = container + .call(['ClassWithDependency', 'methodWithDependency'], ['World']); + expect(result, equals('Dependency: World')); + }); + + test('call method with overridden dependency', () { + when(container.make('ClassWithDependency')) + .thenReturn(ClassWithDependency()); + when(container.make('DependencyClass')) + .thenReturn(DependencyClass('Dependency')); + var result = container.call( + ['ClassWithDependency', 'methodWithDependency'], + [DependencyClass('Override'), 'World']); + expect(result, equals('Override: World')); + }); + + test('call method with nested dependency', () { + when(container.make('NestedDependency')) + .thenReturn(NestedDependency(DependencyClass('NestedDep'))); + var result = + container.call(['NestedDependency', 'nestedMethod'], ['World']); + expect(result, equals('NestedDep nested: World')); + }); + + test('call method with optional parameter - provided', () { + when(container.make('ClassWithOptionalParam')) + .thenReturn(ClassWithOptionalParam()); + var result = container.call( + ['ClassWithOptionalParam', 'methodWithOptional'], + ['Required', 'Provided']); + expect(result, equals('Required - Provided')); + }); + + test('call method with optional parameter - default', () { + when(container.make('ClassWithOptionalParam')) + .thenReturn(ClassWithOptionalParam()); + var result = container + .call(['ClassWithOptionalParam', 'methodWithOptional'], ['Required']); + expect(result, equals('Required - default')); + }); + + test( + 'call method with missing required dependency throws BindingResolutionException', + () { + when(container.make('ClassWithDependency')) + .thenReturn(ClassWithDependency()); + when(container.make('DependencyClass')) + .thenThrow(BindingResolutionException('DependencyClass not found')); + expect( + () => container + .call(['ClassWithDependency', 'methodWithDependency'], ['World']), + throwsA(isA())); + }); + }); +} + +String globalFunction(String param) => 'Global: $param'; diff --git a/packages/ioc_container/test/container_call_test.dart b/incubation/ioc_container/test/container_call_test.dart similarity index 100% rename from packages/ioc_container/test/container_call_test.dart rename to incubation/ioc_container/test/container_call_test.dart diff --git a/packages/ioc_container/test/container_extend_test.dart b/incubation/ioc_container/test/container_extend_test.dart similarity index 100% rename from packages/ioc_container/test/container_extend_test.dart rename to incubation/ioc_container/test/container_extend_test.dart diff --git a/packages/ioc_container/test/container_resolve_non_instantiable_test.dart b/incubation/ioc_container/test/container_resolve_non_instantiable_test.dart similarity index 100% rename from packages/ioc_container/test/container_resolve_non_instantiable_test.dart rename to incubation/ioc_container/test/container_resolve_non_instantiable_test.dart diff --git a/packages/ioc_container/test/container_tagging_test.dart b/incubation/ioc_container/test/container_tagging_test.dart similarity index 100% rename from packages/ioc_container/test/container_tagging_test.dart rename to incubation/ioc_container/test/container_tagging_test.dart diff --git a/packages/ioc_container/test/container_test.dart b/incubation/ioc_container/test/container_test.dart similarity index 100% rename from packages/ioc_container/test/container_test.dart rename to incubation/ioc_container/test/container_test.dart diff --git a/packages/ioc_container/test/contextual_attribute_binding_test.dart b/incubation/ioc_container/test/contextual_attribute_binding_test.dart similarity index 100% rename from packages/ioc_container/test/contextual_attribute_binding_test.dart rename to incubation/ioc_container/test/contextual_attribute_binding_test.dart diff --git a/packages/ioc_container/test/contextual_binding_test.dart b/incubation/ioc_container/test/contextual_binding_test.dart similarity index 100% rename from packages/ioc_container/test/contextual_binding_test.dart rename to incubation/ioc_container/test/contextual_binding_test.dart diff --git a/packages/ioc_container/test/resolving_callback_test.dart b/incubation/ioc_container/test/resolving_callback_test.dart similarity index 100% rename from packages/ioc_container/test/resolving_callback_test.dart rename to incubation/ioc_container/test/resolving_callback_test.dart diff --git a/packages/ioc_container/test/rewindable_generator_test.dart b/incubation/ioc_container/test/rewindable_generator_test.dart similarity index 100% rename from packages/ioc_container/test/rewindable_generator_test.dart rename to incubation/ioc_container/test/rewindable_generator_test.dart diff --git a/packages/ioc_container/test/util_test.dart b/incubation/ioc_container/test/util_test.dart similarity index 100% rename from packages/ioc_container/test/util_test.dart rename to incubation/ioc_container/test/util_test.dart diff --git a/packages/service_container/.gitignore b/incubation/service_container/.gitignore similarity index 100% rename from packages/service_container/.gitignore rename to incubation/service_container/.gitignore diff --git a/packages/service_container/CHANGELOG.md b/incubation/service_container/CHANGELOG.md similarity index 100% rename from packages/service_container/CHANGELOG.md rename to incubation/service_container/CHANGELOG.md diff --git a/packages/service_container/LICENSE.md b/incubation/service_container/LICENSE.md similarity index 100% rename from packages/service_container/LICENSE.md rename to incubation/service_container/LICENSE.md diff --git a/packages/service_container/README.md b/incubation/service_container/README.md similarity index 100% rename from packages/service_container/README.md rename to incubation/service_container/README.md diff --git a/packages/service_container/analysis_options.yaml b/incubation/service_container/analysis_options.yaml similarity index 100% rename from packages/service_container/analysis_options.yaml rename to incubation/service_container/analysis_options.yaml diff --git a/packages/service_container/doc/.gitkeep b/incubation/service_container/doc/.gitkeep similarity index 100% rename from packages/service_container/doc/.gitkeep rename to incubation/service_container/doc/.gitkeep diff --git a/packages/service_container/example/.gitkeep b/incubation/service_container/example/.gitkeep similarity index 100% rename from packages/service_container/example/.gitkeep rename to incubation/service_container/example/.gitkeep diff --git a/packages/service_container/lib/service_container.dart b/incubation/service_container/lib/service_container.dart similarity index 100% rename from packages/service_container/lib/service_container.dart rename to incubation/service_container/lib/service_container.dart diff --git a/packages/service_container/lib/src/bound_method.dart b/incubation/service_container/lib/src/bound_method.dart similarity index 100% rename from packages/service_container/lib/src/bound_method.dart rename to incubation/service_container/lib/src/bound_method.dart diff --git a/packages/service_container/lib/src/container.dart b/incubation/service_container/lib/src/container.dart similarity index 100% rename from packages/service_container/lib/src/container.dart rename to incubation/service_container/lib/src/container.dart diff --git a/packages/service_container/lib/src/contextual_binding_builder.dart b/incubation/service_container/lib/src/contextual_binding_builder.dart similarity index 100% rename from packages/service_container/lib/src/contextual_binding_builder.dart rename to incubation/service_container/lib/src/contextual_binding_builder.dart diff --git a/packages/service_container/lib/src/entry_not_found_exception.dart b/incubation/service_container/lib/src/entry_not_found_exception.dart similarity index 100% rename from packages/service_container/lib/src/entry_not_found_exception.dart rename to incubation/service_container/lib/src/entry_not_found_exception.dart diff --git a/packages/service_container/lib/src/rewindable_generator.dart b/incubation/service_container/lib/src/rewindable_generator.dart similarity index 100% rename from packages/service_container/lib/src/rewindable_generator.dart rename to incubation/service_container/lib/src/rewindable_generator.dart diff --git a/packages/service_container/lib/src/util.dart b/incubation/service_container/lib/src/util.dart similarity index 100% rename from packages/service_container/lib/src/util.dart rename to incubation/service_container/lib/src/util.dart diff --git a/packages/service_container/pubspec.yaml b/incubation/service_container/pubspec.yaml similarity index 100% rename from packages/service_container/pubspec.yaml rename to incubation/service_container/pubspec.yaml diff --git a/packages/service_container/test/after_resolving_attribute_callback_test.dart b/incubation/service_container/test/after_resolving_attribute_callback_test.dart similarity index 100% rename from packages/service_container/test/after_resolving_attribute_callback_test.dart rename to incubation/service_container/test/after_resolving_attribute_callback_test.dart diff --git a/packages/service_container/test/container_call_test.dart b/incubation/service_container/test/container_call_test.dart similarity index 100% rename from packages/service_container/test/container_call_test.dart rename to incubation/service_container/test/container_call_test.dart diff --git a/packages/service_container/test/container_extend_test.dart b/incubation/service_container/test/container_extend_test.dart similarity index 100% rename from packages/service_container/test/container_extend_test.dart rename to incubation/service_container/test/container_extend_test.dart diff --git a/packages/service_container/test/container_resolve_non_instantiable_test.dart b/incubation/service_container/test/container_resolve_non_instantiable_test.dart similarity index 100% rename from packages/service_container/test/container_resolve_non_instantiable_test.dart rename to incubation/service_container/test/container_resolve_non_instantiable_test.dart diff --git a/packages/service_container/test/container_tagging_test.dart b/incubation/service_container/test/container_tagging_test.dart similarity index 100% rename from packages/service_container/test/container_tagging_test.dart rename to incubation/service_container/test/container_tagging_test.dart diff --git a/packages/service_container/test/container_test.dart b/incubation/service_container/test/container_test.dart similarity index 100% rename from packages/service_container/test/container_test.dart rename to incubation/service_container/test/container_test.dart diff --git a/packages/service_container/test/contextual_attribute_binding_test.dart b/incubation/service_container/test/contextual_attribute_binding_test.dart similarity index 100% rename from packages/service_container/test/contextual_attribute_binding_test.dart rename to incubation/service_container/test/contextual_attribute_binding_test.dart diff --git a/packages/service_container/test/contextual_binding_test.dart b/incubation/service_container/test/contextual_binding_test.dart similarity index 100% rename from packages/service_container/test/contextual_binding_test.dart rename to incubation/service_container/test/contextual_binding_test.dart diff --git a/packages/service_container/test/resolving_callback_test.dart b/incubation/service_container/test/resolving_callback_test.dart similarity index 100% rename from packages/service_container/test/resolving_callback_test.dart rename to incubation/service_container/test/resolving_callback_test.dart diff --git a/packages/service_container/test/rewindable_generator_test.dart b/incubation/service_container/test/rewindable_generator_test.dart similarity index 100% rename from packages/service_container/test/rewindable_generator_test.dart rename to incubation/service_container/test/rewindable_generator_test.dart diff --git a/packages/service_container/test/util_test.dart b/incubation/service_container/test/util_test.dart similarity index 100% rename from packages/service_container/test/util_test.dart rename to incubation/service_container/test/util_test.dart