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

Output into subfolder #66

Open
climblinne opened this issue Feb 22, 2021 · 2 comments
Open

Output into subfolder #66

climblinne opened this issue Feb 22, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@climblinne
Copy link
Contributor

Hello,

is there an easy way to put the assembly (and their dependencies & runtime config) into a separate subfolder, when calling it from the native binary library?

May be as a MSBuild property?

Thanks

@AaronRobinsonMSFT
Copy link
Owner

is there an easy way to put the assembly (and their dependencies & runtime config) into a separate subfolder, when calling it from the native binary library?

Not really at present. This involves understanding how a user wants to deploy the generated managed/native pair. It would introduce some serious complexity into the system to support such an option. I think it would better to file an issue and push the single file scenario for Class Libraries/Components. Right now it is only for Applications.

See #30

@AaronRobinsonMSFT AaronRobinsonMSFT added the enhancement New feature or request label Feb 22, 2021
@climblinne
Copy link
Contributor Author

climblinne commented Feb 22, 2021

Yes, I think you are right. I just patched my DNNE to link to a subfolder with the assembly name. The copy have to be done manual.
Not ideal, but it works for myself at the moment.

index 1563879..ad2a26a 100644
--- "a/src/platform/platform.c"
+++ "b/src/platform/platform.c"
@@ -161,6 +161,7 @@ typedef int (CORECLR_DELEGATE_CALLTYPE* component_entry_point_fn)(void* arg, int
 
 #define DNNE_NORETURN __declspec(noreturn)
 #define DNNE_DIR_SEPARATOR L'\\'
+#define DNNE_DIR_SEPARATOR_STR L"\\"
 
 static void* load_library(const char_t* path)
 {
@@ -213,6 +214,7 @@ static int get_this_image_path(int32_t buffer_len, char_t* buffer, int32_t* writ
 
 #define DNNE_NORETURN __attribute__((__noreturn__))
 #define DNNE_DIR_SEPARATOR '/'
+#define DNNE_DIR_SEPARATOR_STR L"/"
 
 static void* load_library(const char_t* path)
 {
@@ -382,7 +384,7 @@ static void prepare_runtime(void)
 
     // Initialize and start the runtime.
     char_t buffer[DNNE_MAX_PATH];
-    const char_t config_filename[] = DNNE_STR(DNNE_TOSTRING(DNNE_ASSEMBLY_NAME)) DNNE_STR(".runtimeconfig.json");
+    const char_t config_filename[] = DNNE_STR(DNNE_TOSTRING(DNNE_ASSEMBLY_NAME)) DNNE_DIR_SEPARATOR_STR DNNE_STR(DNNE_TOSTRING(DNNE_ASSEMBLY_NAME))  DNNE_STR(".runtimeconfig.json");
     const char_t* config_path = NULL;
     int rc = get_current_dir_filepath(DNNE_ARRAY_SIZE(buffer), buffer, DNNE_ARRAY_SIZE(config_filename), config_filename, &config_path);
     if (is_failure(rc))
@@ -412,7 +414,7 @@ void* get_callable_managed_function(
     }
 
     char_t buffer[DNNE_MAX_PATH];
-    const char_t assembly_filename[] = DNNE_STR(DNNE_TOSTRING(DNNE_ASSEMBLY_NAME)) DNNE_STR(".dll");
+    const char_t assembly_filename[] = DNNE_STR(DNNE_TOSTRING(DNNE_ASSEMBLY_NAME)) DNNE_DIR_SEPARATOR_STR DNNE_STR(DNNE_TOSTRING(DNNE_ASSEMBLY_NAME))  DNNE_STR(".dll");
     const char_t* assembly_path = NULL;
     int rc = get_current_dir_filepath(DNNE_ARRAY_SIZE(buffer), buffer, DNNE_ARRAY_SIZE(assembly_filename), assembly_filename, &assembly_path);
     if (is_failure(rc))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants