Comments (15)
I have the same command-line bias (but I've never worked with C#). Do you know if there are any resources that talk about how that has been done elsewhere?
from csharp.
AFAIK Microsoft uses some buildfile-format called msbuild. Some googling showed up the following ressource: https://msdn.microsoft.com/en-us/library/dd576348.aspx
These files can be run from commandline using msbuild.exe
on windows or xbuild
(from mono) on linux and Mac OSX. At least, thats the theory.
from csharp.
I dislike MSBUILD and find it very hard to work with. :}
However, I have been playing around with FAKE which should be the solution that's needed here.
from csharp.
MSBUILD seems to have the advantage, that the msbuild-files can be opened by Visual/Xamarin Studio and monodevelop as projects for everyone who really wants that, can FAKE do this too?
from csharp.
FAKE scripts are just F# script files that can be opened in either editor. Feel free to read some on it here that has some examples to see if that will work for you.
from csharp.
So using FAKE would pull in F# as another dependency for trying out C#? XBuild is part of mono while F# has to be installed additionally.
from csharp.
Has there been any progression on this or a decission at least?
from csharp.
I haven't had a chance to look at it unfortunately, but it's an interesting problem.
While Xamarin studio may feel heavy, it's probably the easiest way to get Mono installed. And because of how .Net currently requires proj files, it might be easier to have an IDE manage that.
If someone wants to take a shot at this before I can look into it, we take pull requests :-D
from csharp.
I have been looking at various build systems lately, and MSBuild is not the best option to do cross-platform building. FAKE is a nice alternative, but it requires you to write the configuration file in F#. However, there is also another library named CAKE that allows the configuration to be specified in a C# DSL.
Using FAKE or CAKE would allow the tests to be run from the command-line, either on Windows, Mac OS X or Linux. However, FAKE or CAKE can only build solution (.sln) or (.csproj) files, not individual C# files. At the moment, we don't supply any of those, so users would have to create them first. Is there a reason why we don't supply a solution file? If this is not desirable, I probably could create some code that uses Roslyn to dynamically create a solution/project. Should we go this route, I could also create solutions/projects for the files in a single folder, which would allow us to run tests for a single, specific exercise.
I'm very interested in your thoughts on this subject.
from csharp.
I managed to get something working for F#: exercism/fsharp#55
I'll be looking into getting this to working for C# too.
from csharp.
I have a FAKE build script that currently builds all our examples. It would be easy to extend this to a general script with which you can run all or one exercise.
The problem is that at the moment, it is not possible to a language track to have additional scripts automatically be fetched. For context, see this comment by @kytrinyx: exercism/fsharp#32 (comment)
When support for this is added, I'll make sure we get a command-line build/test script for the C# track (and the F# track too).
from csharp.
I think #146 will help with this... using .NET Core and VS Code makes it easy to not only build and run C# projects from the dotnet
CLI, but VS Code adds extensive build support for Make, Rake, Fake, and Cake.
from csharp.
It definitely will! See also #138
from csharp.
I will not mind sharing the exact script I used to test on Linux
#!/bin/sh
set -e
if [ $# -eq 0 ]; then
srcfile=$(ls -1 *.cs | grep -v Test)
if [ -z "$srcfile" ]; then
echo "found no .cs files, run in a directory with one, or specify one."
echo "usage: $0 [srcfile [testfile]]"
exit 1
fi
fi
if [ $# -lt 2 ]; then
testfile=*Test.cs
testdll="$(echo $testfile | cut -d. -f1).dll"
else
testfile=$2
testdll="$(echo "$testfile" | cut -d. -f1).dll"
fi
srcdll="$(echo "$srcfile" | cut -d. -f1).dll"
nunit=/usr/lib/cli/nunit.framework-2.6.3/nunit.framework.dll
mcs -t:library $srcfile
mcs -t:library -r:$nunit,$srcdll $testfile
nunit-console --noxml $testdll
rm $srcdll $testdll
will be good to see dotnet test
improve on this.
from csharp.
This issue will be taken care of when #200 completes.
from csharp.
Related Issues (20)
- Add new exercise to work with LINQ on strings HOT 1
- Scalene triangle solution issue HOT 2
- Exercicio HOT 1
- Add introduction.md.tpl files for concept exercises HOT 4
- Suggest new exercise: <stream> HOT 1
- Circular buffer - incorrect Clear behaviour HOT 2
- New C# concept exercise: Stack HOT 2
- New C# concept exercise: Queue HOT 1
- XOR operator for booleans HOT 1
- Missing closing parentheses in instructions HOT 2
- New approach to Perfect Numbers exercise HOT 1
- 🤖 Sync error for commit 2e1c3c
- 🤖 Sync error for commit 2793b1 HOT 3
- C# track, Hyper-optimized Telemetry exercise - unclear instructions HOT 6
- elons-toys: Inconsistent object instantiations in tests HOT 1
- C# Log level exercise needs tests cases with numbers HOT 1
- Building a training set of tags for csharp HOT 21
- Missing example in do-while loops introduction in C# track HOT 3
- Deprecate `accumulate`? HOT 1
- Wrong instructions in Dominoes exercise HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from csharp.