From 76ca7e369f35d2b471b42ac528c6e92df009228a Mon Sep 17 00:00:00 2001 From: Cyberarm Date: Fri, 18 Mar 2022 18:33:44 -0500 Subject: [PATCH] Added packaging support for windows (windows is still glitchy/crashy when it comes to downloading images) --- .gitignore | 1 + Gemfile | 5 +++++ Gemfile.lock | 12 ++++++------ Rakefile | 23 +++++++++++++++++++++++ w3d_hub_linux_launcher.rb | 2 +- 5 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 Rakefile diff --git a/.gitignore b/.gitignore index bfdc770..e922e54 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +pkg/ *.json data/cache/* !data/cache/.gitkeep diff --git a/Gemfile b/Gemfile index 2b6d51c..dbf5a76 100644 --- a/Gemfile +++ b/Gemfile @@ -10,3 +10,8 @@ gem "async", "~>1.30.1" gem "async-http" gem "async-websocket" gem "thread-local" + +# group :windows_packaging do +# gem "rake" +# gem "releasy" +# end diff --git a/Gemfile.lock b/Gemfile.lock index 2e628ca..3e78819 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -14,7 +14,7 @@ GEM protocol-http (~> 0.22.0) protocol-http1 (~> 0.14.0) protocol-http2 (~> 0.14.0) - async-io (1.32.2) + async-io (1.33.0) async async-pool (0.3.9) async (>= 1.25) @@ -26,21 +26,21 @@ GEM concurrent-ruby (1.1.9) console (1.14.0) fiber-local - cyberarm_engine (0.19.1) - clipboard (~> 1.3.5) - excon (~> 0.78.0) + cyberarm_engine (0.20.0) + clipboard (~> 1.3) + excon (~> 0.88) gosu (~> 1.1) gosu_more_drawables (~> 0.3) digest-crc (0.6.4) rake (>= 12.0.0, < 14.0.0) - excon (0.78.1) + excon (0.92.0) ffi (1.15.5) ffi (1.15.5-x64-mingw-ucrt) ffi (1.15.5-x64-mingw32) fiber-local (1.0.0) gosu (1.4.1) gosu_more_drawables (0.3.1) - i18n (1.9.1) + i18n (1.10.0) concurrent-ruby (~> 1.0) launchy (2.5.0) addressable (~> 2.7) diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..6efb8b7 --- /dev/null +++ b/Rakefile @@ -0,0 +1,23 @@ +raise "OCRA doesn't work with Ruby 3.1.0" if RUBY_VERSION == "3.1.0" + +# frozen_string_literal: true + +require "releasy" +require "bundler/setup" # Releasy requires that your application uses bundler. +require_relative "lib/version" + +Releasy::Project.new do + name "W3D Hub Linux Launcher" + version W3DHub::VERSION + + executable "w3d_hub_linux_launcher.rb" + files ["lib/**/*.*", "locales/*", "media/**/**", "data/.gitkeep", "data/cache/.gitkeep"] + exclude_encoding # Applications that don't use advanced encoding (e.g. Japanese characters) can save build size with this. + verbose + + add_build :windows_folder do + icon "media/icons/app.ico" + executable_type :console # Assuming you don't want it to run with a console window. + add_package :exe # Windows self-extracting archive. + end +end \ No newline at end of file diff --git a/w3d_hub_linux_launcher.rb b/w3d_hub_linux_launcher.rb index bb369d0..88b5168 100644 --- a/w3d_hub_linux_launcher.rb +++ b/w3d_hub_linux_launcher.rb @@ -87,4 +87,4 @@ Thread.new do W3DHub::BackgroundWorker.create end -W3DHub::Window.new(width: 980, height: 720, borderless: false).show +W3DHub::Window.new(width: 980, height: 720, borderless: false).show unless defined?(Ocra)