diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..7fe840d --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,25 @@ +# *Name of the PR* + +## :recycle: Current situation +*Describe the current situation (if possible with and exemplary (or real) code snippet and/or where this is used)* + +## :bulb: Proposed solution +*Describe the solution (if possible with and exemplary (or real) code snippet)* + +### Problem that is solved +*Provide a description and link issues that are solved* + +### Implications +*Describe the implications, e.g. refactoring* + +## :heavy_plus_sign: Additional Information +*Provide some additional information if possible* + +### Related PRs +*Reference the related PRs* + +### Testing +*Are there tests included? If yes, which situations are tested and which corner cases are missing?* + +### Reviewer Nudging +*Where should the reviewer start, where is a good entry point?* diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..b20e968 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,20 @@ +branches: [release] +name-template: '$NEXT_PATCH_VERSION' +tag-template: '$NEXT_PATCH_VERSION' +categories: + - title: '🚀 Features' + labels: + - 'feature' + - 'enhancement' + - title: '🐛 Bug Fixes' + labels: + - 'fix' + - 'bugfix' + - 'bug' + - title: '🧰 Maintenance' + label: 'chore' +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' +template: | + ## Changes + + $CHANGES diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 0000000..80513fb --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,90 @@ +name: Build and Test + +on: + push: + branches: + - develop + - release + pull_request: + branches: + - develop + - release + workflow_dispatch: + +jobs: + latest-beta-swift-version: + name: Latest (Beta) Swift Version + runs-on: macos-11 + steps: + - uses: actions/checkout@v2 + - uses: maxim-lobanov/setup-xcode@v1.2.3 + with: + xcode-version: latest + - uses: actions/cache@v2 + with: + path: .build + key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} + - name: Check Xcode version + run: xcodebuild -version + - name: Check Swift version + run: swift --version + - name: Debug Build & Test + run: swift test + macos: + name: macOS ${{ matrix.configuration }} + runs-on: macos-11 + strategy: + fail-fast: false + matrix: + configuration: [debug, release, release_testing] + steps: + - uses: actions/checkout@v2 + - uses: maxim-lobanov/setup-xcode@v1.2.3 + with: + xcode-version: latest-stable + - uses: actions/cache@v2 + with: + path: .build + key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} + - name: Check Xcode version + run: xcodebuild -version + - name: Check Swift version + run: swift --version + - name: Release Build + if: matrix.configuration == 'release' + run: swift build -c release + - name: Release Build & Test + if: matrix.configuration == 'release_testing' + run: swift test -c release -Xswiftc -enable-testing -Xswiftc -DRELEASE_TESTING + - name: Debug Build & Test + if: matrix.configuration == 'debug' + run: swift test -c debug --enable-code-coverage -Xswiftc -DCOVERAGE + - name: Convert coverage report + if: matrix.configuration == 'debug' + run: xcrun llvm-cov export -format="lcov" .build/debug/ApodiniTemplatePackageTests.xctest/Contents/MacOS/ApodiniTemplatePackageTests -instr-profile .build/debug/codecov/default.profdata > coverage.lcov + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + linux: + name: Linux ${{ matrix.linux }} ${{ matrix.configuration }} + container: + image: swift:${{ matrix.linux }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + linux: [bionic, xenial, focal, amazonlinux2, centos8] + configuration: [debug, release] + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: .build + key: ${{ runner.os }}-${{matrix.linux}}-spm-${{ hashFiles('Package.resolved') }} + - name: Check Swift version + run: swift --version + - name: Release Build + if: matrix.configuration == 'release' + run: swift build -c release + - name: Debug Build & Test + if: matrix.configuration == 'debug' + run: swift test -c debug diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..a241ab6 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,27 @@ +name: Publish Documentation + +on: + release: + types: [published] + +jobs: + deploy_docs: + runs-on: macos-11 + steps: + - uses: actions/checkout@v2 + - uses: maxim-lobanov/setup-xcode@v1.2.3 + with: + xcode-version: latest + - uses: actions/cache@v2 + with: + path: .build + key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} + - name: Check Xcode version + run: xcodebuild -version + - name: Check Swift version + run: swift --version + - name: Publish Jazzy Docs + uses: steven0351/publish-jazzy-docs@v1 + with: + personal_access_token: ${{ secrets.ACCESS_TOKEN }} + config: .jazzy.yml diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 0000000..bc6ee09 --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,14 @@ +name: Release Drafter + +on: + push: + branches: + - release + +jobs: + update_release_draft: + runs-on: ubuntu-latest + steps: + - uses: release-drafter/release-drafter@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e0f9849 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,15 @@ +name: Create Release + +on: + push: + tags: + - '*.*.*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: GH Release + uses: softprops/action-gh-release@v0.1.5 + env: + GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} diff --git a/.github/workflows/spm-update.yml b/.github/workflows/spm-update.yml new file mode 100644 index 0000000..a3b2fd5 --- /dev/null +++ b/.github/workflows/spm-update.yml @@ -0,0 +1,29 @@ +name: Swift Package Update + +on: + schedule: + - cron: '0 0 * * 1' + workflow_dispatch: + +jobs: + createPR: + name: Create Pull Request + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Check Swift version + run: swift --version + - name: Update Swift Packages + run: swift package update + - uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.ACCESS_TOKEN }} + commit-message: Update dependencies + title: Update dependencies + body: Update the Swift Package dependencies. + delete-branch: true + base: develop + branch: bots/update-dependencies + assignees: PSchmiedmayer + committer: PSchmiedmayer + author: PSchmiedmayer diff --git a/.github/workflows/swiftlint.yml b/.github/workflows/swiftlint.yml new file mode 100644 index 0000000..717a773 --- /dev/null +++ b/.github/workflows/swiftlint.yml @@ -0,0 +1,21 @@ +name: SwiftLint + +on: + pull_request: + paths: + - '.github/workflows/swiftlint.yml' + - '.swiftlint.yml' + - '**/*.swift' + +jobs: + swiftlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: GitHub Action for SwiftLint + uses: norio-nomura/action-swiftlint@3.1.0 + with: + args: --strict + env: + DIFF_BASE: ${{ github.base_ref }} + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b8a6400 --- /dev/null +++ b/.gitignore @@ -0,0 +1,19 @@ +# Apodini .gitignore File + +# Swift Package Manager +Package.resolved +*.xcodeproj +.swiftpm +.build/ + +# Xcode User settings +xcuserdata/ + +# Other files +.DS_Store + +# Fastlane +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots/**/*.png +fastlane/test_output \ No newline at end of file diff --git a/.jazzy.yml b/.jazzy.yml new file mode 100644 index 0000000..3b037f1 --- /dev/null +++ b/.jazzy.yml @@ -0,0 +1,7 @@ +module: ApodiniTemplate +author: Paul Schmiedmayer +theme: fullwidth +output: ./docs +documentation: ./*.md +author_url: https://github.com/Apodini +github_url: https://github.com/Apodini/ApodiniTemplate diff --git a/.swiftlint.yml b/.swiftlint.yml new file mode 100644 index 0000000..d35f42c --- /dev/null +++ b/.swiftlint.yml @@ -0,0 +1,389 @@ +# Apodini SwiftLint file Apodini + +# The whitelist_rules configuration also includes rules that are enabled by default to provide a good overview of all rules. +only_rules: + - attributes + - anyobject_protocol + # Prefer using AnyObject over class for class-only protocols. + - array_init + # Prefer using Array(seq) over seq.map { $0 } to convert a sequence into an Array. + - block_based_kvo + # Prefer the new block based KVO API with keypaths when using Swift 3.2 or later. + - class_delegate_protocol + # Delegate protocols should be class-only so they can be weakly referenced. + - closing_brace + # Closing brace with closing parenthesis should not have any whitespaces in the middle. + - closure_body_length + # Closure bodies should not span too many lines. + - closure_end_indentation + # Closure end should have the same indentation as the line that started it. + - closure_parameter_position + # Closure parameters should be on the same line as opening brace. + - closure_spacing + # Closure expressions should have a single space inside each brace. + - collection_alignment + # All elements in a collection literal should be vertically aligned + - colon + # Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. + - comma + # There should be no space before and one after any comma. + - compiler_protocol_init + # The initializers declared in compiler protocols such as ExpressibleByArrayLiteral shouldn't be called directly. + - computed_accessors_order + # Getter and setters in computed properties and subscripts should be in a consistent order. + - conditional_returns_on_newline + # Conditional statements should always return on the next line + - contains_over_filter_count + # Prefer contains over comparing filter(where:).count to 0. + - contains_over_filter_is_empty + # Prefer contains over using filter(where:).isEmpty + - contains_over_first_not_nil + # Prefer `contains` over `first(where:) != nil` + - contains_over_range_nil_comparison + # Prefer contains over range(of:) != nil and range(of:) == nil + - control_statement + # if, for, guard, switch, while, and catch statements shouldn't unnecessarily wrap their conditionals or arguments in parentheses. + - convenience_type + # Types used for hosting only static members should be implemented as a caseless enum to avoid instantiation. + - cyclomatic_complexity + # Complexity of function bodies should be limited. + - discarded_notification_center_observer + # When registering for a notification using a block, the opaque observer that is returned should be stored so it can be removed later. + - discouraged_direct_init + # Discouraged direct initialization of types that can be harmful. e.g. UIDevice(), Bundle() + - discouraged_optional_boolean + # Prefer non-optional booleans over optional booleans. + - discouraged_optional_collection + # Prefer empty collection over optional collection. + - duplicate_imports + # Duplicate Imports + - dynamic_inline + # Avoid using 'dynamic' and '@inline(__always)' together. + - empty_collection_literal + # Prefer checking isEmpty over comparing collection to an empty array or dictionary literal. + - empty_count + # Prefer checking `isEmpty` over comparing `count` to zero. + - empty_enum_arguments + # Arguments can be omitted when matching enums with associated types if they are not used. + - empty_parameters + # Prefer () -> over Void ->. + - empty_parentheses_with_trailing_closure + # When using trailing closures, empty parentheses should be avoided after the method call. + - empty_string + # Prefer checking `isEmpty` over comparing string to an empty string literal. + - empty_xctest_method + # Empty XCTest method should be avoided. + - enum_case_associated_values_count + # Number of associated values in an enum case should be low + - explicit_init + # Explicitly calling .init() should be avoided. + - fatal_error_message + # A fatalError call should have a message. + - file_length + # Files should not span too many lines. + # See file_length below for the exact configuration. + - first_where + # Prefer using ``.first(where:)`` over ``.filter { }.first` in collections. + - flatmap_over_map_reduce + # Prefer flatMap over map followed by reduce([], +). + - for_where + # where clauses are preferred over a single if inside a for. + - force_cast + # Force casts should be avoided. + - force_try + # Force tries should be avoided. + - force_unwrapping + # Force unwrapping should be avoided. + - function_body_length + # Functions bodies should not span too many lines. + # See function_body_length below for the exact configuration. + - function_parameter_count + # Number of function parameters should be low. + # See function_parameter_count below for the exact configuration. + - generic_type_name + # Generic type name should only contain alphanumeric characters, start with an uppercase character and span between 1 and 20 characters in length. + - identical_operands + # Comparing two identical operands is likely a mistake. + - identifier_name + # Identifier names should only contain alphanumeric characters and start with a lowercase character or should only contain capital letters. + # In an exception to the above, variable names may start with a capital letter when they are declared static and immutable. + # Variable names should not be too long or too short. Excluded names are listed below. + - implicit_getter + # Computed read-only properties and subscripts should avoid using the get keyword. + - implicit_return + # Prefer implicit returns in closures. + - implicitly_unwrapped_optional + # Implicitly unwrapped optionals should be avoided when possible. + - inclusive_language + # Identifiers should use inclusive language that avoids discrimination against groups of people based on race, gender, or socioeconomic status + - inert_defer + # If defer is at the end of its parent scope, it will be executed right where it is anyway. + - is_disjoint + # Prefer using Set.isDisjoint(with:) over Set.intersection(_:).isEmpty. + - joined_default_parameter + # Discouraged explicit usage of the default separator. + - large_tuple + # Tuples shouldn't have too many members. Create a custom type instead. + # See large_tuple below for the exact configuration. + - last_where + # Prefer using .last(where:) over .filter { }.last in collections. + - leading_whitespace + # Files should not contain leading whitespace. + - legacy_cggeometry_functions + # CGGeometry: Struct extension properties and methods are preferred over legacy functions + - legacy_constant + # Struct-scoped constants are preferred over legacy global constants (CGSize, CGRect, NSPoint, ...). + - legacy_constructor + # Swift constructors are preferred over legacy convenience functions (CGPointMake, CGSizeMake, UIOffsetMake, ...). + - legacy_hashing + # Prefer using the hash(into:) function instead of overriding hashValue + - legacy_multiple + # Prefer using the isMultiple(of:) function instead of using the remainder operator (%). + - legacy_nsgeometry_functions + # Struct extension properties and methods are preferred over legacy functions + - legacy_random + # Prefer using type.random(in:) over legacy functions. + - line_length + # Lines should not span too many characters. + # See line_length below for the exact configuration. + - literal_expression_end_indentation + # Array and dictionary literal end should have the same indentation as the line that started it. + - lower_acl_than_parent + # Ensure definitions have a lower access control level than their enclosing parent + - mark + # MARK comment should be in valid format. e.g. '// MARK: ...' or '// MARK: - ...' + - missing_docs + # Declarations should be documented. + - modifier_order + # Modifier order should be consistent. + - multiline_arguments + # Arguments should be either on the same line, or one per line. + - multiline_function_chains + # Chained function calls should be either on the same line, or one per line. + - multiline_literal_brackets + # Multiline literals should have their surrounding brackets in a new line. + - multiline_parameters + # Functions and methods parameters should be either on the same line, or one per line. + - nesting + # Types and statements should only be nested to a certain level deep. + # See nesting below for the exact configuration. + - nimble_operator + # Prefer Nimble operator overloads over free matcher functions. + - no_fallthrough_only + # Fallthroughs can only be used if the case contains at least one other statement. + - no_space_in_method_call + # Don’t add a space between the method name and the parentheses. + - notification_center_detachment + # An object should only remove itself as an observer in deinit. + - nslocalizedstring_key + # Static strings should be used as key in NSLocalizedString in order to genstrings work. + - nsobject_prefer_isequal + # NSObject subclasses should implement isEqual instead of ==. + - object_literal + # Prefer object literals over image and color inits. + - opening_brace + # Opening braces should be preceded by a single space and on the same line as the declaration. + - operator_usage_whitespace + # Operators should be surrounded by a single whitespace when they are being used. + - operator_whitespace + # Operators should be surrounded by a single whitespace when defining them. + - optional_enum_case_matching + # Matching an enum case against an optional enum without ‘?’ is supported on Swift 5.1 and above. + - orphaned_doc_comment + # A doc comment should be attached to a declaration. + - overridden_super_call + # Some overridden methods should always call super + - pattern_matching_keywords + # Combine multiple pattern matching bindings by moving keywords out of tuples. + - prefer_self_type_over_type_of_self + # Prefer Self over type(of: self) when accessing properties or calling methods. + - private_action + # IBActions should be private. + - private_outlet + # IBOutlets should be private to avoid leaking UIKit to higher layers. + - private_over_fileprivate + # Prefer private over fileprivate declarations. + - private_unit_test + # Unit tests marked private are silently skipped. + - prohibited_super_call + # Some methods should not call super ( + # NSFileProviderExtension: providePlaceholder(at:completionHandler:) + # NSTextInput doCommand(by:) + # NSView updateLayer() + # UIViewController loadView()) + - protocol_property_accessors_order + # When declaring properties in protocols, the order of accessors should be get set. + - reduce_boolean + # Prefer using .allSatisfy() or .contains() over reduce(true) or reduce(false) + - reduce_into + # Prefer reduce(into:_:) over reduce(_:_:) for copy-on-write types + - redundant_discardable_let + # Prefer _ = foo() over let _ = foo() when discarding a result from a function. + - redundant_nil_coalescing + # nil coalescing operator is only evaluated if the lhs is nil, coalescing operator with nil as rhs is redundant + - redundant_objc_attribute + # Objective-C attribute (@objc) is redundant in declaration. + - redundant_optional_initialization + # Initializing an optional variable with nil is redundant. + - redundant_set_access_control + # Property setter access level shouldn't be explicit if it's the same as the variable access level. + - redundant_string_enum_value + # String enum values can be omitted when they are equal to the enumcase name. + - redundant_type_annotation + # Variables should not have redundant type annotation + - redundant_void_return + # Returning Void in a function declaration is redundant. + - return_arrow_whitespace + # Return arrow and return type should be separated by a single space or on a separate line. + - shorthand_operator + # Prefer shorthand operators (+=, -=, *=, /=) over doing the operation and assigning. + - single_test_class + # Test files should contain a single QuickSpec or XCTestCase class. + - sorted_first_last + # Prefer using `min()`` or `max()`` over `sorted().first` or `sorted().last` + - statement_position + # Else and catch should be on the same line, one space after the previous declaration. + - static_operator + # Operators should be declared as static functions, not free functions. + - superfluous_disable_command + # SwiftLint ‘disable’ commands are superfluous when the disabled rule would not have triggered a violation in the disabled region. Use “ - ” if you wish to document a command. + - switch_case_alignment + # Case statements should vertically align with their enclosing switch statement, or indented if configured otherwise. + - syntactic_sugar + # Shorthand syntactic sugar should be used, i.e. [Int] instead of Array. + - todo + # TODOs and FIXMEs should be resolved. + - toggle_bool + # Prefer someBool.toggle() over someBool = !someBool. + - trailing_closure + # Trailing closure syntax should be used whenever possible. + - trailing_comma + # Trailing commas in arrays and dictionaries should be avoided/enforced. + - trailing_newline + # Files should have a single trailing newline. + - trailing_semicolon + # Lines should not have trailing semicolons. + - trailing_whitespace + # Lines should not have trailing whitespace. + # Ignored lines are specified below. + - type_body_length + # Type bodies should not span too many lines. + # See large_tuple below for the exact configuration. + - type_name + # Type name should only contain alphanumeric characters, start with an uppercase character and span between 3 and 40 characters in length. + # Excluded types are listed below. + - unneeded_break_in_switch + # Avoid using unneeded break statements. + - unneeded_parentheses_in_closure_argument + # Parentheses are not needed when declaring closure arguments. + - untyped_error_in_catch + # Catch statements should not declare error variables without type casting. + - unused_capture_list + # Unused reference in a capture list should be removed. + - unused_closure_parameter + # Unused parameter in a closure should be replaced with _. + - unused_control_flow_label + # Unused control flow label should be removed. + - unused_declaration + # Declarations should be referenced at least once within all files linted. + - unused_enumerated + # When the index or the item is not used, .enumerated() can be removed. + - unused_import + # All imported modules should be required to make the file compile. + - unused_optional_binding + # Prefer != nil over let _ = + - unused_setter_value + # Setter value is not used. + - valid_ibinspectable + # @IBInspectable should be applied to variables only, have its type explicit and be of a supported type + - vertical_parameter_alignment + # Function parameters should be aligned vertically if they're in multiple lines in a declaration. + - vertical_parameter_alignment_on_call + # Function parameters should be aligned vertically if they're in multiple lines in a method call. + - vertical_whitespace + # Limit vertical whitespace to a single empty line. + # See vertical_whitespace below for the exact configuration. + - vertical_whitespace_closing_braces + # Don’t include vertical whitespace (empty line) before closing braces. + - vertical_whitespace_opening_braces + # Don’t include vertical whitespace (empty line) after opening braces. + - void_return + # Prefer -> Void over -> (). + - weak_delegate + # Delegates should be weak to avoid reference cycles. + - xctfail_message + # An XCTFail call should include a description of the assertion. + - yoda_condition + # The variable should be placed on the left, the constant on the right of a comparison operator. + +excluded: # paths to ignore during linting. Takes precedence over `included`. + - Carthage + - Pods + - .build + - .swiftpm + - R.generated.swift + +closure_body_length: # Closure bodies should not span too many lines. + - 35 # warning - default: 20 + - 35 # error - default: 100 + +enum_case_associated_values_count: # Number of associated values in an enum case should be low + - 5 # warning - default: 5 + - 5 # error - default: 6 + +file_length: # Files should not span too many lines. + - 500 # warning - default: 400 + - 500 # error - default: 1000 + +function_body_length: # Functions bodies should not span too many lines. + - 50 # warning - default: 40 + - 50 # error - default: 100 + +function_parameter_count: # Number of function parameters should be low. + - 5 # warning - default: 5 + - 5 # error - default: 8 + +identifier_name: + excluded: # excluded names + - id + - ok + - or + +large_tuple: # Tuples shouldn't have too many members. Create a custom type instead. + - 2 # warning - default: 2 + - 2 # error - default: 3 + +line_length: # Lines should not span too many characters. + warning: 150 # default: 120 + error: 150 # default: 200 + ignores_comments: true # default: false + ignores_urls: true # default: false + ignores_function_declarations: false # default: false + ignores_interpolated_strings: true # default: false + +nesting: # Types should be nested at most 2 level deep, and statements should be nested at most 5 levels deep. + type_level: + warning: 2 # warning - default: 1 + statement_level: + warning: 5 # warning - default: 5 + +trailing_closure: + only_single_muted_parameter: true + +type_body_length: # Type bodies should not span too many lines. + - 250 # warning - default: 200 + - 250 # error - default: 200 + +type_name: + excluded: # excluded names + - ID + +trailing_whitespace: + ignores_empty_lines: true # default: false + ignores_comments: true # default: false + +unused_optional_binding: + ignore_optional_try: true + +vertical_whitespace: # Limit vertical whitespace to a single empty line. + max_empty_lines: 2 # warning - default: 1 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a80d1c5 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Paul Schmiedmayer + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..c3a8a9a --- /dev/null +++ b/Package.swift @@ -0,0 +1,20 @@ +// swift-tools-version:5.4 + +import PackageDescription + + +let package = Package( + name: "ApodiniTemplate", + products: [ + .library(name: "ApodiniTemplate", targets: ["ApodiniTemplate"]) + ], + targets: [ + .target(name: "ApodiniTemplate"), + .testTarget( + name: "ApodiniTemplateTests", + dependencies: [ + .target(name: "ApodiniTemplate") + ] + ) + ] +) diff --git a/README.md b/README.md new file mode 100644 index 0000000..0635452 --- /dev/null +++ b/README.md @@ -0,0 +1,29 @@ +## How to use this repository +### Template + +When creating a new repository make sure to select this repository as a repository template. + +### Customize the repository + +Enter your repository specific configuration +- Replace the "Package.swift", "Sources" and "Tests" folder with your own Swift Package +- Enter your project name instead of "ApodiniTemplate" in .jazzy.yml +- Enter the correct test bundle name in the build-and-test.yml file under the "Convert coverage report" step. Most of the time the name is the name of the Project + "PackageTests". +- Update the README with your information and replace the links to the license with the new repository. +- If you create a new repository in the Apodini organzation you do not need to add a personal access token named "ACCESS_TOKEN". If you create the repo outside of the Apodini organization you need to create such a token with write access to the repo for all GitHub Actions to work. + +### ⬆️ Remove everything up to here ⬆️ + +# Project Name + +## Requirements + +## Installation/Setup/Integration + +## Usage + +## Contributing +Contributions to this projects are welcome. Please make sure to read the [contribution guidelines](https://github.com/Apodini/.github/blob/release/CONTRIBUTING.md) first. + +## License +This project is licensed under the MIT License. See [License](https://github.com/Apodini/Template-Repository/blob/release/LICENSE) for more information. diff --git a/Sources/ApodiniTemplate/ApodiniTemplate.swift b/Sources/ApodiniTemplate/ApodiniTemplate.swift new file mode 100644 index 0000000..10998df --- /dev/null +++ b/Sources/ApodiniTemplate/ApodiniTemplate.swift @@ -0,0 +1,3 @@ +struct ApodiniTemplate { + let text = "Hello, Apodini Template!" +} diff --git a/Tests/ApodiniTemplateTests/ApodiniTests.swift b/Tests/ApodiniTemplateTests/ApodiniTests.swift new file mode 100644 index 0000000..a12e3ff --- /dev/null +++ b/Tests/ApodiniTemplateTests/ApodiniTests.swift @@ -0,0 +1,9 @@ +import XCTest +@testable import ApodiniTemplate + + +final class ApodiniTemplateTests: XCTestCase { + func testExample() { + XCTAssertEqual(ApodiniTemplate().text, "Hello, Apodini Template!") + } +}