kakaopensource / KakaJSON

Fast conversion between JSON and model in Swift.
MIT License
1.16k stars 126 forks source link

[big pr]: refactor project structure #27

Closed luoxiu closed 5 years ago

luoxiu commented 5 years ago

resolve #26 Big pr,但大部分修改是移动文件。

这个 pr 主要修改了:

  1. 使用了 SwiftPM 生成的 project 模版。
  2. Carthage 现在支持了 macOS/tvOS/watchOS。
  3. Package.swift 添加了 test target,现在可以使用 swift test 快速测试了。
  4. Expose allTests to linux.
  5. 添加了 .travis.yml,现在 matrix 有 mac, iphone, appletv.

KakaJSON 的依赖只有 Foundation,支持 Linux 应该是顺理成章的,但这行代码在 Cocoa 上通过了编译,在 Linux 上却编译失败:

extension NSObject {
    static func newConvertible() -> Convertible {
        return self.init() as! Convertible  // Error: constructing an object of class type 'NSObject' with a metatype value must use a 'required' initializerinitializer
    }
}

所以暂时把 travis 里的 Linux 注释掉了。

luoxiu commented 5 years ago

New project structure:

project-structure