Skip to content
This repository has been archived by the owner on Feb 7, 2018. It is now read-only.

Commit

Permalink
Issue.swift4 (#50)
Browse files Browse the repository at this point in the history
* Updated to support Swift 4

* migration to swift 4
  • Loading branch information
rolivieri authored and Aaron Liberatore committed Nov 2, 2017
1 parent 4e897a4 commit 157d8bc
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 84 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.build/*
CloudFoundryDeploymentTracker.xcodeproj/project.xcworkspace/xcuserdata/
CloudFoundryDeploymentTracker.xcodeproj/xcuserdata/
CloudFoundryDeploymentTracker.xcodeproj/
.build-ubuntu/*
*.xcodeproj/*
Package.resolved
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.1
4.0
9 changes: 1 addition & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,10 @@ matrix:
- os: linux
dist: trusty
sudo: required
- os: linux
dist: trusty
sudo: required
env: 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: 0 additions & 5 deletions Package.pins

This file was deleted.

24 changes: 18 additions & 6 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,3 +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
*
Expand All @@ -18,14 +20,24 @@ import PackageDescription

let package = Package(
name: "CloudFoundryDeploymentTracker",
targets: [
Target(
products: [
.library(
name: "CloudFoundryDeploymentTracker",
dependencies: []
),
targets: ["CloudFoundryDeploymentTracker"]
)
],
dependencies: [
.Package(url: "https://github.com/IBM-Swift/Swift-cfenv.git", majorVersion: 4),
.Package(url: "https://github.com/IBM-Swift/LoggerAPI.git", majorVersion: 1)
.package(url: "https://github.com/IBM-Swift/Swift-cfenv.git", .upToNextMajor(from: "5.0.0")),
.package(url: "https://github.com/IBM-Swift/LoggerAPI.git", .upToNextMajor(from: "1.0.0"))
],
targets: [
.target(
name: "CloudFoundryDeploymentTracker",
dependencies: ["CloudFoundryEnv", "LoggerAPI"]
),
.testTarget(
name: "CloudFoundryDeploymentTrackerTests",
dependencies: ["CloudFoundryDeploymentTracker"]
)
]
)
43 changes: 0 additions & 43 deletions [email protected]

This file was deleted.

25 changes: 11 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![Platform][platform-badge]][platform-url]

# Overview
The cf deployment tracker for Swift is a package used to track number of deployments to Bluemix for a particular Swift project. This Swift package requires little setup and allows IBMers to view deployment stats on the [Deployment Tracker](https://deployment-tracker.mybluemix.net/stats), for their demo/tutorial projects. If you'd like, you can include a deployment count badge in your project's README:
The cf deployment tracker for Swift is a package used to track number of deployments to IBM Cloud for a particular Swift project. This Swift package requires little setup and allows IBMers to view deployment stats on the [Deployment Tracker](https://deployment-tracker.mybluemix.net/stats), for their demo/tutorial projects. If you'd like, you can include a deployment count badge in your project's README:

![Deployment badge example](badge.png "Deployment Badge")

Expand All @@ -14,6 +14,7 @@ The cf deployment tracker for Swift is a package used to track number of deploym
- The 0.9.x, 1.0.x, and 2.0.x releases were tested on macOS and Linux using the Swift `3.0.2` binaries.
- The 3.0.x releases were tested on macOS and Linux using the Swift `3.1` and `3.1.1` binaries.
- The 4.0.x releases were tested on macOS and Linux using the Swift `3.1.1` binaries and `4.0` binaries.
- The 5.0.x releases were tested on macOS and Linux using the Swift `4.0` binaries.

You can download different versions of the Swift binaries by following this [link](https://swift.org/download/).

Expand All @@ -24,20 +25,16 @@ You can download different versions of the Swift binaries by following this [lin
import PackageDescription

let package = Package(
name: "MyAwesomeSwiftProject",
name: "MyAwesomeSwiftProject",

...
...

dependencies: [
// Swift 3.1.1
.Package(url: "https://github.com/IBM-Bluemix/cf-deployment-tracker-client-swift.git", majorVersion: 4),
// Swift 4.0
.package(url: "https://github.com/IBM-Bluemix/cf-deployment-tracker-client-swift.git", .upToNextMajor(from: "4.0.0")),
...
dependencies: [
.package(url: "https://github.com/IBM-Bluemix/cf-deployment-tracker-client-swift.git", .upToNextMajor(from: "5.0.0")),
...

])
]
)
```
2. Once the Package.swift file of your application has been updated accordingly, you can import the `CloudFoundryDeploymentTracker` module in your code. Additionally, you will need to initialize the CloudFoundryDeploymentTracker and call the `track()` method, as seen here:

Expand All @@ -59,7 +56,7 @@ To see how to include this package into your app, please visit [Kitura-Starter](
## Privacy Notice
```
## Privacy Notice
This Swift application includes code to track deployments to [IBM Bluemix](https://www.bluemix.net/) and other Cloud Foundry platforms. The following information is sent to a [Deployment Tracker](https://github.com/IBM-Bluemix/cf-deployment-tracker-service) service on each deployment:
This Swift application includes code to track deployments to [IBM Cloud](https://www.bluemix.net/) and other Cloud Foundry platforms. The following information is sent to a [Deployment Tracker](https://github.com/IBM-Bluemix/cf-deployment-tracker-service) service on each deployment:
* Swift project code version (if provided)
* Swift project repository URL
Expand All @@ -70,7 +67,7 @@ This Swift application includes code to track deployments to [IBM Bluemix](https
* Labels of bound services
* Number of instances for each bound service and associated plan information
This data is collected from the parameters of the `CloudFoundryDeploymentTracker`, the `VCAP_APPLICATION` and `VCAP_SERVICES` environment variables in IBM Bluemix and other Cloud Foundry platforms. This data is used by IBM to track metrics around deployments of sample applications to IBM Bluemix to measure the usefulness of our examples, so that we can continuously improve the content we offer to you. Only deployments of sample applications that include code to ping the Deployment Tracker service will be tracked.
This data is collected from the parameters of the `CloudFoundryDeploymentTracker`, the `VCAP_APPLICATION` and `VCAP_SERVICES` environment variables in IBM Cloud and other Cloud Foundry platforms. This data is used by IBM to track metrics around deployments of sample applications to IBM Cloud to measure the usefulness of our examples, so that we can continuously improve the content we offer to you. Only deployments of sample applications that include code to ping the Deployment Tracker service will be tracked.
### Disabling Deployment Tracking
Please see the README for the sample application (i.e. [Kitura-Starter](https://github.com/IBM-Bluemix/Kitura-Starter)) that includes this package for instructions on disabling deployment tracking, as the instructions may vary based on the sample application in which this package is included.
Expand Down
2 changes: 1 addition & 1 deletion Tests/CloudFoundryDeploymentTrackerTests/MainTests.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright IBM Corporation 2016, 2017
* Copyright IBM Corporation 2017
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Tests/LinuxMain.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright IBM Corporation 2016
* Copyright IBM Corporation 2017
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# docker-compose up
app:
image: ibmcom/swift-ubuntu:3.1.1
image: ibmcom/swift-ubuntu:4.0
volumes:
- .:/cf-deployment-tracker-client-swift
command: bash -c "cd /cf-deployment-tracker-client-swift && swift package clean && swift build && swift test"
command: bash -c "cd /cf-deployment-tracker-client-swift && swift package --build-path .build-ubuntu clean && swift build --build-path .build-ubuntu && swift test --build-path .build-ubuntu"

0 comments on commit 157d8bc

Please sign in to comment.