File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed
Samples/JavaDependencySampleApp/Sources/JavaDependencySample Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change 1414
1515import Foundation
1616import SwiftJava
17- #if canImport(System)
18- import System
19- #endif
2017
2118// Import the json library wrapper:
2219import OrgAndrejsJson
@@ -32,27 +29,22 @@ enum OrgAndrejsJsonTests {
3229 print ( json. get ( " port " ) . toString ( ) )
3330 precondition ( json. get ( " port " ) . as ( JavaInteger . self) !. intValue ( ) == 80 )
3431
35- #if canImport(System)
3632 print ( " Reading swift-java.config inside OrgAndrejsJson folder... " )
3733
38- let configPath = FilePath . currentWorkingDirectory. appending ( " Sources/OrgAndrejsJson/swift-java.config " ) . string
34+ let configPath = String . currentWorkingDirectory. appending ( " / Sources/OrgAndrejsJson/swift-java.config" )
3935
4036 let config = try JavaClass < Json > ( ) . of. url ( " file:// " + configPath) !
4137
4238 precondition ( config. hasOwnProperty ( " repositories " ) )
4339
4440 print ( config. toString ( ) )
45-
46- #endif
4741 }
4842}
4943
50- #if canImport(System)
51- extension FilePath {
44+ private extension String {
5245 static var currentWorkingDirectory : Self {
5346 let path = getcwd ( nil , 0 ) !
5447 defer { free ( path) }
55- return . init ( String ( cString: path) )
48+ return String ( cString: path)
5649 }
5750}
58- #endif
You can’t perform that action at this time.
0 commit comments