Add optional param to specify scripting directory#2
Add optional param to specify scripting directory#2leojonathanoh wants to merge 7 commits intostartersclan:masterfrom
Conversation
ae6cfd0 to
9c40215
Compare
|
there are some false positives. Need to fix tests first |
6769c35 to
f43195a
Compare
|
warning, above green checks are false positives (false test passes) |
|
Actually, I need clarification on why the scripting directory should require specification. It is mandatory to specify the path to the script file via the |
Specifying the |
Correct me if I'm wrong, but say a plugin's script file by the name |
I'll give u an example. Say i have a plugin in Compile-SourceScript -File /home/username/myplugin.sp -ScriptingDirectory /home/username/sourcemod/scripting -Force -SkipWrapperwhere the plugin source lives outside the scripting directory, away from includes and the compiler. |
15b7d02 to
dfc41e5
Compare
|
I know I worked on this PR. And you happen to be working on it right now. Yet, the more time I spend supporting this feature request, the more it seems an unnecessary and confusing feature to have. Speaking of the default behavior of The first issue with If I think supporting this change requires more thought than it may seem to require. If anything, I think the module shouldn’t be overly restrictive as a compiling solution or make the mistake of becoming confusing to users. Remember that the compilers themselves take in parameters. I think anyone who sufficiently wishes to have their compile process customized (source file path, compiled directory path, installation/copy processes), may as well do so with their own scripts for directly invoking the compiler and not the compile wrapper. It would not surprise me if anyone would much rather do so than use |
|
Compile-SourceScript is a better wrapper than the included wrappers:
Would be better if the default behavior was |
I've indeed thought about having Another important reason for having provided the choice for invoking the compiler or the compiler wrapper is in how the plugin needn't be recompiled if possible. On Windows, |
Yes. It's is a better wrapper.
To me, tracking whether a source file has changed by modified date is not very reliable. Just do a git checkout on a source file that the "caching" behavior of using |
I know it isn't reliable, but it works pretty well especially on Windows, as I've found Unless the module transforms into a particularly intelligent wrapper script while maintaining ease of use, I doubt it would match up to users writing a simple script for invoking the compiler with exact precision without the need for PowerShell, |
We could support our own version of
yes. So the module should be solving problems for a majority of users, except those power users. It should not be too complicated. Even hacking up shell scripts will still have to deal juggling between using windows / nix compilers and their wrappers by checking for the platform, are less extensible, less testable, and is not as platform-agnostic as Powershell. |
This is a terrible idea. Proprietary files should be avoided at all costs.
So let's keep the module simple and straightforward to use. |
Agreed. But it would "cache" better than the original wrapper.
To keep it simple, |
I think you need to think things through instead of dishing out quick replies. As I've pointed out in #2 (comment), it's a good feature to support invocation of the wrapper script because it does provide some usefulness on Windows. An important behavior to note is, should the wrapper script be invoked causing all unspecified plugins to be compiled, all successfully compiled plugins will end up in the |
On windows one could do # By pipeline
Get-Item C:/path/to/scripting/*.sp | Compile-SourceScript -SkipWrapper -Force
# By array (not yet supported)
Compile-SourceScript -SourceFile (Get-Item C:/path/to/scripting/*.sp) -SkipWrapper -Forcewhich compiles all files in the
Yes, this is the one feature that differentiates this wrapper drastically from the original wrappers |
Yes, we can support piping and specification of multiple plugin source files in future.
The module also checks for differing hashes right before and after compilation. Due to the statefulness of the |
Yes, it is to be expected, much like
Yes, this interactive feature of being able to decide whether to compile and install or simply compile is another bonus of this wrapper. Would be good if the readme listed exactly how this module helps developer workflow. |
I'll say it's a neat feature to have, though not exactly useful since users would usually be compiling one plugin at a time.
Care to contribute what you can to the repo? |
I can contribute both PRs, but I fear merge conflicts, so i prefer to solve this PR as well as #7 first |
I think by now you already should know my stance on this PR. |
Not exactly clear. As you've mentioned further up in #2 (comment), adding |
You may wish to go over the thread carefully starting from #2 (comment). |
Let me break my responses to #2 (comment) down.
My opinion is simple, as you mentioned:, " Now
Following the same line of thought, if
The most intuitive way to use this module is: Get-Item C:/path/to/my.sp | Compile-SourceScript -Forcewhere, as i argued earlier, there is no support for native wrappers, and
So if you followed my arguments, as I mentioned in #2 (comment), whether this PR is implemented depends on whether Get-Item C:/path/to/my.sp | Compile-SourceScript -Force -ScriptingDirectory C:/path/to/some/compiler/scripting |
I'm going to highlight these issues one last time. @leojonathanoh |
If arguments for benefits of using First, the wrappers' behavior are inconsistent across platforms. While it is native to Second, the wrappers do not emit exit codes correctly. It is the responsibility of the native wrapper to collate each compile job's exit code and emit a final batch exit code that represents the fail jobs' exit codes. However
As I mentioned in #2 (comment) and #2 (comment), the |
|
It no longer looks like this feature is any more needed. Closing. |
Implements #1