LoginSignup
18
19

More than 5 years have passed since last update.

SwiftのWebフレームワークSlimaneをインストールする

Last updated at Posted at 2016-05-13

はじめに

Swiftがオープンソースになった事で、Android用アプリをSwiftでかけるように(なりそう!)なったり、Web開発をSwiftで行えるように(なりそう!)なったりしていますね。

私は、Swiftでアプリを作った事は無いし、4月辺りに初めて触った者ですが、Node.jsに似た作りになっているWebフレームワークSlimaneに興味を持ったのでとりあえず、インストールしてみました。

Swiftのバージョンアップは1周間に何度も行われるくらいの頻度です。
言語仕様の変化が激しいので、Slimane含めSwiftのWebフレームワークも激しく更新されますのでまだまだ試用段階だと思って下さい。

※この記事はSlimaneインストールガイドの日本語訳です。

Ubuntu

1.Swiftの導入

wget https://swift.org/builds/development/ubuntu1404/swift-DEVELOPMENT-SNAPSHOT-2016-05-09-a/swift-DEVELOPMENT-SNAPSHOT-2016-05-09-a-ubuntu14.04.tar.gz
tar xzvf swift-DEVELOPMENT-SNAPSHOT-2016-05-09-a-ubuntu14.04.tar.gz
echo "PATH=/your/path/to/swift-DEVELOPMENT-SNAPSHOT-2016-05-09-a-ubuntu14.04/usr/bin:$PATH" >> ~/.bashrc

~/.bashrc
swift -v

2.Slimaneの導入

# Install build tools and libssl-dev
sudo apt-get upgrade
sudo apt-get install build-essential libtool libssl-dev
sudo apt-get install automake clang
# build and install libuv
git clone https://github.com/libuv/libuv.git && cd libuv
sh autogen.sh
./configure
make
make install

# build and install hiredis
git clone https://github.com/redis/hiredis && cd hiredis
make
make install

ビルド

# If you have the old build, need to run
# make clean

make

Mac OSX

1.Swiftの導入
https://swift.org/builds/development/xcode/swift-DEVELOPMENT-SNAPSHOT-2016-05-09-a/swift-DEVELOPMENT-SNAPSHOT-2016-05-09-a-osx.pkg
パッケージをインストール

swift -v

2.Slimaneの導入

Package.swift
import PackageDescription

let package = Package(
    name: "SlimaneApp",
    dependencies: [
        .Package(url: "https://github.com/noppoMan/Slimane.git", majorVersion: 0, minor: 4)
    ]
)

brew

brew install libuv openssl hiredis
brew link libuv --force
brew link openssl --force
brew link -f hiredis

ビルド

# If you have the old build, need to run
# make clean

make

デバック・テスト

make debug
make test

これをやったからと言って何もできないので、近い内にSlimaneに公開されているExampleアプリを実際に起動させてみたいと思います。

18
19
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
18
19