Coder Social home page Coder Social logo

Swift 3 support about pathkit HOT 7 CLOSED

sauliusgrigaitis avatar sauliusgrigaitis commented on July 16, 2024
Swift 3 support

from pathkit.

Comments (7)

kylef avatar kylef commented on July 16, 2024 1

Support for Swift 3 has been added in PathKit 0.7.0.

from pathkit.

ratranqu avatar ratranqu commented on July 16, 2024

FYI, I just provided a PR for this. If you want to use it now, you can use my repo ( ratranqu/PathKit). It works with the latest swift 3.0 dev snapshot from 2013/03/24.

from pathkit.

sauliusgrigaitis avatar sauliusgrigaitis commented on July 16, 2024

@ratranqu thanks! I tried you branch, but it doesn't compile on Linux:

warning: no sources in test module: /home/saulius/temp/PathKit
Compiling Swift Module 'PathKit' (1 sources)
/home/saulius/temp/PathKit/Sources/PathKit.swift:68:21: error: value of type 'Index' (aka 'String.CharacterView.Index') has no member 'distanceTo'
      let index = p.startIndex.distanceTo(p.startIndex.successor())
                  ~~^~~~~~~~~~ ~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:161:17: error: value of type 'NSString' has no member 'standardizingPath'
    return Path(NSString(string: self.path).standardizingPath)
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:191:39: error: value of type 'NSFileManager' has no member 'destinationOfSymbolicLink'
    let symlinkDestination = try Path.fileManager.destinationOfSymbolicLink(atPath:path)
                                 ~~~~~^~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:224:12: error: value of type 'NSString' has no member 'deletingPathExtension'
    return NSString(string: lastComponent).deletingPathExtension
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:264:17: error: value of type 'NSFileManager' has no member 'fileExists'
    return Path.fileManager.fileExists(atPath:self.path)
           ~~~~~^~~~~~~~~~~ ~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:281:16: error: value of type 'NSFileManager' has no member 'fileExists'
    guard Path.fileManager.fileExists(atPath: normalize().path, isDirectory: &directory) else {
          ~~~~~^~~~~~~~~~~ ~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:302:16: error: value of type 'NSFileManager' has no member 'fileExists'
    guard Path.fileManager.fileExists(atPath: normalize().path, isDirectory: &directory) else {
          ~~~~~^~~~~~~~~~~ ~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:319:24: error: value of type 'NSFileManager' has no member 'destinationOfSymbolicLink'
      let _ = try Path.fileManager.destinationOfSymbolicLink(atPath: path)
                  ~~~~~^~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:337:17: error: value of type 'NSFileManager' has no member 'isReadableFile'
    return Path.fileManager.isReadableFile(atPath: self.path)
           ~~~~~^~~~~~~~~~~ ~~~~~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:351:17: error: value of type 'NSFileManager' has no member 'isWritableFile'
    return Path.fileManager.isWritableFile(atPath: self.path)
           ~~~~~^~~~~~~~~~~ ~~~~~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:365:17: error: value of type 'NSFileManager' has no member 'isExecutableFile'
    return Path.fileManager.isExecutableFile(atPath: self.path)
           ~~~~~^~~~~~~~~~~ ~~~~~~~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:379:17: error: value of type 'NSFileManager' has no member 'isDeletableFile'
    return Path.fileManager.isDeletableFile(atPath: self.path)
           ~~~~~^~~~~~~~~~~ ~~~~~~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:398:14: error: value of type 'NSFileManager' has no member 'createDirectory'
    try Path.fileManager.createDirectory(atPath: self.path, withIntermediateDirectories: false, attributes: nil)
        ~~~~~^~~~~~~~~~~ ~~~~~~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:411:14: error: value of type 'NSFileManager' has no member 'createDirectory'
    try Path.fileManager.createDirectory(atPath: self.path, withIntermediateDirectories: true, attributes: nil)
        ~~~~~^~~~~~~~~~~ ~~~~~~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:424:14: error: value of type 'NSFileManager' has no member 'removeItem'
    try Path.fileManager.removeItem(atPath: self.path)
        ~~~~~^~~~~~~~~~~ ~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:437:14: error: value of type 'NSFileManager' has no member 'moveItem'
    try Path.fileManager.moveItem(atPath: self.path, toPath: destination.path)
        ~~~~~^~~~~~~~~~~ ~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:450:14: error: value of type 'NSFileManager' has no member 'copyItem'
    try Path.fileManager.copyItem(atPath: self.path, toPath: destination.path)
        ~~~~~^~~~~~~~~~~ ~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:462:14: error: value of type 'NSFileManager' has no member 'linkItem'
    try Path.fileManager.linkItem(atPath: self.path, toPath: destination.path)
        ~~~~~^~~~~~~~~~~ ~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:474:14: error: value of type 'NSFileManager' has no member 'createSymbolicLink'
    try Path.fileManager.createSymbolicLink(atPath: self.path, withDestinationPath: destination.path)
        ~~~~~^~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:554:47: error: value of type 'NSUUID' has no member 'uuidString'
    let path = try processUniqueTemporary() + NSUUID().uuidString
                                              ^~~~~~~~ ~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:584:16: error: value of type 'NSString' has no member 'substring'
    return try NSString(contentsOfFile: path, encoding: encoding).substring(from:0) as String
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:599:9: error: value of type 'NSData' has no member 'write'
    try data.write(toFile:normalize().path, options: .dataWritingAtomic)
        ^~~~ ~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:619:9: error: value of type 'NSString' has no member 'write'
    try NSString(string: string).write(toFile:normalize().path, atomically: true, encoding: encoding)
        ^~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:646:21: error: value of type 'NSFileManager' has no member 'contentsOfDirectory'
    return try Path.fileManager.contentsOfDirectory(atPath:path).map {
               ~~~~~^~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:664:21: error: value of type 'NSFileManager' has no member 'subpathsOfDirectory'
    return try Path.fileManager.subpathsOfDirectory(atPath:path).map {
               ~~~~~^~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:735:39: error: value of type 'NSFileManager' has no member 'enumerator'
      self.directoryEnumerator = Path.fileManager.enumerator(atPath:path.path)!
                                 ~~~~~^~~~~~~~~~~ ~~~~~~~~~~
<unknown>:0: error: build had 1 command failures
error: exit(1): /home/saulius/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2016-03-24-a/usr/bin/swift-build-tool -f /home/saulius/temp/PathKit/.build/debug.yaml default

from pathkit.

ratranqu avatar ratranqu commented on July 16, 2024

@saulius: Hum... I didn't touch the Linux bits as no running Linux vms with latest Dev branch. Let me have a look when I hv some time. Can you share which version of swift you are running please?

Thx.

from pathkit.

sauliusgrigaitis avatar sauliusgrigaitis commented on July 16, 2024

@ratranqu I use latest DEVELOPMENT-SNAPSHOT-2016-03-24-a

from pathkit.

ratranqu avatar ratranqu commented on July 16, 2024

@sauliusgrigaitis, I've just done a commit on my local copy (and pushed to PR). Can you confirm you are sorted now?

from pathkit.

sauliusgrigaitis avatar sauliusgrigaitis commented on July 16, 2024

@ratranqu thanks, looks like it works at least on Linux!

from pathkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.