Skip to content

Commit 85c304e

Browse files
committed
Add local bonsai bootstrapper
1 parent ac2e9f5 commit 85c304e

6 files changed

Lines changed: 88 additions & 2 deletions

File tree

.bonsai/Bonsai.config

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<PackageConfiguration xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3+
<Packages>
4+
<Package id="Bonsai" version="2.8.2" />
5+
<Package id="Bonsai.Core" version="2.8.1" />
6+
<Package id="Bonsai.Design" version="2.8.0" />
7+
<Package id="Bonsai.Editor" version="2.8.1" />
8+
<Package id="jacobslusser.ScintillaNET" version="3.6.3" />
9+
<Package id="Markdig" version="0.18.1" />
10+
<Package id="Microsoft.Web.WebView2" version="1.0.1823.32" />
11+
<Package id="Rx-Core" version="2.2.5" />
12+
<Package id="Rx-Interfaces" version="2.2.5" />
13+
<Package id="Rx-Linq" version="2.2.5" />
14+
<Package id="Rx-PlatformServices" version="2.2.5" />
15+
<Package id="SvgNet" version="3.3.3" />
16+
<Package id="YamlDotNet" version="13.1.1" />
17+
</Packages>
18+
<AssemblyReferences>
19+
<AssemblyReference assemblyName="Bonsai" />
20+
<AssemblyReference assemblyName="Bonsai.Core" />
21+
<AssemblyReference assemblyName="Bonsai.Design" />
22+
<AssemblyReference assemblyName="Bonsai.Editor" />
23+
</AssemblyReferences>
24+
<AssemblyLocations>
25+
<AssemblyLocation assemblyName="Bonsai" processorArchitecture="MSIL" location="Packages\Bonsai.2.8.2\lib\net48\Bonsai.exe" />
26+
<AssemblyLocation assemblyName="Bonsai.Core" processorArchitecture="MSIL" location="Packages\Bonsai.Core.2.8.1\lib\net462\Bonsai.Core.dll" />
27+
<AssemblyLocation assemblyName="Bonsai.Design" processorArchitecture="MSIL" location="Packages\Bonsai.Design.2.8.0\lib\net462\Bonsai.Design.dll" />
28+
<AssemblyLocation assemblyName="Bonsai.Editor" processorArchitecture="MSIL" location="Packages\Bonsai.Editor.2.8.1\lib\net472\Bonsai.Editor.dll" />
29+
<AssemblyLocation assemblyName="Markdig" processorArchitecture="MSIL" location="Packages\Markdig.0.18.1\lib\net40\Markdig.dll" />
30+
<AssemblyLocation assemblyName="Microsoft.Web.WebView2.Core" processorArchitecture="MSIL" location="Packages\Microsoft.Web.WebView2.1.0.1823.32\lib\net45\Microsoft.Web.WebView2.Core.dll" />
31+
<AssemblyLocation assemblyName="Microsoft.Web.WebView2.WinForms" processorArchitecture="MSIL" location="Packages\Microsoft.Web.WebView2.1.0.1823.32\lib\net45\Microsoft.Web.WebView2.WinForms.dll" />
32+
<AssemblyLocation assemblyName="Microsoft.Web.WebView2.Wpf" processorArchitecture="MSIL" location="Packages\Microsoft.Web.WebView2.1.0.1823.32\lib\net45\Microsoft.Web.WebView2.Wpf.dll" />
33+
<AssemblyLocation assemblyName="ScintillaNET" processorArchitecture="MSIL" location="Packages\jacobslusser.ScintillaNET.3.6.3\lib\net40\ScintillaNET.dll" />
34+
<AssemblyLocation assemblyName="SVG" processorArchitecture="MSIL" location="Packages\SvgNet.3.3.3\lib\net462\SVG.dll" />
35+
<AssemblyLocation assemblyName="System.Reactive.Core" processorArchitecture="MSIL" location="Packages\Rx-Core.2.2.5\lib\net45\System.Reactive.Core.dll" />
36+
<AssemblyLocation assemblyName="System.Reactive.Interfaces" processorArchitecture="MSIL" location="Packages\Rx-Interfaces.2.2.5\lib\net45\System.Reactive.Interfaces.dll" />
37+
<AssemblyLocation assemblyName="System.Reactive.Linq" processorArchitecture="MSIL" location="Packages\Rx-Linq.2.2.5\lib\net45\System.Reactive.Linq.dll" />
38+
<AssemblyLocation assemblyName="System.Reactive.PlatformServices" processorArchitecture="MSIL" location="Packages\Rx-PlatformServices.2.2.5\lib\net45\System.Reactive.PlatformServices.dll" />
39+
<AssemblyLocation assemblyName="YamlDotNet" processorArchitecture="MSIL" location="Packages\YamlDotNet.13.1.1\lib\net47\YamlDotNet.dll" />
40+
</AssemblyLocations>
41+
<LibraryFolders>
42+
<LibraryFolder path="Packages\Microsoft.Web.WebView2.1.0.1823.32\runtimes\win-arm64\native" platform="arm64" />
43+
<LibraryFolder path="Packages\Microsoft.Web.WebView2.1.0.1823.32\runtimes\win-arm64\native_uap" platform="arm64" />
44+
<LibraryFolder path="Packages\Microsoft.Web.WebView2.1.0.1823.32\runtimes\win-x64\native" platform="x64" />
45+
<LibraryFolder path="Packages\Microsoft.Web.WebView2.1.0.1823.32\runtimes\win-x64\native_uap" platform="x64" />
46+
<LibraryFolder path="Packages\Microsoft.Web.WebView2.1.0.1823.32\runtimes\win-x86\native" platform="x86" />
47+
<LibraryFolder path="Packages\Microsoft.Web.WebView2.1.0.1823.32\runtimes\win-x86\native_uap" platform="x86" />
48+
</LibraryFolders>
49+
</PackageConfiguration>

