File tree 4 files changed +57
-3
lines changed
4 files changed +57
-3
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}
6
6
7
7
# [Optional] Uncomment this section to install additional OS packages.
8
8
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
9
- && apt-get -y install --no-install-recommends build-essential software-properties-common xz-utils g++ sbcl julia python3 python3-pip python3-dev ghc openjdk-11-jdk libssl-dev gfortran libxml2-dev libyaml-dev libgmp-dev libz-dev libncurses5 gnuplot nodejs npm lua5.3 ocaml php ruby-full gnu-smalltalk scratch libfftw3-dev cmake
9
+ && apt-get -y install --no-install-recommends build-essential software-properties-common xz-utils g++ sbcl julia python3 python3-pip python3-dev ghc openjdk-11-jdk libssl-dev gfortran libxml2-dev libyaml-dev libgmp-dev libz-dev libncurses5 gnuplot nodejs npm lua5.3 ocaml php ruby-full gnu-smalltalk scratch libfftw3-dev cmake mono-devel
10
10
11
11
# Setup Crystal
12
12
RUN echo 'deb http://download.opensuse.org/repositories/devel:/languages:/crystal/xUbuntu_20.04/ /' | sudo tee /etc/apt/sources.list.d/devel:languages:crystal.list
@@ -98,7 +98,7 @@ ENV PATH=$PATH:~/elm
98
98
99
99
# Setup V
100
100
RUN mkdir -p ~/vlang && wget https://github.com/vlang/v/releases/download/weekly.2021.44/v_linux.zip -O ~/vlang/vlang.zip && \
101
- unzip ~/vlang/vlang.zip -d ~/vlang
101
+ unzip ~/vlang/vlang.zip -d ~/vlang
102
102
ENV PATH=$PATH:~/vlang/v
103
103
104
104
# Install the packages that needed extra help
@@ -109,4 +109,3 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
109
109
RUN pip install wheel matplotlib numpy coconut scons
110
110
111
111
RUN sudo sh -c 'npm install -g typescript'
112
-
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ available_languages = {
28
28
'bash' ,
29
29
'c' ,
30
30
'cpp' ,
31
+ 'csharp' ,
31
32
'fortran' ,
32
33
'java' ,
33
34
'julia' ,
@@ -43,6 +44,7 @@ available_languages = {
43
44
44
45
languages_to_import = {
45
46
'coconut' : ['coconut' ],
47
+ 'csharp' : ['mcs' ],
46
48
'go' : ['go' ],
47
49
'rust' : ['rustc' , 'cargo' ],
48
50
'kotlin' : ['kotlin' ],
@@ -77,6 +79,7 @@ languages = {
77
79
'c' : 'c' ,
78
80
'coconut' : 'coco' ,
79
81
'cpp' : 'cpp' ,
82
+ 'csharp' : 'cs' ,
80
83
'fortran' : 'f90' ,
81
84
'go' : 'go' ,
82
85
'java' : 'java' ,
Original file line number Diff line number Diff line change
1
+ from SCons .Builder import Builder
2
+ import SCons .Util
3
+
4
+ class ToolMCSWarning (SCons .Warnings .SConsWarning ):
5
+ pass
6
+
7
+ class MCSNotFound (ToolMCSWarning ):
8
+ pass
9
+
10
+ SCons .Warnings .enableWarningClass (ToolMCSWarning )
11
+
12
+ def _detect (env ):
13
+ try :
14
+ return env ['mcs' ]
15
+ except KeyError :
16
+ pass
17
+
18
+ go = env .WhereIs ('mcs' )
19
+ if go :
20
+ return go
21
+
22
+ SCons .Warnings .warn (MCSNotFound , 'Could not find mcs executable' )
23
+
24
+ def exists (env ):
25
+ env .Detect ('mcs' )
26
+
27
+ def generate (env ):
28
+ env ['MCS' ] = _detect (env )
29
+ env ['MCSFLAGS' ] = []
30
+
31
+ mcs_builder = Builder (
32
+ action = '"$MCS" -out:$TARGET $MCSFLAGS $SOURCES' ,
33
+ src_suffix = '.cs' ,
34
+ suffix = '$PROGSUFFIX' ,
35
+ )
36
+
37
+ env .Append (BUILDERS = {'MCS' : mcs_builder })
Original file line number Diff line number Diff line change
1
+ Import('files_to_compile env')
2
+
3
+ language = files_to_compile[0].language
4
+ chapter = files_to_compile[0].chapter
5
+
6
+ from collections import defaultdict
7
+ chapter_files = defaultdict(list)
8
+
9
+ for file_info in files_to_compile:
10
+ chapter_files[file_info.chapter].append(file_info.path)
11
+
12
+ for chapter, files in chapter_files.items():
13
+ build_target = f'#/build/{language}/{chapter}/{chapter}'
14
+ build_result = env.MCS(build_target, [str(file) for file in files])
15
+ env.Alias(str(chapter), build_result)
You can’t perform that action at this time.
0 commit comments