Skip to content

Commit

Permalink
feat: Project File Generation (#96) and Pyro Compiler Integration
Browse files Browse the repository at this point in the history
* Commands for generating workspaces and .ppj files
* Compiler build task integration
  • Loading branch information
Robert Stone authored and joelday committed Nov 6, 2019
1 parent 38bad05 commit dd445b5
Show file tree
Hide file tree
Showing 28 changed files with 2,724 additions and 1,627 deletions.
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ build_script:
test: off
on_success:
- cmd: powershell ./build.ps1 --target="update-debug-plugin"
- cmd: powershell ./build.ps1 --target="update-pyro-cli"
- cmd: powershell ./build.ps1 --target="npm-semantic-release"
- ps: Invoke-RestMethod https://raw.githubusercontent.com/DiscordHooks/appveyor-discord-webhook/master/send.ps1 -o send.ps1
- ps: ./send.ps1 success $env:WEBHOOK_URL
Expand Down
22 changes: 21 additions & 1 deletion build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ var target = Argument("target", "default");
var solution = File("./DarkId.Papyrus.sln");

var pluginFileDirectory = Directory("src/papyrus-lang-vscode/debug-plugin/");
var pyroCliDirectory = Directory("src/papyrus-lang-vscode/pyro/");

var isCIBuild = EnvironmentVariable("APPVEYOR") == "true";

public void DownloadAndUnzip(string address, DirectoryPath outputPath, DirectoryPath existsPath)
Expand All @@ -28,11 +30,24 @@ public void UpdateDebugPlugin()
Force = true
});
}

var pluginDllZip = DownloadFile("https://github.com/joelday/papyrus-debug-server/releases/latest/download/papyrus-debug-server.zip");
Unzip(pluginDllZip, pluginFileDirectory);
}

public void UpdatePyroCli()
{
if (DirectoryExists(pyroCliDirectory))
{
DeleteDirectory(pyroCliDirectory, new DeleteDirectorySettings()
{
Recursive = true,
Force = true
});
}
var pyroCliZip = DownloadFile("https://github.com/rjstone/pyro/releases/download/1.3.3vsc.77/pyro_cli_v1-3-3vsc-77.zip");
Unzip(pyroCliZip, pyroCliDirectory);
}

