Skip to content

Commit

Permalink
➕ Compile time, Release mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiirx committed Mar 20, 2024
1 parent 515d7ef commit ec0644c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 17 deletions.
12 changes: 6 additions & 6 deletions Docs/articles/Installation/DevKit.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Dev Kit Installation
# Dev Kit Installation

## Windows

### Prerequisites

* (Free) source code of Development Kit from [Cosmos on GitHub](https://github.com/CosmosOS/Cosmos)
* You must clone the repository using Git. For a detailed walkthrough, [see here](https://help.github.com/articles/fork-a-repo/).
* (Free) [Visual Studio 2022 Community](https://visualstudio.microsoft.com/vs/)
* (Free) [Visual Studio 2022 Community](https://visualstudio.microsoft.com/vs/)
* (Free) [InnoSetup](http://www.jrsoftware.org/isdl.php#qsp)
* This is required to build the setup kit which is used to build and install the Visual Studio integration libaries for Cosmos.
* During install it will ask you about optional components to install. Be sure you check "Install Inno Setup Preprocessor".
Expand Down Expand Up @@ -53,7 +53,7 @@ This will take a while. If there is no error, you successfully installed Cosmos

if you are using custom cosmos repos you will need to clone them all manually as the installer script will pull from https://github.com/CosmosOS/

A tree diagram of the source should look like the following:
A tree diagram of the source should look like the following:

<img src="https://raw.githubusercontent.com/CosmosOS/Cosmos/master/Docs/images/Dir.png" width="200">

Expand All @@ -71,6 +71,6 @@ you may need to clear you nuget cache try ``dotnet clean`` to clear the project
if you have more then 1 version of visual studio installed this can bug this follow "dotnet Project Templates" should fix it

### dotnet Project Templates
If you are using linux or prefer not using Visual Studio for your projects, you can install the dotnet project template using `dotnet new --install ./source/templates/csharp/` assuming you are currently in the Cosmos base directory.
After installing the template use `dotnet new cosmosCSKernel -n {name}` to create a new Cosmos Kernel project.
The dotnet template can be removed at a later time using `dotnet new --uninstall ./source/templates/csharp/`.
If you are using linux or prefer not using Visual Studio for your projects, you can install the dotnet project template using `dotnet new install ./source/templates/csharp/` assuming you are currently in the Cosmos base directory.
After installing the template use `dotnet new cosmosCSKernel -n {name}` to create a new Cosmos Kernel project.
The dotnet template can be removed at a later time using `dotnet new uninstall ./source/templates/csharp/`.
37 changes: 26 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,28 @@ COMMON_DIR = $(THISDIR)/../Common
GIT = git
DOTNET = dotnet

BUILDMODE=Release
GITFLAGS = clone --depth=1
DOTNETFLAGS = -nologo -v:q -c:Debug

DOTNETFLAGS = -nologo -v:q -c:$(BUILDMODE)
GREEN = \033[0;32m
YELLOW = \033[1;33m
DEFAULT = \033[0m

date = $(date +%F%T)

.PHONY: all
all: $(IL2CPU_DIR) $(XSHARP_DIR) $(COMMON_DIR)
@printf "${YELLOW}Cosmos${DEFAULT} DevKit Installer\n"
@printf "${date}\n"
@# Elapsed time is stored in a temporary file, deleted post-install.
@date +%s > _time_$@.txt
@$(MAKE) build
@$(MAKE) publish
@sudo $(MAKE) install
@$(MAKE) nuget-install
@$(MAKE) template-install
@printf "To create a Cosmos kernel, run \'dotnet new cosmosCSKernel -n \{name\}\''
@printf "Build log file saved to ${GREEN}$(THISDIR)/build${date}.log${DEFAULT}\n"
@printf "============================================\n"
@printf "| ${YELLOW}Cosmos${DEFAULT} has been installed successfully! |\n"
@printf "============================================\n"
Expand Down Expand Up @@ -118,19 +125,19 @@ install:
@mkdir -p $(DESTDIR)/Build/VMware/Workstation
@mkdir -p $(DESTDIR)/Packages
@mkdir -p $(DESTDIR)/Kernel
@cp -r $(IL2CPU_DIR)/artifacts/Release/nupkg/*.nupkg $(DESTDIR)/Packages/
@cp -r $(THISDIR)/artifacts/Release/nupkg/*.nupkg $(DESTDIR)/Packages/
@cp -r $(XSHARP_DIR)/artifacts/Release/nupkg/*.nupkg $(DESTDIR)/Packages/
@cp -r $(IL2CPU_DIR)/artifacts/$(BUILDMODE)/nupkg/*.nupkg $(DESTDIR)/Packages/
@cp -r $(THISDIR)/artifacts/$(BUILDMODE)/nupkg/*.nupkg $(DESTDIR)/Packages/
@cp -r $(XSHARP_DIR)/artifacts/$(BUILDMODE)/nupkg/*.nupkg $(DESTDIR)/Packages/
@cp -r $(IL2CPU_DIR)/source/Cosmos.Core.DebugStub/*.xs $(DESTDIR)/XSharp/DebugStub/

@cp -r $(THISDIR)/Artwork/XSharp/XSharp.ico $(DESTDIR)/XSharp/
@cp -r $(THISDIR)/Artwork/Cosmos.ico $(DESTDIR)/

@cp -r $(IL2CPU_DIR)/source/IL2CPU/bin/Debug/*/linux-x64/publish/* $(DESTDIR)/Build/IL2CPU/
@cp -r $(THISDIR)/source/Cosmos.Core_Plugs/bin/Debug/*/publish/*.dll $(DESTDIR)/Kernel/
@cp -r $(THISDIR)/source/Cosmos.System2_Plugs/bin/Debug/*/publish/*.dll $(DESTDIR)/Kernel/
@cp -r $(THISDIR)/source/Cosmos.HAL2/bin/Debug/*/publish/*.dll $(DESTDIR)/Kernel/
@cp -r $(THISDIR)/source/Cosmos.Debug.Kernel.Plugs.Asm/bin/Debug/netstandard2.0/publish/*.dll $(DESTDIR)/Kernel/
@cp -r $(IL2CPU_DIR)/source/IL2CPU/bin/$(BUILDMODE)/*/linux-x64/publish/* $(DESTDIR)/Build/IL2CPU/
@cp -r $(THISDIR)/source/Cosmos.Core_Plugs/bin/$(BUILDMODE)/*/publish/*.dll $(DESTDIR)/Kernel/
@cp -r $(THISDIR)/source/Cosmos.System2_Plugs/bin/$(BUILDMODE)/*/publish/*.dll $(DESTDIR)/Kernel/
@cp -r $(THISDIR)/source/Cosmos.HAL2/bin/$(BUILDMODE)/*/publish/*.dll $(DESTDIR)/Kernel/
@cp -r $(THISDIR)/source/Cosmos.Debug.Kernel.Plugs.Asm/bin/$(BUILDMODE)/netstandard2.0/publish/*.dll $(DESTDIR)/Kernel/

@cp -r $(THISDIR)/Build/HyperV/*.vhdx $(DESTDIR)/Build/HyperV/
@cp -r $(THISDIR)/Build/VMWare/Workstation/* $(DESTDIR)/Build/VMware/Workstation/
Expand All @@ -145,4 +152,12 @@ nuget-install:
@rm -r -f ~/.nuget/packages/il2cpu.*/

@$(DOTNET) nuget remove source "Cosmos Local Package Feed" || true
@$(DOTNET) nuget add source $(DESTDIR)/Packages/ -n "Cosmos Local Package Feed"
@$(DOTNET) nuget add source $(DESTDIR)/Packages/ -n "Cosmos Local Package Feed"

.PHONY: template-install
template-install:
@printf "Installing ${GREEN}C# Template packages${DEFAULT}\n"
@-dotnet new uninstall $(THISDIR)/source/templates/csharp/
@printf "If the template was not installed, you can ignore this"
@dotnet new install $(THISDIR)/source/templates/csharp/
#TODO: Uninstall

0 comments on commit ec0644c

Please sign in to comment.