From 4bc36c41b0c18eae425ccd1c1ec93ce5eb4548b6 Mon Sep 17 00:00:00 2001 From: Jesse Squires Date: Sat, 25 Jan 2020 23:40:40 -0800 Subject: [PATCH] add other default project files --- build_docs.sh | 32 +++++++++++++++++ lint.sh | 36 +++++++++++++++++++ .../IDETemplateMacros.plist | 19 ++++++++++ other_project_defaults/LICENSE | 21 +++++++++++ other_project_defaults/README.md | 16 +++++++++ 5 files changed, 124 insertions(+) create mode 100755 build_docs.sh create mode 100755 lint.sh create mode 100644 other_project_defaults/IDETemplateMacros.plist create mode 100644 other_project_defaults/LICENSE create mode 100644 other_project_defaults/README.md diff --git a/build_docs.sh b/build_docs.sh new file mode 100755 index 0000000..07a9e93 --- /dev/null +++ b/build_docs.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# Created by Jesse Squires +# https://www.jessesquires.com +# +# Copyright © 2020-present Jesse Squires +# +# Docs by jazzy +# https://github.com/realm/jazzy +# ------------------------------ + +PROJECT="" + +if which jazzy >/dev/null; then + jazzy \ + --clean \ + --author "Jesse Squires" \ + --author_url "https://jessesquires.com" \ + --github_url "https://github.com/jessesquires/$PROJECT" \ + --module "$PROJECT" \ + --source-directory . \ + --readme "README.md" \ + --documentation "Guides/*.md" \ + --output docs/ + exit +else + echo " + Error: jazzy not installed! + Install: gem install jazzy + " + exit 1 +fi diff --git a/lint.sh b/lint.sh new file mode 100755 index 0000000..f6641ba --- /dev/null +++ b/lint.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# Created by Jesse Squires +# https://www.jessesquires.com +# +# Copyright © 2020-present Jesse Squires +# +# SwiftLint +# https://github.com/realm/swiftlint +# ------------------------------ + +VERSION="0.35.0" +FOUND=$(swiftlint version) + +if which swiftlint >/dev/null; then + swiftlint lint --config ./.swiftlint.yml + exit +else + echo " + Error: SwiftLint not installed! + Download from https://github.com/realm/SwiftLint, + or brew install swiftlint. + " +fi + +if [ $(swiftlint version) != $VERSION ]; then + echo " + Warning: incorrect SwiftLint installed! + Expected: $VERSION + Found: $FOUND + Download from https://github.com/realm/SwiftLint, + or brew upgrade swiftlint. + " +fi + +exit diff --git a/other_project_defaults/IDETemplateMacros.plist b/other_project_defaults/IDETemplateMacros.plist new file mode 100644 index 0000000..c969c79 --- /dev/null +++ b/other_project_defaults/IDETemplateMacros.plist @@ -0,0 +1,19 @@ + + + + +FILEHEADER + +// Created by Jesse Squires +// https://www.jessesquires.com +// +// Documentation +// https://jessesquires.github.io/PROJECT_NAME +// +// GitHub +// https://github.com/jessesquires/PROJECT_NAME +// +// Copyright © YEAR-present Jesse Squires +// + + diff --git a/other_project_defaults/LICENSE b/other_project_defaults/LICENSE new file mode 100644 index 0000000..55b9ab8 --- /dev/null +++ b/other_project_defaults/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Jesse Squires + +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/other_project_defaults/README.md b/other_project_defaults/README.md new file mode 100644 index 0000000..a114f68 --- /dev/null +++ b/other_project_defaults/README.md @@ -0,0 +1,16 @@ +# Default project files + +This directory contains miscellaneous default project files, like build scripts, etc. + +These must be copied to new repositories, and updated with project-specific details. + +## Contents + +### Scripts + +- `lint.sh`, swift lint script +- `build_docs.sh`, jazzy docs script + +### Templates + +- `IDETemplateMacros.plist` to [customize Xcode header comments](https://oleb.net/blog/2017/07/xcode-9-text-macros/). Must be placed in `.xcodeproj/xcshareddata/IDETemplateMacros.plist` or `.xcworkspace/xcshareddata/IDETemplateMacros.plist`.