Task("npm-install")
.Does(() => {
NpmInstall(new NpmInstallSettings()
Expand Down Expand Up @@ -82,6 +97,11 @@ Task("update-debug-plugin")
UpdateDebugPlugin();
});

Task("update-pyro-cli")
.Does(() => {
UpdatePyroCli();
});

Task("npm-semantic-release")
.Does(() => {
NpmRunScript(new NpmRunScriptSettings()
Expand Down
1 change: 1 addition & 0 deletions src/papyrus-lang-vscode/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
debug-bin
debug-plugin
pyro/
out
node_modules
.vscode-test/
Expand Down
3,267 changes: 1,912 additions & 1,355 deletions src/papyrus-lang-vscode/package-lock.json

Large diffs are not rendered by default.

202 changes: 184 additions & 18 deletions src/papyrus-lang-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,89 @@
]
}
],
"taskDefinitions": [
{
"type": "pyro",
"required": [
"ppj"
],
"properties": {
"ppj": {
"type": "string",
"description": "The path to the PPJ file relative to workspace folder (required)."
},
"game": {
"type": "string",
"description": "The game that the build task is for (optional, please specify in PPJ)."
},
"ini": {
"type": "string",
"description": "The path to the pyro.ini file (optional)."
},
"anonymize": {
"type": "boolean",
"description": "Run the anonymizer on files to remove personal info from output."
},
"index": {
"type": "boolean",
"description": "Run the 'indexer' for incremental builds."
},
"parallelize": {
"type": "boolean",
"description": "Use multiple CPUs to compile faster in parallel."
},
"archive": {
"type": "boolean",
"description": "Build BSA archives (not currently supported yet)"
}
}
},
{
"type": "papyrus",
"required": [
"game",
"sources"
],
"properties": {
"game": {
"type": "string",
"description": "game type to compile: fallout4, skyrim, skyrimSpecialEdition"
},
"imports": {
"type": "array",
"description": "list of import directories"
},
"sources": {
"type": "array",
"description": "list of files or source directories"
},
"output": {
"type": "string",
"description": "output directory"
}
}
}
],
"problemMatchers": [
{
"name": "PapyrusCompiler",
"owner": "external",
"fileLocation": "absolute",
"pattern": {
"regexp": "^(.*)\\((\\d+),(\\d+)\\):(.*)",
"file": 1,
"line": 2,
"column": 3,
"message": 4
}
}
],
"configuration": {
"properties": {
"papyrus.fallout4.enabled": {
"default": true,
"type": "boolean",
"description": "Enable support for Fallout 4."
"markdownDescription": "Enable suppot for **Fallout 4**. Use the [Generate Project Files](command:papyrus.fallout4.generateProject) command to set up builds and the language server."
},
"papyrus.fallout4.creationKitIniFiles": {
"default": [
Expand Down Expand Up @@ -167,7 +244,7 @@
"papyrus.skyrimSpecialEdition.enabled": {
"default": true,
"type": "boolean",
"description": "Enable support for Skyrim Special Edition."
"markdownDescription": "Enable support for **Skyrim Special Edition**. Use the [Generate Project Files](command:papyrus.skyrimSpecialEdition.generateProject) command to set up the language server and builds."
},
"papyrus.skyrimSpecialEdition.creationKitIniFiles": {
"default": [
Expand All @@ -194,6 +271,27 @@
"default": "",
"type": "string",
"description": "If you want to use a mod manager to manage the debugger plugin as a mod, set this to the path of the directory where installed mods for Skyrim SE are kept. Otherwise it will be installed in the game directory."
},
"papyrus.skyrimSpecialEdition.importDirs": {
"default": [
"${installPath}\\Data\\Source\\Scripts",
".\\Source\\Scripts"
],
"type": "array",
"items": {
"type": "string"
},
"description": "List of import (include) directories for scripts. This should include source directories. The language server will scan these."
},
"papyrus.skyrimSpecialEdition.sourceDirs": {
"default": [
".\\Source\\Scripts"
],
"type": "array",
"items": {
"type": "string"
},
"description": "List of source directories for scripts. Currently only the first one will be compiled by Compile All."
}
},
"title": "Papyrus",
Expand Down Expand Up @@ -287,9 +385,56 @@
"category": "Papyrus",
"command": "papyrus.viewAssembly",
"title": "View Papyrus Assembly"
},
{
"category": "Papyrus",
"command": "papyrus.skyrimSpecialEdition.generateProject",
"title": "Generate Skyrim Special Edition Project Files"
},
{
"category": "Papyrus",
"command": "papyrus.fallout4.generateProject",
"title": "Generate Fallout 4 Project Files"
},
{
"category": "Papyrus",
"command": "papyrus.projectImports",
"title": "Project imports (For substitution)"
},
{
"category": "Papyrus",
"command": "papyrus.projectSources",
"title": "Project sources (for substitutuion)"
},
{
"category": "Papyrus",
"command": "papyrus.projectSources0",
"title": "First project source dir (for substitutuion)"
}
],
"menus": {
"commandPalette": [
{
"command": "papyrus.projectImports",
"when": "false"
},
{
"command": "papyrus.projectSources",
"when": "false"
},
{
"command": "papyrus.projectSources0",
"when": "false"
},
{
"command": "papyrus.viewAssembly",
"when": "false"
},
{
"command": "papyrus.searchCreationKitWiki",
"when": "false"
}
],
"editor/context": [
{
"command": "papyrus.searchCreationKitWiki",
Expand All @@ -307,6 +452,26 @@
"command": "papyrus.viewAssembly",
"group": "a_papyrus",
"when": "resourceLangId == papyrus"
},
{
"command": "papyrus.skyrimSpecialEdition.generateProject",
"group": "a_papyrus",
"when": "config.papyrus.skyrimSpecialEdition.enabled && explorerResourceIsFolder"
},
{
"command": "papyrus.fallout4.generateProject",
"group": "a_papyrus",
"when": "config.papyrus.fallout4.enabled && explorerResourceIsFolder"
}
],
"view/title": [
{
"command": "papyrus.fallout4.generateProject",
"when": "view == papyrus-projects"
},
{
"command": "papyrus.skyrimSpecialEdition.generateProject",
"when": "view == papyrus-projects"
}
]
},
Expand Down Expand Up @@ -346,37 +511,38 @@
],
"dependencies": {
"decoration-ioc": "^2.1.0",
"deepmerge": "^3.2.1",
"deepmerge": "^3.3.0",
"fast-deep-equal": "^2.0.1",
"ini": "^1.3.5",
"md5-file": "^4.0.0",
"ps-list": "^6.3.0",
"rxjs": "^6.5.2",
"vscode-debugprotocol": "^1.35.0",
"rxjs": "^6.5.3",
"vsce": "^1.69.0",
"vscode-debugprotocol": "^1.37.0",
"vscode-languageclient": "^5.2.1",
"winreg": "^1.2.4",
"xml-writer": "^1.7.0"
},
"description": "Advanced language support for Bethesda Game Studio's Papyrus scripting language.",
"devDependencies": {
"@semantic-release/changelog": "^3.0.4",
"@semantic-release/git": "^7.0.12",
"@semantic-release/changelog": "^3.0.5",
"@semantic-release/git": "^7.0.17",
"@types/ini": "^1.3.30",
"@types/mocha": "^5.2.7",
"@types/node": "^12.0.8",
"@types/node": "^12.12.5",
"@types/winreg": "^1.2.30",
"cpr": "^3.0.1",
"fork-ts-checker-webpack-plugin": "^1.3.7",
"fork-ts-checker-webpack-plugin": "^1.6.0",
"prettier": "^1.18.2",
"rimraf": "^2.6.3",
"semantic-release": "^15.13.24",
"rimraf": "^2.7.1",
"semantic-release": "^15.13.30",
"semantic-release-vsce": "^2.2.8",
"ts-loader": "^6.0.2",
"tslint": "^5.17.0",
"typescript": "^3.5.2",
"vscode": "^1.1.34",
"webpack": "^4.34.0",
"webpack-cli": "^3.3.4"
"ts-loader": "^6.2.1",
"tslint": "^5.20.0",
"typescript": "^3.6.4",
"vscode": "^1.1.36",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10"
},
"displayName": "Papyrus",
"engines": {
Expand Down Expand Up @@ -457,4 +623,4 @@
"arrowParens": "always",
"printWidth": 120
}
}
}
13 changes: 13 additions & 0 deletions src/papyrus-lang-vscode/resources/fo4/Fallout4.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
// created by vscode papyrus-lang papyrus.skyrimSpecialEdition.generateProject
"folders": [
{
"path": "."
}
],
"settings": {
"papyrus.fallout4.enabled": true,
"papyrus.skyrim.enabled": false,
"papyrus.skyrimSpecialEdition.enabled": false
}
}
23 changes: 23 additions & 0 deletions src/papyrus-lang-vscode/resources/fo4/fallout4.ppj
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version='1.0'?>
<!-- Created by vscode papyrus-lang papyrus.fallout4.generateProject -->
<PapyrusProject xmlns="PapyrusProject.xsd"
Flags="Institute_Papyrus_Flags.flg"
Output="..\..\"
Asm="Discard"
Optimize="false"
Release="false"
Final="false">
<Imports>
<Import>.</Import>
<Import>..\DLC06</Import>
<Import>..\DLC05</Import>
<Import>..\DLC04</Import>
<Import>..\DLC03</Import>
<Import>..\DLC02</Import>
<Import>..\DLC01</Import>
<Import>..\Base</Import>
</Imports>
<Folders>
<Folder>.</Folder>
</Folders>
</PapyrusProject>
22 changes: 22 additions & 0 deletions src/papyrus-lang-vscode/resources/fo4/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
// created by vscode papyrus-lang papyrus.skyrimSpecialEdition.generateProject
"version": "0.2.0",
"configurations": [
{
"name": "Fallout 4",
"type": "papyrus",
"request": "attach",
"game": "fallout4"
},
{
"label": "Fallout 4 (use .ppj)",
"body": {
"name": "Fallout 4 Project",
"type": "papyrus",
"request": "attach",
"game": "fallout4",
"projectPath": "${workspaceRoot}\\Scripts\\Source\\User\\fallout4.ppj"
}
}
]
}
Loading

0 comments on commit dd445b5

Please sign in to comment.