AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
![]() ![]() Now running the executable FileOrganizer in the debug directory should print Hello World mac:FileOrganizer sandeepjoshi$. mac:FileOrganizer sandeepjoshi$ swift build Compile Swift Module 'FileOrganizer' (1 sources) Linking. swift build command will compile all the modules and handle the dependencies in the Package.swift file. We can now build the package and make sure there are no issues. ![]() A look at the main.swift is as below print("Hello, world!") Moving on to the source file, Swift has a simple hello world boilerplate code in the source file. Like the test suite refers to the main source module. Targets: These are basic blocks of the package like test suite or the main module, and can be interdependent.Dependencies: All the other libraries which we’ll use in this package.Products: The executables and libraries which are the end products of the package.One of the file created is Package.swift which contains 3 important aspects of the package As you can see in Fig 1, the command creates a directory structure. Note that the command will create a package with the same name as the present working directory. Now we need to setup a basic Package structure using the command swift package init -type executable. Make sure you have the latest version of Swift(4) installed and you can check it using the command swift -version as shown below.We’ll explore three packages from awesomeiOS list on GitHub. For example, taking all png files in a folder and moving them to a sub directory within that folder. We’ll build a command line tool to group files of a particular type and move them into a sub directory. There have been some libraries which helps to build useful command line apps and today we’ll explore few libraries and build a simple command line app. With Swift being open source and server side swift gaining more and more traction, command line apps built with swift can be extemely powerful for server side applications. ![]()
0 Comments
Read More
Leave a Reply. |