BlueSocket icon indicating copy to clipboard operation
BlueSocket copied to clipboard

BlueSocket EchoServer from README as a separate repository

Open JanX2 opened this issue 6 years ago • 1 comments

It would be very convenient to have the BlueSocket EchoServer from the README Complete Example available as a separate repository.

I’m aware that maintaining a separate repository can be a bit of a pain, but, in the end, this would make getting started with BlueSocket a great deal easier.

JanX2 avatar Mar 10 '19 17:03 JanX2

I had to completely rewrite the “Package.swift” file’s content to get the “[email protected]” necessary for > Swift 4. Here is my result. It works, but please assume that I have no idea what I’m doing as I am pretty new to Swift:

// swift-tools-version:4.0

import PackageDescription

let package = Package(
	name: "EchoServer",
	dependencies: [
		.package(url: "https://github.com/IBM-Swift/BlueSocket.git", from: "1.0.44"),
	],
	targets: [
	.target(
		name: "EchoServer",
		dependencies: [
			"Socket"
		],
		path: "Sources"
		)
	]
)

The above should go into "PACKAGE_ROOT_DIR/[email protected]". The EchoServer code should then reside in "PACKAGE_ROOT_DIR/Sources/main.swift".

JanX2 avatar Mar 10 '19 17:03 JanX2