diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..0e51c5f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +indent_size = 4 +indent_style = tab + +[*.{yml,yaml}] +indent_size = 2 +indent_style = space + +[*.clang-format] +indent_size = 2 +indent_style = space + +[*.{cc,hh,cpp,hpp,h,cpp}] +# matching .clang-format IndentWidth +indent_size = 2 +indent_style = tab diff --git a/.gitignore b/.gitignore index 589de76..78950a8 100644 --- a/.gitignore +++ b/.gitignore @@ -80,3 +80,6 @@ compile_commands.json # Generated Ecsact files Source/**/*.ecsact.* + +# Distribution +/Dist diff --git a/Config/FilterPlugin.ini b/Config/FilterPlugin.ini new file mode 100644 index 0000000..d552da1 --- /dev/null +++ b/Config/FilterPlugin.ini @@ -0,0 +1,8 @@ +[FilterPlugin] +; This section lists additional files which will be packaged along with your plugin. Paths should be listed relative to the root plugin directory, and +; may include "...", "*", and "?" wildcards to match directories, files, and individual characters respectively. +; +; Examples: +; /README.txt +; /Extras/... +; /Binaries/ThirdParty/*.dll diff --git a/EcsactNet.uplugin b/EcsactNet.uplugin index 1b01b18..797874d 100644 --- a/EcsactNet.uplugin +++ b/EcsactNet.uplugin @@ -13,7 +13,9 @@ "CanContainContent": true, "IsBetaVersion": true, "IsExperimentalVersion": false, - "Installed": false, + "Installed": true, + "EngineVersion": "5.5.0", + "EnabledByDefault": false, "Modules": [ { diff --git a/Tools/DevInstall.nu b/Tools/DevInstall.nu new file mode 100644 index 0000000..b1460b2 --- /dev/null +++ b/Tools/DevInstall.nu @@ -0,0 +1,12 @@ +use Package.nu package-plugin + +def main [--ue-install-dir: string] { + let info = package-plugin --ue-install-dir $ue_install_dir; + let engine_plugins_dir = [$info.ue_install, "Engine", "Plugins", "Marketplace"] | path join; + let plugin_extract_dir = [$engine_plugins_dir, $info.plugin_name] | path join; + + print $"Extracting ($info.plugin_name) to ($plugin_extract_dir)"; + mkdir $plugin_extract_dir; + tar -xf $info.plugin_archive -C $plugin_extract_dir; + print $"(ansi green)Unreal ($info.plugin_name) successfully installed to ($engine_plugins_dir)(ansi reset)"; +} diff --git a/Tools/Package.nu b/Tools/Package.nu new file mode 100644 index 0000000..a07ca6a --- /dev/null +++ b/Tools/Package.nu @@ -0,0 +1,73 @@ +def get-ue-install-dirs [] { + if (sys host | get name) != "Windows" { + print "Automatic unreal detection only supported on Windows" + print "Please specify the --ue-install-dir option" + exit 1 + } + + let eng_reg_version_keys = ^reg.exe query 'HKLM\SOFTWARE\EpicGames\Unreal Engine' | str trim | lines; + $eng_reg_version_keys | each {|key| + ^reg.exe query $key /v 'InstalledDirectory' | str trim | lines | get 1 | str trim | split column ' ' key type value | get value + } | flatten +} + +def get-ue-os [] { + match (sys host | get name) { + "Windows" => "Win64", + "Ubuntu" => "Linux", + _ => { + print $"unhandled host (sys host)" + exit 1 + } + } +} + +def ue-tool-extension [] { + match (sys host | get name) { + "Windows" => "bat", + _ => "sh", + } +} + +export def package-plugin [--ue-install-dir: string] { + let install_dirs = if $ue_install_dir != null { [$ue_install_dir] } else { get-ue-install-dirs }; + let plugin_dir = $env.FILE_PWD | path join '..' | path expand; + let dist_dir = [$plugin_dir, 'Dist'] | path join; + mkdir $dist_dir; + cd $plugin_dir; + let plugin_descriptor_filename = (ls *.uplugin).0.name; + let plugin_name = $plugin_descriptor_filename | split row ".uplugin" | get 0; + let dist_archive = [$plugin_dir, 'Dist', $"($plugin_name)Unreal-(get-ue-os).zip"] | path join; + let plugin_descriptor = [$plugin_dir, $plugin_descriptor_filename] | path join; + let temp_package_dir = mktemp -d --suffix $"($plugin_name)UnrealPluginPackage"; + + if ($install_dirs | length) == 0 { + print "Could not find Unreal Engine installation on your system"; + exit 1; + } + + let install_dir = if ($install_dirs | length) > 1 { + $install_dirs | input list + } else { + $install_dirs | get 0 + }; + + print $"using ($install_dir)"; + + let engine_dir = [$install_dir, 'Engine'] | path join; + let uat = [$engine_dir, 'Build', 'BatchFiles', $"RunUAT.(ue-tool-extension)"] | path join; + ^$uat BuildPlugin $"-Plugin=($plugin_descriptor)" $"-Package=($temp_package_dir)"; + + tar -a -cf $dist_archive -C $temp_package_dir '*'; + rm -rf $temp_package_dir; + + return { + ue_install: $install_dir, + plugin_name: $plugin_name, + plugin_archive: $dist_archive, + }; +} + +def main [--ue-install-dir: string] { + package-plugin --ue-install-dir $ue_install_dir +}