Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
the-freshlord committed Oct 26, 2017
0 parents commit 8d29ebb
Show file tree
Hide file tree
Showing 10 changed files with 211 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## Build generated
build/
DerivedData/
.DS_Store

## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/

## Other
*.moved-aside
*.xccheckout
*.xcscmblueprint

## Obj-C/Swift specific
*.hmap
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
.build/
/*.xcodeproj
/*.xcworkspace

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
38 changes: 38 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
included:
- Sources
- Tests

excluded:
- Package.swift

opt_in_rules:
- closure_end_indentation
- closure_spacing
- empty_count
- explicit_init
- fatal_error_message
- first_where
- multiline_parameters
- operator_usage_whitespace
- overridden_super_call
- private_outlet
- trailing_closure
- vertical_parameter_alignment_on_call

disabled_rules:
- empty_enum_arguments
- file_length
- function_body_length
- private_over_fileprivate
- todo
- trailing_whitespace
- type_body_length
- valid_ibinspectable
- vertical_whitespace

reporter: "html"

large_tuple: 4
function_parameter_count: 6
line_length: 110
cyclomatic_complexity: 15
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
matrix:
include:
- os: linux
dist: trusty
sudo: required
- os: osx
osx_image: xcode9
sudo: required

before_install:
- git clone https://github.com/IBM-Swift/Package-Builder.git

script:
- ./Package-Builder/build-package.sh -projectDir $TRAVIS_BUILD_DIR
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017 Manny Guerrero

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.
28 changes: 28 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// swift-tools-version:4.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "SwiftEnv",
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "SwiftEnv",
targets: ["SwiftEnv"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "SwiftEnv",
dependencies: []),
.testTarget(
name: "SwiftEnvTests",
dependencies: ["SwiftEnv"]),
]
)
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# SwiftEnv

An easy to use interface for accessing environment variables with Swift

[![Build Status](https://travis-ci.org/eman6576/SwiftEnv.svg?branch=master)](https://travis-ci.org/eman6576/SwiftEnv)
[![codecov](https://codecov.io/gh/eman6576/SwiftEnv/branch/master/graph/badge.svg)](https://codecov.io/gh/eman6576/SwiftEnv)
![Swift 4.0](https://img.shields.io/badge/Swift-4.0-orange.svg?style=flat)
[![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)
[![DUB](https://img.shields.io/dub/l/vibe-d.svg)](https://github.com/eman6576/SwiftEnv/blob/master/LICENSE)
[![platform](https://img.shields.io/badge/platform-macOS%20%7C%20Linux-lightgrey.svg)]()
3 changes: 3 additions & 0 deletions Sources/SwiftEnv/SwiftEnv.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
struct SwiftEnv {
var text = "Hello, World!"
}
6 changes: 6 additions & 0 deletions Tests/LinuxMain.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import XCTest
@testable import SwiftEnvTests

XCTMain([
testCase(SwiftEnvTests.allTests),
])
16 changes: 16 additions & 0 deletions Tests/SwiftEnvTests/SwiftEnvTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import XCTest
@testable import SwiftEnv

class SwiftEnvTests: XCTestCase {
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct
// results.
XCTAssertEqual(SwiftEnv().text, "Hello, World!")
}


static var allTests = [
("testExample", testExample),
]
}
5 changes: 5 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SwiftEnv:
image: ibmcom/swift-ubuntu:latest
volumes:
- .:/root/SwiftEnv
command: bash -c "cd /root/SwiftEnv && swift build && swift test"

0 comments on commit 8d29ebb

Please sign in to comment.