Skip to content

Commit

Permalink
Add multi platform support (#28)
Browse files Browse the repository at this point in the history
* Ensure npm watch is executed before browserify

- the browserify task depends on the code that is generated by npm watch

* Enable code visualization for Windows

* Don't remove the media directory

- Shell commands for deleting / creating a directory are OS dependent
- Therefore, remove the commands and consistently keep the media dir

* Add install note for macOS users

* Add media directory to repository

* Add new release notes
  • Loading branch information
OliverStolzBO authored Jul 8, 2024
1 parent 2a4b883 commit 3374a60
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 15 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ out
node_modules
.vscode-test
coverage
media
client/bundle.js
package-lock.json
2 changes: 1 addition & 1 deletion .ort.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ excludes:
curations:
license_findings:
- path: "README.md"
start_lines: 262
start_lines: 270
line_count: 1
detected_license: "LGPL-2.0-or-later"
reason: "DOCUMENTATION_OF"
Expand Down
8 changes: 2 additions & 6 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,10 @@
"type": "npm",
"script": "browserify"
},
{
"type": "shell",
"label": "remove_dot_files",
"command": "rm -rf ./media && mkdir media"
},
{
"label": "prepare_and_watch",
"dependsOn": ["browserify", "remove_dot_files", "npm_watch"]
"dependsOrder": "sequence",
"dependsOn": ["npm_watch", "browserify"]
}
]
}
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,16 @@ To install the extension, use the already built extension file in the build fold

- [Python](https://www.python.org/) (>= v3.10)
- [GraphViz](https://graphviz.org/) (>= v2.42.2)
- Pip packages from requirements.txt(install with `pip install -r requirements.txt`)
- Pip packages from requirements.txt (install with `pip install -r requirements.txt`)

- [ANTLR4](https://github.com/antlr/antlr4) (== v4.9.3)
- [antlr-denter](https://github.com/yshavit/antlr-denter) (>=v1.3.1)
- [SNAKES](https://github.com/fpom/snakes) (>=v0.9.30)

- (For development only) [NodeJS](https://nodejs.org/en/) (>=v18.17.1)

> **NOTE:** The pip packages must be accessible to the extension. Especially on macOS, consider installing them globally by adding the `--break-system-packages` flag.
### Install from VSIX file

Installing the extension from an already built VSIX file is the easiest and fastest way to test the extension. Find the current version as the artifact of the newest build pipeline in the repository. Then just open the Extensions tab in VS Code and find the dialogue shown in the image below.
Expand Down Expand Up @@ -257,6 +261,10 @@ Note that the copyright information of this project found by ORT are not complet
- Achieve REUSE compliance for the project
- Add github workflows

### v0.1.2

- Enable multi-platform support

## License

VS Code Extension for the Production Flow Description Language (PFDL) is licensed under the MIT License. See [LICENSE](LICENSE) for details on the licensing terms.
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "The VSCode client that listens for PFDL language server events",
"author": "Oliver Stolz and Maximilian Hörstrup",
"license": "MIT",
"version": "0.1.0",
"version": "0.1.2",
"publisher": "fraunhofer",
"repository": {
"type": "git",
Expand Down
12 changes: 9 additions & 3 deletions client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function activate(context: ExtensionContext) {
const fs = require('fs');

// the filepath where the dotfile is saved. Create if not already exists
const mediaPath = __dirname + '/../../media/';
const mediaPath = path.join(__dirname, '..', '..', 'media');
if (!fs.existsSync(mediaPath)) {
fs.mkdir(mediaPath, (err) => {
throw err;
Expand Down Expand Up @@ -254,11 +254,17 @@ export function activate(context: ExtensionContext) {
* @returns AN array containing the filename (without ending) and the complete filepath to the dotfile
*/
function getDotFilenameAndPathFromPfdlFilepath(filepath: string) {
// for Linux / macOS
let pathDivider = '/';
if (!filepath.includes('/')) {
// for Windows operating systems
pathDivider = '\\';
}
const filename = filepath.substring(
filepath.lastIndexOf('/') + 1, // where the filename starts
filepath.lastIndexOf(pathDivider) + 1, // where the filename starts
filepath.length - 5 // cut off the file ending (.pfdl)
);
return [filename, mediaPath + filename + '.dot'];
return [filename, path.join(mediaPath, filename + '.dot')];
}

/**
Expand Down
6 changes: 6 additions & 0 deletions media/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# SPDX-FileCopyrightText: The PFDL VS Code Extension Contributors
# SPDX-License-Identifier: CC0-1.0

# Ignore all files in the media directory except the .gitignore itself
*
!.gitignore
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "A VS Code extension to support syntax highlighting, formatting and code visualization for the Production Flow Description Language (PFDL) files",
"author": "Oliver Stolz and Maximilian Hörstrup",
"license": "MIT",
"version": "0.1.0",
"version": "0.1.2",
"repository": {
"type": "git",
"url": "https://github.com/iml130/pfdl-vscode-extension"
Expand Down
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pfdl-laguage-server",
"description": "Implementation of a language server supporting the Production Flow Description Language (PFDL) in node.",
"version": "0.1.0",
"version": "0.1.2",
"author": "Oliver Stolz and Maximilian Hörstrup",
"license": "MIT",
"engines": {
Expand Down

0 comments on commit 3374a60

Please sign in to comment.