diff --git a/.github/workflows/rhinoplugin.yml b/.github/workflows/rhinoplugin.yml index a784ba9..010ecb4 100644 --- a/.github/workflows/rhinoplugin.yml +++ b/.github/workflows/rhinoplugin.yml @@ -29,4 +29,4 @@ jobs: uses: actions/upload-artifact@v2 with: name: ScriptSync.rhp - path: ./CsRhino/bin/Release/net48/ScriptSync.rhp \ No newline at end of file + path: ./CsRhino/bin/Release/net48/ \ No newline at end of file diff --git a/RELEASE.md b/RELEASE.md index 8a19560..ea598b0 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -39,7 +39,7 @@ icon: logo.png ``` Now, create the `.yak` package by running the following command in the terminal: ```terminal -yak build script_sync-1.0.2-rh8-win +yak build ``` The `.yak` package is created in the folder `script_sync-1.0.2-rh8-win.yak`. @@ -58,6 +58,14 @@ Script-sync is released as a `.vsix` package via the VSCE executable provided by ### Build the VSCode extension Start by building the VSCode extension as described in the [contribution guideline](#contribution-guideline). OR, grab the latest version of the extension from the artifacts of the latest successful build on the latest e.g., [CI](https://github.com/ibois-epfl/script-sync/actions/runs/7349030262). +Make sure to change the correct version number in the `package.json` file. +```json + "version": "1.1.4", + "engines": { + "vscode": "^1.85.0" + }, +``` + ### Publish the `.vsix` package to the VSCode marketplace To upload the package to the VSCode marketplace, run the following command in the terminal in the folder containing the `.vsix` file: ```terminal diff --git a/VSCode/scriptsync/package.json b/VSCode/scriptsync/package.json index b67afbb..60b157d 100644 --- a/VSCode/scriptsync/package.json +++ b/VSCode/scriptsync/package.json @@ -11,7 +11,7 @@ "type": "git", "url": "https://github.com/ibois-epfl/script-sync" }, - "version": "1.1.3", + "version": "1.1.4", "engines": { "vscode": "^1.85.0" }, diff --git a/invokes/yakerize.py b/invokes/yakerize.py new file mode 100644 index 0000000..e7516fb --- /dev/null +++ b/invokes/yakerize.py @@ -0,0 +1,34 @@ +#! python3 + +""" + This script collects all the files needed to create the yak package. +""" + +from invoke import run +import os + + +# Run a command just like you would in the shell +result = run("dir", hide=True, warn=True) + +# You can check if the command was successful +if result.ok: + # print it in green + print("\033[92mCommand succeeded\033[0m") +else: + print("\033[91mCommand failed\033[0m") + +# print(secret) +# # You can access the output of the command +# print("Command output was:") +# print(result.stdout) + +############################################ + +path_rhldir : str = "./" + +# copy the yaker directory to the build folder +result = run("cd yaker", hide=True, warn=True) +# result = run("cd", hide=False, warn=True) + +# get the rhino .rhp and its dependencies diff --git a/tasks.py b/tasks.py new file mode 100644 index 0000000..83ba9cd --- /dev/null +++ b/tasks.py @@ -0,0 +1,9 @@ +# tasks.py +from invoke import task + +@task +def yakerize(c): + path_yakerize : str = "./invokes/yakerize.py" + c.run(f"python {path_yakerize}") + +#access a repository secret \ No newline at end of file diff --git a/yaker/DocoptNet.dll b/yaker/exec/DocoptNet.dll similarity index 100% rename from yaker/DocoptNet.dll rename to yaker/exec/DocoptNet.dll diff --git a/yaker/Newtonsoft.Json.Rhino.dll b/yaker/exec/Newtonsoft.Json.Rhino.dll similarity index 100% rename from yaker/Newtonsoft.Json.Rhino.dll rename to yaker/exec/Newtonsoft.Json.Rhino.dll diff --git a/yaker/Yak.Core.dll b/yaker/exec/Yak.Core.dll similarity index 100% rename from yaker/Yak.Core.dll rename to yaker/exec/Yak.Core.dll diff --git a/yaker/Yak.exe b/yaker/exec/Yak.exe similarity index 100% rename from yaker/Yak.exe rename to yaker/exec/Yak.exe diff --git a/yaker/YamlDotNet.dll b/yaker/exec/YamlDotNet.dll similarity index 100% rename from yaker/YamlDotNet.dll rename to yaker/exec/YamlDotNet.dll diff --git a/yaker/exec/script-sync-1.1.4-rh8-any/Newtonsoft.Json.dll b/yaker/exec/script-sync-1.1.4-rh8-any/Newtonsoft.Json.dll new file mode 100644 index 0000000..597a1ce Binary files /dev/null and b/yaker/exec/script-sync-1.1.4-rh8-any/Newtonsoft.Json.dll differ diff --git a/yaker/exec/script-sync-1.1.4-rh8-any/System.Net.Http.Formatting.dll b/yaker/exec/script-sync-1.1.4-rh8-any/System.Net.Http.Formatting.dll new file mode 100644 index 0000000..24673e1 Binary files /dev/null and b/yaker/exec/script-sync-1.1.4-rh8-any/System.Net.Http.Formatting.dll differ diff --git a/yaker/exec/script-sync-1.1.4-rh8-any/logo.png b/yaker/exec/script-sync-1.1.4-rh8-any/logo.png new file mode 100644 index 0000000..8ddfb45 Binary files /dev/null and b/yaker/exec/script-sync-1.1.4-rh8-any/logo.png differ diff --git a/yaker/exec/script-sync-1.1.4-rh8-any/manifest.yml b/yaker/exec/script-sync-1.1.4-rh8-any/manifest.yml new file mode 100644 index 0000000..e9bc73f --- /dev/null +++ b/yaker/exec/script-sync-1.1.4-rh8-any/manifest.yml @@ -0,0 +1,16 @@ +--- +name: script-sync +version: 1.1.4 +authors: +- Andrea Settimi +description: Script-sync is a Rhino plug-in to run C# and Python (IronPython or CPython) in RhinoV8. +url: https://github.com/ibois-epfl/script-sync +keywords: +- Rhino +- Cs +- Python +- IronPython +- CPython +- VScode +- Utility +icon: logo.png diff --git a/yaker/exec/script-sync-1.1.4-rh8-any/misc/LICENSE.md b/yaker/exec/script-sync-1.1.4-rh8-any/misc/LICENSE.md new file mode 100644 index 0000000..94c24d4 --- /dev/null +++ b/yaker/exec/script-sync-1.1.4-rh8-any/misc/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Laboratory for Timber Constructions IBOIS, EPFL + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/yaker/exec/script-sync-1.1.4-rh8-any/misc/README.md b/yaker/exec/script-sync-1.1.4-rh8-any/misc/README.md new file mode 100644 index 0000000..2b0bdcc --- /dev/null +++ b/yaker/exec/script-sync-1.1.4-rh8-any/misc/README.md @@ -0,0 +1,59 @@ +
+ +
+ +# script-sync + +This repository contains the code and Rhino plug-in to run C# and Python (IronPython or CPython) in RhinoV8. + +![record_vid_gif20fps](https://github.com/ibois-epfl/script-sync/assets/50238678/7ccb2aa5-e646-45cd-9657-95776d24a48a) + +## Features +To start `script-sync` in RhinoV8, run the command `ScriptSyncStart` in RhinoV8. This will start a server that listens to commands from VSCode. + +Open a `.py` or `.cs` file in VSCode and run it in RhinoV8 by pressing `F4`. +Add a `shebang` to the first line of the file to specify the Python interpreter to use, e.g.: +* `#!python3` to interpret it with CPython +* `#!python2` to interpret it with IronPython + +To close `script-sync` in RhinoV8, run the command `ScriptSyncStop` in RhinoV8. + +## Requirements +The plug-in needs to be installed on RhinoV8. + +## Caveats +There is no intellisense for C# and Python in VSCode. + +## Release Notes + +### 1.0.0 + +First release of script-sync: it can run C# and Python (IronPython or CPython) in RhinoV8 from VSCode. It is only tested on Windows. +* Extension for VSCode +* Rhino plug-in with basic commands to start/stop script-sync server +* basic documentation + +## References + +There are a lot of plug-ins that allow to run Python in Rhino. Among them, [CodeListener](https://github.com/ccc159/CodeListener) was working until RhinoV8 and it was a source of inspiration for this project. This is a simplified version, but it can run `C#` and both `IronPython` and `CPython` in RhinoV8. + +## Citation +This project is part of the research activities of the [IBOIS lab](https://www.epfl.ch/labs/ibois/) at EPFL. It was developed by [Andrea Settimi](https://github.com/9and3). + + +## For more information + +* [GitHub repo](https://github.com/ibois-epfl/script-sync) +* [IBOIS GitHub organization](https://github.com/ibois-epfl) +* [IBOIS lab page](https://www.epfl.ch/labs/ibois/) + + +## Roadmap +- [ ] publish yak package + auto pipeline +- [ ] publish on tools website lab +- [ ] add instructions for dev and contribution +- [ ] add icons +- [ ] write ci +- [ ] write tests +- [ ] ci action to publish automatic releases +- [ ] possibly redirect output from RhinoApp.RunScript() to vscode consoles or log file \ No newline at end of file diff --git a/yaker/exec/script-sync-1.1.4-rh8-any/scriptsynccpy.ghuser b/yaker/exec/script-sync-1.1.4-rh8-any/scriptsynccpy.ghuser new file mode 100644 index 0000000..83f6735 Binary files /dev/null and b/yaker/exec/script-sync-1.1.4-rh8-any/scriptsynccpy.ghuser differ diff --git a/yaker/logo.png b/yaker/logo.png new file mode 100644 index 0000000..8ddfb45 Binary files /dev/null and b/yaker/logo.png differ diff --git a/yaker/manifest.yml b/yaker/manifest.yml new file mode 100644 index 0000000..e9bc73f --- /dev/null +++ b/yaker/manifest.yml @@ -0,0 +1,16 @@ +--- +name: script-sync +version: 1.1.4 +authors: +- Andrea Settimi +description: Script-sync is a Rhino plug-in to run C# and Python (IronPython or CPython) in RhinoV8. +url: https://github.com/ibois-epfl/script-sync +keywords: +- Rhino +- Cs +- Python +- IronPython +- CPython +- VScode +- Utility +icon: logo.png