Compile Swift on Windows from Silver Command Line?

571 Views Asked by At

I've been learning Swift for a little bit now, and I really want to use it. However, compiling Swift on Windows is quite a chore. I can do it from Visual Studio 2015 easily, but VS2015 support is very poor, and incredibly hard to work with; I would prefer to use Atom and the command line. I use RemObject's Silver to compile to .NET, but I can never get the command line to work.

When I use the Elements.exe at C:\Program Files (x86)\RemObjects Software\Elements\Bin, passing the filename as a parameter, it tells me that print is undefined.

Does anyone know how to use Silver's command line to compiler Swift?

2

There are 2 best solutions below

1
sh17 On

Have you tried referencing the online documentation?

calling elements needs some libraries to import:

elements --mode=ECHOES --reference=Swift myfile.swift
3
marc hoffman On

I recommend using MSBuild, rather than Elements.exe, to build Elements projects from the command line. It's more complete and supports more advanced build tasks needed for some project types.

That said, --mode and --reference should definitely work. Can you post a complete command line and output?

You will need --reference=Swift in order for print() & co to be known, and --reference System.Core to use LINQ.