Skip to content

Tags: scribd/Weaver

Tags

1.1.7

Toggle 1.1.7's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Allow tests to initialize non-stubbed dependencies

Add flag `allow-tests-to-init-real-dependencies` that will force all dependency resolver methods to be declared as `internal` rather than `private` or `fileprivate` so that any `@Testable import` of the generated code is able to initialize both the dependency container and access all of the DependencyResolvers. Note that this does **NOT** change any of the test mock generation, this is altering the access level of the **real** dependencies to be able to facilitate customization of test dependencies. It is then possible to mix and match real and mocked dependencies based on your test setup. Previously this was not possible because the MainDependencyContainer initializer was private, along with all of the dependency resolvers. Without setting this flag, there is no impact to code generation so this change is fully backward compatible.

For example, now inside of unit tests for some `CoolSampleApp` , you would be able to do this:
```
@testable import CoolSampleApp
class ExampleTests: XCTestCase {
  func testExample() {
    let realDependencyContainer = MainDependencyContainer()
    let realDependency = realDependencyContainer.specificDependencyResolver().specificDependency
    // Test code that actually uses the real dependency
  }
}
```

It is still possible to use the `tests` flag to generate stubbed dependencies and use those alongside each other. For example, you can now mix and match real and mocked dependencies for a class under test to be able to do integration or feature level tests. Continuing the `textExample()` from above, you may see something like this:

```
  func testExample() {
    let realDependencyContainer = MainDependencyContainer()
    let realDependencyFoo = realDependencyContainer.dependencyFooResolver().dependencyFoo

    let mockedDependencyContainer = StubbedDependencies()
    let mockedDependencyBar = StubbedDependencies.dependencyBarDouble

    let objectUnderTest = SomeClass(foo: realDependencyFoo, bar: mockedDependencyBar)
    // Actual test logic and validation
  }
```

Also update dependencies and tools versions in the package so that it can compile with modern tool chains (Xcode 16.x, Swift 5).

1.1.6

Toggle 1.1.6's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Merge pull request #183 from rjchrhl/rjc-mainactor

Swift Concurrency Part 4 - Weaver --mainactor (command line option)

list

Toggle list's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Merge pull request #183 from rjchrhl/rjc-mainactor

Swift Concurrency Part 4 - Weaver --mainactor (command line option)

1.1.5

Toggle 1.1.5's commit message
Added new .project parameter to specify dependencies by arbitrary pro…

…ject name

1.1.4

Toggle 1.1.4's commit message
Fixes a bug where the .platforms annotation was not always being resp…

…ected. Fixed a bug with the command line parameter project-path not being applied to the output directories in the yaml file.

1.1.3

Toggle 1.1.3's commit message
Added new parameter product_name, and a prefix to the @objc container…

… name

1.1.2

Toggle 1.1.2's commit message
Fixes a bug with nested declarations that include parameters and have…

… an InternalDependencyResolver.

1.1.1

Toggle 1.1.1's commit message
Fixes a bug with nested declarations that include parameters and have…

… an InternalDependencyResolver.

1.1.0

Toggle 1.1.0's commit message
Weaver 1.1.x adopts a new memory pattern in the dependency container …

…from the original 1.0.0 design. It now relies on a private copied class object instead of weak referencing up the tree.

1.0.9

Toggle 1.0.9's commit message
Add support for classes defined in a nested scope. Dependency contain…

…ers will be typealiased in the same scope as the class for consistent naming references. Also adds a fix for a bug where injected parameters weren't always available down the tree.