Skip to content

Commit

Permalink
Backward Compatibility (#62)
Browse files Browse the repository at this point in the history
* Revert "Swift 4 (#61)"

This reverts commit 57984f6.

* Reverts backward compatability

* Updates package.swift

* Updates configuration version
  • Loading branch information
Aaron Liberatore authored and rolivieri committed Sep 29, 2017
1 parent 57984f6 commit 6ded559
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0
3.1.1
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,22 @@ matrix:
- os: linux
dist: trusty
sudo: required
- os: linux
dist: trusty
sudo: required
env: SWIFT_SNAPSHOT=4.0
- os: linux
dist: trusty
sudo: required
services: docker
env: DOCKER_IMAGE=ubuntu:16.04 SWIFT_SNAPSHOT=4.0
- os: osx
osx_image: xcode8.3
sudo: required
- os: osx
osx_image: xcode9
sudo: required
env: SWIFT_SNAPSHOT=4.0

before_install:
- git clone https://github.com/IBM-Swift/Package-Builder.git
Expand Down
5 changes: 5 additions & 0 deletions Package.pins
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"autoPin": false,
"pins": [],
"version": 1
}
27 changes: 7 additions & 20 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// swift-tools-version:4.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

/**
* Copyright IBM Corporation 2016, 2017
* Copyright IBM Corporation 2016,2017
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,25 +18,15 @@ import PackageDescription

let package = Package(
name: "CloudFoundryEnv",
products: [
.library(
targets: [
Target(
name: "CloudFoundryEnv",
targets: ["CloudFoundryEnv"]
)
dependencies: []
),
],
dependencies: [
//.Package(url: "https://github.com/behrang/YamlSwift.git", majorVersion: 1),
.package(url: "https://github.com/IBM-Swift/LoggerAPI.git", .upToNextMajor(from: "2.0.0")),
.package(url: "https://github.com/IBM-Swift/Configuration.git", .upToNextMajor(from: "2.0.0")),
],
targets: [
.target(
name: "CloudFoundryEnv",
dependencies: ["LoggerAPI", "Configuration"]
),
.testTarget(
name: "CloudFoundryEnvTests",
dependencies: ["CloudFoundryEnv"]
),
.Package(url: "https://github.com/IBM-Swift/LoggerAPI.git", majorVersion: 1),
.Package(url: "https://github.com/IBM-Swift/Configuration.git", majorVersion: 1),
]
)
45 changes: 45 additions & 0 deletions Package@swift-4.0.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// swift-tools-version:4.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

/**
* Copyright IBM Corporation 2016, 2017
*
* 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 PackageDescription

let package = Package(
name: "CloudFoundryEnv",
products: [
.library(
name: "CloudFoundryEnv",
targets: ["CloudFoundryEnv"]
)
],
dependencies: [
//.Package(url: "https://github.com/behrang/YamlSwift.git", majorVersion: 1),
.package(url: "https://github.com/IBM-Swift/LoggerAPI.git", .upToNextMajor(from: "1.7.0")),
.package(url: "https://github.com/IBM-Swift/Configuration.git", .upToNextMajor(from: "1.0.0")),
],
targets: [
.target(
name: "CloudFoundryEnv",
dependencies: ["LoggerAPI", "Configuration"]
),
.testTarget(
name: "CloudFoundryEnvTests",
dependencies: ["CloudFoundryEnv"]
),
]
)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/IBM-Swift/Swift-cfenv.svg?branch=master)](https://travis-ci.org/IBM-Swift/Swift-cfenv)
[![Build Status - Master](https://travis-ci.org/IBM-Swift/Swift-cfenv.svg?branch=master)](https://travis-ci.org/IBM-Swift/Swift-cfenv)
![macOS](https://img.shields.io/badge/os-macOS-green.svg?style=flat)
![Linux](https://img.shields.io/badge/os-linux-green.svg?style=flat)

Expand All @@ -11,7 +11,7 @@ This library determines if you are running your application "locally" or on the
For the implementation of this Swift package, we used as inspiration a similar module that had been developed for Node.js applications, [node-cfenv](https://github.com/cloudfoundry-community/node-cfenv).

## Swift version
The latest version of Swift-cfenv works with the `4.0` version of the Swift binaries. You can download this version of the Swift binaries by following this [link](https://swift.org/download/#snapshots).
The latest version of Swift-cfenv works with the `Swift 3.1.1` or newer. You can download this version of the Swift binaries by following this [link](https://swift.org/download/#snapshots).

## Configuration
The latest version of Swift-cfenv relies on the [Configuration](https://github.com/IBM-Swift/Configuration) package to load and merge configuration data from multiple sources, such as environment variables or JSON files. In previous versions of Swift-cfenv, the library was responsible for accessing the environment variables directly. Moving forward, newer versions of Swift-cfenv will continue to depend on the configuration data loaded into a `ConfigurationManager` instance. For further details on the Configuration package, see its [README](https://github.com/IBM-Swift/Configuration) file.
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# docker-compose up
app:
image: ibmcom/swift-ubuntu:4.0
image: ibmcom/swift-ubuntu:3.1.1
ports:
- "8080:8080"
volumes:
- .:/Swift-cfenv
command: bash -c "cd /Swift-cfenv && swift package --build-path .build-ubuntu clean && swift build --build-path .build-ubuntu && swift test --build-path .build-ubuntu"
- .:/root/Swift-cfenv
command: bash -c "cd /root/Swift-cfenv && rm -rf Packages && swift build --clean && swift build && swift test"

0 comments on commit 6ded559

Please sign in to comment.