.bonsai/NuGet.config

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<add key="Gallery" value="Gallery" />
5+
<add key="Bonsai Packages" value="https://www.myget.org/F/bonsai/api/v3/index.json" />
6+
<add key="Community Packages" value="https://www.myget.org/F/bonsai-community/api/v3/index.json" />
7+
</packageSources>
8+
</configuration>

.bonsai/Setup.cmd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@echo off
2+
pushd %~dp0
3+
powershell -ExecutionPolicy Bypass -File ./Setup.ps1
4+
popd

.bonsai/Setup.ps1

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Push-Location $PSScriptRoot
2+
if (!(Test-Path "./Bonsai.exe")) {
3+
$release = "https://github.com/bonsai-rx/bonsai/releases/latest/download/Bonsai.zip"
4+
$configPath = "./Bonsai.config"
5+
if (Test-Path $configPath) {
6+
[xml]$config = Get-Content $configPath
7+
$bootstrapper = $config.PackageConfiguration.Packages.Package.where{$_.id -eq 'Bonsai'}
8+
if ($bootstrapper) {
9+
$version = $bootstrapper.version
10+
$release = "https://github.com/bonsai-rx/bonsai/releases/download/$version/Bonsai.zip"
11+
}
12+
}
13+
Invoke-WebRequest $release -OutFile "temp.zip"
14+
Move-Item -Path "NuGet.config" "temp.config" -ErrorAction SilentlyContinue
15+
Expand-Archive "temp.zip" -DestinationPath "." -Force
16+
Move-Item -Path "temp.config" "NuGet.config" -Force -ErrorAction SilentlyContinue
17+
Remove-Item -Path "temp.zip"
18+
Remove-Item -Path "Bonsai32.exe"
19+
}
20+
& .\Bonsai.exe --no-editor
21+
Pop-Location

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
.vs
22
bin
33
obj
4+
Packages
5+
*.exe
6+
*.exe.*
47
*.user
58
*.suo

src/Bonsai.Scripting.Python/Properties/launchSettings.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
"profiles": {
33
"Bonsai": {
44
"commandName": "Executable",
5-
"executablePath": "$(registry:HKEY_CURRENT_USER\\Software\\Goncalo Lopes\\Bonsai@InstallDir)Bonsai.exe",
6-
"commandLineArgs": "--lib:$(TargetDir)."
5+
"executablePath": "$(SolutionDir)..\\.bonsai\\Bonsai.exe",
6+
"commandLineArgs": "--lib:\"$(TargetDir).\"",
7+
"nativeDebugging": true
78
}
89
}
910
}

0 commit comments

Comments
 (0)