From 5a7a3c3541ef4560013d460d73f36f9159c6114b Mon Sep 17 00:00:00 2001 From: Marcin Iwanicki Date: Sun, 4 Aug 2024 11:01:01 +0100 Subject: [PATCH 1/2] Update README --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 37e2518..a06c427 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,11 @@ A project focused on simple, small, and reusable Swift components. It was created to support command line tools in [Mobile Infra](https://github.com/mobileinf). -## Alternatives +## `SCInject` + +A minimalisic and efficient dependency injection (DI) container. It aims to simplify the management of dependencies by providing a streamlined and intuitive API for registering and resolving components. + +### Alternatives - [Swinject](https://github.com/Swinject/Swinject) - [Factory](https://github.com/hmlongco/Factory) From be2a32c1e4e0eb45696b056d5da21653f53e2d8c Mon Sep 17 00:00:00 2001 From: Marcin Iwanicki Date: Sun, 4 Aug 2024 20:31:41 +0100 Subject: [PATCH 2/2] Add header template --- .../xcshareddata/IDETemplateMacros.plist | 22 ++++++++++++++ Sources/SCInject/Assembler.swift | 30 +++++++++---------- Sources/SCInject/Assembly.swift | 30 +++++++++---------- Sources/SCInject/Container.swift | 30 +++++++++---------- Sources/SCInject/RegisterName.swift | 30 +++++++++---------- Sources/SCInject/Registry.swift | 30 +++++++++---------- Sources/SCInject/Resolver.swift | 30 +++++++++---------- Sources/SCInject/Scope.swift | 30 +++++++++---------- Tests/SCInject/ContainerTests.swift | 30 +++++++++---------- Tests/SCInject/TestUtils/Stubs.swift | 30 +++++++++---------- 10 files changed, 157 insertions(+), 135 deletions(-) create mode 100644 .swiftpm/xcode/package.xcworkspace/xcshareddata/IDETemplateMacros.plist diff --git a/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDETemplateMacros.plist b/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDETemplateMacros.plist new file mode 100644 index 0000000..60348d1 --- /dev/null +++ b/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDETemplateMacros.plist @@ -0,0 +1,22 @@ + + + + + FILEHEADER + +// Copyright 2024 Marcin Iwanicki and contributors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + + diff --git a/Sources/SCInject/Assembler.swift b/Sources/SCInject/Assembler.swift index 94140e4..04a6bf5 100644 --- a/Sources/SCInject/Assembler.swift +++ b/Sources/SCInject/Assembler.swift @@ -1,18 +1,18 @@ -/* - * Copyright 2024 Marcin Iwanicki and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// +// Copyright 2024 Marcin Iwanicki and contributors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// import Foundation diff --git a/Sources/SCInject/Assembly.swift b/Sources/SCInject/Assembly.swift index b5150d7..8d265ea 100644 --- a/Sources/SCInject/Assembly.swift +++ b/Sources/SCInject/Assembly.swift @@ -1,18 +1,18 @@ -/* - * Copyright 2024 Marcin Iwanicki and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// +// Copyright 2024 Marcin Iwanicki and contributors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// import Foundation diff --git a/Sources/SCInject/Container.swift b/Sources/SCInject/Container.swift index a50ede8..6da7ccc 100644 --- a/Sources/SCInject/Container.swift +++ b/Sources/SCInject/Container.swift @@ -1,18 +1,18 @@ -/* - * Copyright 2024 Marcin Iwanicki and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// +// Copyright 2024 Marcin Iwanicki and contributors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// import Foundation diff --git a/Sources/SCInject/RegisterName.swift b/Sources/SCInject/RegisterName.swift index b355b04..cbdc61a 100644 --- a/Sources/SCInject/RegisterName.swift +++ b/Sources/SCInject/RegisterName.swift @@ -1,18 +1,18 @@ -/* - * Copyright 2024 Marcin Iwanicki and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// +// Copyright 2024 Marcin Iwanicki and contributors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// import Foundation diff --git a/Sources/SCInject/Registry.swift b/Sources/SCInject/Registry.swift index e080e16..4b2b6c3 100644 --- a/Sources/SCInject/Registry.swift +++ b/Sources/SCInject/Registry.swift @@ -1,18 +1,18 @@ -/* - * Copyright 2024 Marcin Iwanicki and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// +// Copyright 2024 Marcin Iwanicki and contributors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// import Foundation diff --git a/Sources/SCInject/Resolver.swift b/Sources/SCInject/Resolver.swift index 2f6cf2e..70e2d8f 100644 --- a/Sources/SCInject/Resolver.swift +++ b/Sources/SCInject/Resolver.swift @@ -1,18 +1,18 @@ -/* - * Copyright 2024 Marcin Iwanicki and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// +// Copyright 2024 Marcin Iwanicki and contributors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// import Foundation diff --git a/Sources/SCInject/Scope.swift b/Sources/SCInject/Scope.swift index ad33092..f40787a 100644 --- a/Sources/SCInject/Scope.swift +++ b/Sources/SCInject/Scope.swift @@ -1,18 +1,18 @@ -/* - * Copyright 2024 Marcin Iwanicki and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// +// Copyright 2024 Marcin Iwanicki and contributors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// public enum Scope { case transient diff --git a/Tests/SCInject/ContainerTests.swift b/Tests/SCInject/ContainerTests.swift index b6d949b..74d5e37 100644 --- a/Tests/SCInject/ContainerTests.swift +++ b/Tests/SCInject/ContainerTests.swift @@ -1,18 +1,18 @@ -/* - * Copyright 2024 Marcin Iwanicki and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// +// Copyright 2024 Marcin Iwanicki and contributors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// import Foundation @testable import SCInject diff --git a/Tests/SCInject/TestUtils/Stubs.swift b/Tests/SCInject/TestUtils/Stubs.swift index 177ff20..838de34 100644 --- a/Tests/SCInject/TestUtils/Stubs.swift +++ b/Tests/SCInject/TestUtils/Stubs.swift @@ -1,18 +1,18 @@ -/* - * Copyright 2024 Marcin Iwanicki and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// +// Copyright 2024 Marcin Iwanicki and contributors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// import Foundation