Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] Override default publish folder name #108

Open
GlebChili opened this issue Jul 18, 2021 · 5 comments
Open

[ENH] Override default publish folder name #108

GlebChili opened this issue Jul 18, 2021 · 5 comments
Assignees
Labels
enhancement New feature or request GmodNET.API Issue related to GmodNET.API
Milestone

Comments

@GlebChili
Copy link
Member

Description

When loading module by name, module and its dependencies must be placed in garrysmod/lua/bin/Modules/ModuleName where ModuleName is exactly module's main assembly name. Any typo in folder name will make module load process impossible. We can override default publish folder name from publish to publish/$(AssemblyName). For example, for a module with name TestModule, the output of dotnet publish TestModule.csproj -c Release will be located at bin\Debug\net5.0\publish\TestModule and one can simply copy folder to Modules or ship to another machine or user without fear of typos.

Technical implementation

We can add GmodNET.API.props file to a GmodNET.API NuGet package, so any project referencing API will have its publish dir name overridden. Since .props files are imported before the main body of the project file, developers can override publish dir name themself one more time.

@GlebChili GlebChili added enhancement New feature or request GmodNET.API Issue related to GmodNET.API labels Jul 18, 2021
@GlebChili GlebChili added this to the 0.7.0 milestone Jul 18, 2021
@GlebChili GlebChili self-assigned this Jul 18, 2021
@Stat1cV01D
Copy link
Contributor

Sure, why not. If it eliminates confusions then I am for it.

@SupinePandora43
Copy link
Member

What about having json file that specifies what assembly should be loaded?

@GlebChili
Copy link
Member Author

@SupinePandora43 What do you mean? Can you elaborate?

@luttje
Copy link
Contributor

luttje commented Jul 19, 2021

What about having json file that specifies what assembly should be loaded?

Do you mean to have the user add an additional configuration .json?

E.g: mymodule.json

{
    "startup": "MyDllName.dll"
}

?

If that is what you mean I'd be against that since it adds a layer of complexity. I agree with @Stat1cV01D that elimination of confusion is something to go for. I believe adding another json is just something else you can forget as a new developer.

@GlebChili
Copy link
Member Author

It seems like implementing this with only NuGet .props and .targets is not possible due to the properties evaluation order. We can fix achieve desired behavior by writing our own SDK, but this can wait for future releases.

@GlebChili GlebChili modified the milestones: 0.7.0, Future Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request GmodNET.API Issue related to GmodNET.API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants