-
-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to using publicized stubs as references
This will allow us to: * See private members in code directly. * Get notified by the IDE when a name is changed after an update. * Allow CI instances that do not have the game installed to build Nebula (so that we can use the Github CIs) Included is a .github\scripts\stub.js file that when ran from the project root will generate all of the references listed in references.txt. TODO: * Parse DevEnv.targets if it exists and use that for the DSP directory path. * Fix PlanetData.onLoaded ambiguity error in PlanetDataRequestProcessor.cs
- Loading branch information
1 parent
1403934
commit 6810ceb
Showing
57 changed files
with
283 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"esversion": 8 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"noImplicitAny": true, | ||
"removeComments": true, | ||
"sourceMap": true, | ||
"lib": [ | ||
"ESNext" | ||
] | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"type": "module", | ||
"dependencies": { | ||
"child_process": "^1.0.2", | ||
"fs": "^0.0.1-security", | ||
"path": "^0.12.7" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
#!/usr/bin/env node | ||
|
||
import { existsSync, fstat, mkdirSync, readFileSync } from "fs"; | ||
import { basename, dirname, extname, join, resolve } from "path"; | ||
import child_process from "child_process"; | ||
|
||
const DSP_DIR = | ||
"C:\\Program Files (x86)\\Steam\\steamapps\\common\\Dyson Sphere Program\\"; | ||
const BEPINEX_DIR = join(DSP_DIR, "BepInEx\\core\\"); | ||
const DSP_ASSEMBLY_DIR = join(DSP_DIR, "DSPGAME_Data\\Managed\\"); | ||
|
||
const refFile = readReferenceFile(); | ||
|
||
function main() { | ||
if (!existsSync("Libs")) { | ||
mkdirSync("Libs"); | ||
} | ||
publicizeReferenceAssemblies(getReferencePaths()); | ||
stubAssemblies(getReferencePaths()); | ||
} | ||
|
||
function readReferenceFile() { | ||
const refFile = readFileSync("references.txt", "utf8"); | ||
|
||
if (!refFile) { | ||
throw "Could not read references.txt"; | ||
} | ||
|
||
return refFile; | ||
} | ||
|
||
function getReferenceNames() { | ||
return refFile | ||
.replaceAll("$(BepInExDir)", "") | ||
.replaceAll("$(DSPAssemblyDir)", "") | ||
.replaceAll(".dll", "") | ||
.trim() | ||
.split("\n"); | ||
} | ||
|
||
function getReferencePaths() { | ||
return refFile | ||
.replaceAll("$(BepInExDir)", BEPINEX_DIR) | ||
.replaceAll("$(DSPAssemblyDir)", DSP_ASSEMBLY_DIR) | ||
.trim() | ||
.split("\n"); | ||
} | ||
|
||
function publicizeReferenceAssemblies(refPaths) { | ||
const ASSEMBLYPUBLICIZER_PATH = resolve( | ||
"Libs\\AssemblyPublicizer\\AssemblyPublicizer.exe" | ||
); | ||
Array.from(refPaths).forEach((line) => { | ||
child_process.execSync( | ||
'cd "' + | ||
dirname(line) + | ||
'" && "' + | ||
ASSEMBLYPUBLICIZER_PATH + | ||
'" "' + | ||
line + | ||
'"' | ||
); | ||
}); | ||
} | ||
|
||
function stubAssemblies(refPaths) { | ||
const REFASMER_PATH = | ||
'"' + resolve("Libs\\Refasmer.net461\\RefasmerExe.exe") + '"'; | ||
const LIBS_PATH = '"' + resolve("Libs\\") + '"'; | ||
Array.from(refPaths).forEach((line) => { | ||
const PUBLICIZED_ASSEMBLIES_PATH = | ||
'"' + dirname(line) + '\\publicized_assemblies\\"'; | ||
const PUBLICIZED_ASSEMBLY_PATH = | ||
'"' + | ||
dirname(line) + | ||
"\\publicized_assemblies\\" + | ||
basename(line).slice(0, basename(line).length - extname(line).length) + | ||
"_publicized" + | ||
extname(line); | ||
const cmd = | ||
"cd " + | ||
PUBLICIZED_ASSEMBLIES_PATH + | ||
" && " + | ||
REFASMER_PATH + | ||
" " + | ||
PUBLICIZED_ASSEMBLY_PATH + | ||
'" && move ' + | ||
PUBLICIZED_ASSEMBLY_PATH + | ||
'.refasm.dll" ' + | ||
LIBS_PATH; | ||
child_process.execSync(cmd); | ||
}); | ||
} | ||
|
||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.