Skip to content

Commit ce750fc

Browse files
committed
Adding project templates for RISC-V
1 parent b7334a6 commit ce750fc

32 files changed

+1981
-8
lines changed

bashscript/installpackagedotnetsdk.sh

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,61 @@ if [ -z $INSTALLPATH ]; then
2020
INSTALLPATH=/usr/share/dotnet
2121
fi
2222

23+
# **************** definition of variables ****************
24+
declare ARCH_OS=$(uname -m) #aarch64, armv7l, x86_64 or riscv64
25+
declare ID_OS=("$(cat /etc/*release | grep '^ID=' | sed 's/.*=\s*//')") # ubuntu, debian, alpine
26+
declare VERSION_OS=("$(cat /etc/*release | grep '^VERSION_ID=' | sed 's/.*=\s*//')")
27+
VERSION_OS=("$(echo ${VERSION_OS} | sed 's/\"//g')")
28+
# get only type XX.YY
29+
VERSION_OS=("$(cut -d '.' -f 1 <<< "$VERSION_OS")"."$(cut -d '.' -f 2 <<< "$VERSION_OS")")
30+
31+
# requirements check
32+
if [ $ARCH_OS != "aarch64" ] && [ $ARCH_OS != "armv7l" ] \
33+
&& [ $ARCH_OS != "x86_64" ]&& [ $ARCH_OS != "riscv64" ]; then
34+
echo "ERROR. Current OS architecture ${ARCH_OS} is not supported."
35+
exit 1;
36+
fi
37+
38+
if [ $ID_OS != "ubuntu" ] && [ $ID_OS != "debian" ] && [ $ID_OS != "alpine" ]; then
39+
echo "ERROR. Current OS ${ID_OS} not supported."
40+
exit 1;
41+
fi
42+
2343
export DEBIAN_FRONTEND="noninteractive"
2444

2545
sudo apt-get update
2646
sudo apt-get install -y wget
2747

28-
#install
29-
wget https://dot.net/v1/dotnet-install.sh
30-
sudo chmod +x dotnet-install.sh
31-
export DOTNET_CLI_TELEMETRY_OPTOUT=true
32-
sudo ./dotnet-install.sh --channel $NETSDK_CHANNEL --install-dir $INSTALLPATH
48+
#for aarch64, armv7l, x86_64
49+
if [ $ARCH_OS == "aarch64" ] && [ $ARCH_OS == "armv7l" ] \
50+
&& [ $ARCH_OS == "x86_64" ]; then
51+
#install
52+
wget https://dot.net/v1/dotnet-install.sh
53+
sudo chmod +x dotnet-install.sh
54+
export DOTNET_CLI_TELEMETRY_OPTOUT=true
55+
sudo ./dotnet-install.sh --channel $NETSDK_CHANNEL --install-dir $INSTALLPATH
56+
rm dotnet-install.sh
57+
fi
58+
59+
#for riscv64
60+
if [ $ARCH_OS == "riscv64" ]; then
61+
if [ $NETSDK_CHANNEL != "8.0" ]; then
62+
echo "ERROR. You can only install dotnet sdk 8.0 for riscv64."
63+
exit 1;
64+
fi
65+
sudo apt-get install -y tar
66+
wget -O dotnet-sdk-riscv64.tar.gz "https://github.com/dkurt/dotnet_riscv/releases/download/v8.0.100/dotnet-sdk-8.0.100-linux-riscv64.tar.gz"
67+
sudo mkdir -p $INSTALLPATH
68+
sudo tar -xf dotnet-sdk-riscv64.tar.gz -C "$INSTALLPATH" --checkpoint=.100
69+
echo ""
70+
rm dotnet-sdk-riscv64.tar.gz
71+
fi
72+
3373
if [ -h /usr/bin/dotnet ]; then
3474
sudo rm /usr/bin/dotnet
3575
fi
3676
sudo ln -s $INSTALLPATH/dotnet /usr/bin/dotnet
3777

38-
rm dotnet-install.sh
39-
4078
#Disabled telemetry in .NET
4179
#Telemetry is collected when using any of the .NET CLI commands, such as:
4280
# dotnet build

src/Helper/dotnetHelper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export class dotnetHelper {
5858
static GetDotNetTargets(): Map<string,string[]> {
5959
//from https://learn.microsoft.com/en-us/dotnet/standard/frameworks
6060
let dictionary = new Map<string,string[]>();
61-
dictionary.set("8.0",["net8.0",".NET 8 (preview)"]);
61+
dictionary.set("8.0",["net8.0",".NET 8 (LTS) (preview for RISC-V)"]);
6262
dictionary.set("7.0",["net7.0",".NET 7"]);
6363
dictionary.set("6.0",["net6.0",".NET 6 (LTS)"]);
6464
dictionary.set("5.0",["net5.0",".NET 5 (support ended)"]);
2.89 KB
Loading
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#YAML
2+
#Base Entity
3+
id: dotnet-console-coreclr-cross-riscv64 # unique
4+
version: "0.1"
5+
releaseDate: "2024-04-11" # YYYY-MM-DD
6+
author: DevDotNet.ORG
7+
emailAuthor: fastiot@devdotnet.org
8+
license: MIT
9+
label: .NET Console Application Runtime Info for RISC-V
10+
detail: Checking native launch in CoreCLR. Debugging is not available, only copying to the device and launching.
11+
description: >
12+
Minimal console application sample.
13+
The application is compiled on the PC.
14+
forVersionExt: 0.4.1
15+
platform: # win32, linux. Only Windows is currently supported
16+
- win32
17+
endDeviceArchitecture: # armv6l, armv7l, aarch64, riscv64, x86_64
18+
- riscv64
19+
dependOnPackages: # Coming in one of the next version
20+
- dotnetruntime-%{dotnetTarget}
21+
- vsdbg
22+
tags:
23+
- console
24+
- dotnet
25+
#Template
26+
language: C#
27+
typeProj: dotnet # template type is related to processing logic
28+
projName: DotnetConsoleApp # default value shown to the user
29+
mainFileProj: dotnetapp.csproj # relative path to the project file as in Linux i.e. folder1/dotnetapp.csproj or dotnetapp.csproj
30+
mainFileProjLabel: Visual Studio C# Project
31+
filesToProcess:
32+
- dotnetapp.csproj # relative path to the file as in Linux
33+
- Program.cs
34+
fileNameReplacement:
35+
- dotnetapp.csproj=%{project.name}.csproj # relative path to the file as in Linux
36+
- .gitignore_=.gitignore

0 commit comments

Comments
 (0)