Corregit resource_helper i millora DMG amb create-dmg
This commit is contained in:
79
Makefile
79
Makefile
@@ -224,6 +224,10 @@ macos_release:
|
|||||||
@$(MAKE) pack_tool
|
@$(MAKE) pack_tool
|
||||||
@$(MAKE) resources.pack
|
@$(MAKE) resources.pack
|
||||||
@echo "Creando release para macOS - Version: $(VERSION)"
|
@echo "Creando release para macOS - Version: $(VERSION)"
|
||||||
|
|
||||||
|
# Verificar e instalar create-dmg si es necesario
|
||||||
|
@which create-dmg > /dev/null || (echo "Instalando create-dmg..." && brew install create-dmg)
|
||||||
|
|
||||||
# Elimina datos de compilaciones anteriores
|
# Elimina datos de compilaciones anteriores
|
||||||
$(RMDIR) "$(RELEASE_FOLDER)"
|
$(RMDIR) "$(RELEASE_FOLDER)"
|
||||||
$(RMDIR) Frameworks
|
$(RMDIR) Frameworks
|
||||||
@@ -247,9 +251,6 @@ macos_release:
|
|||||||
cp LICENSE "$(RELEASE_FOLDER)"
|
cp LICENSE "$(RELEASE_FOLDER)"
|
||||||
cp README.md "$(RELEASE_FOLDER)"
|
cp README.md "$(RELEASE_FOLDER)"
|
||||||
|
|
||||||
# Crea enlaces
|
|
||||||
ln -s /Applications "$(RELEASE_FOLDER)"/Applications
|
|
||||||
|
|
||||||
# Compila la versión para procesadores Intel
|
# Compila la versión para procesadores Intel
|
||||||
ifdef ENABLE_MACOS_X86_64
|
ifdef ENABLE_MACOS_X86_64
|
||||||
$(CXX) $(APP_SOURCES) $(INCLUDES) -DMACOS_BUNDLE -DRELEASE_BUILD $(CXXFLAGS) $(LDFLAGS) -o "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/MacOS/$(TARGET_NAME)" -rpath @executable_path/../Frameworks/ -target x86_64-apple-macos10.15
|
$(CXX) $(APP_SOURCES) $(INCLUDES) -DMACOS_BUNDLE -DRELEASE_BUILD $(CXXFLAGS) $(LDFLAGS) -o "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/MacOS/$(TARGET_NAME)" -rpath @executable_path/../Frameworks/ -target x86_64-apple-macos10.15
|
||||||
@@ -257,27 +258,21 @@ ifdef ENABLE_MACOS_X86_64
|
|||||||
# Firma la aplicación
|
# Firma la aplicación
|
||||||
codesign --deep --force --sign - --timestamp=none "$(RELEASE_FOLDER)/$(APP_NAME).app"
|
codesign --deep --force --sign - --timestamp=none "$(RELEASE_FOLDER)/$(APP_NAME).app"
|
||||||
|
|
||||||
# Empaqueta el .dmg de la versión Intel
|
# Empaqueta el .dmg de la versión Intel con create-dmg
|
||||||
@echo "Creando DMG con iconos de 96x96..."
|
@echo "Creando DMG Intel con iconos de 96x96..."
|
||||||
hdiutil create tmp.dmg -ov -volname "$(APP_NAME)" -fs HFS+ -srcfolder "$(RELEASE_FOLDER)"
|
create-dmg \
|
||||||
hdiutil attach tmp.dmg -mountpoint /Volumes/"$(APP_NAME)"
|
--volname "$(APP_NAME)" \
|
||||||
osascript -e 'tell application "Finder"' \
|
--window-pos 200 120 \
|
||||||
-e 'tell disk "$(APP_NAME)"' \
|
--window-size 720 300 \
|
||||||
-e 'open' \
|
--icon-size 96 \
|
||||||
-e 'set current view of container window to icon view' \
|
--text-size 12 \
|
||||||
-e 'set toolbar visible of container window to false' \
|
--icon "$(APP_NAME).app" 278 102 \
|
||||||
-e 'set statusbar visible of container window to false' \
|
--icon "LICENSE" 441 102 \
|
||||||
-e 'set bounds of container window to {100, 100, 600, 400}' \
|
--icon "README.md" 604 102 \
|
||||||
-e 'set icon size of icon view options of container window to 96' \
|
--app-drop-link 115 102 \
|
||||||
-e 'set arrangement of icon view options of container window to not arranged' \
|
--hide-extension "$(APP_NAME).app" \
|
||||||
-e 'update without registering applications' \
|
"$(MACOS_INTEL_RELEASE)" \
|
||||||
-e 'close' \
|
"$(RELEASE_FOLDER)" || true
|
||||||
-e 'end tell' \
|
|
||||||
-e 'end tell'
|
|
||||||
sleep 2
|
|
||||||
hdiutil detach /Volumes/"$(APP_NAME)"
|
|
||||||
hdiutil convert tmp.dmg -format UDZO -o "$(MACOS_INTEL_RELEASE)"
|
|
||||||
$(RMFILE) tmp.dmg
|
|
||||||
@echo "Release Intel creado: $(MACOS_INTEL_RELEASE)"
|
@echo "Release Intel creado: $(MACOS_INTEL_RELEASE)"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -287,27 +282,21 @@ endif
|
|||||||
# Firma la aplicación
|
# Firma la aplicación
|
||||||
codesign --deep --force --sign - --timestamp=none "$(RELEASE_FOLDER)/$(APP_NAME).app"
|
codesign --deep --force --sign - --timestamp=none "$(RELEASE_FOLDER)/$(APP_NAME).app"
|
||||||
|
|
||||||
# Empaqueta el .dmg de la versión Apple Silicon
|
# Empaqueta el .dmg de la versión Apple Silicon con create-dmg
|
||||||
@echo "Creando DMG con iconos de 96x96..."
|
@echo "Creando DMG Apple Silicon con iconos de 96x96..."
|
||||||
hdiutil create tmp.dmg -ov -volname "$(APP_NAME)" -fs HFS+ -srcfolder "$(RELEASE_FOLDER)"
|
create-dmg \
|
||||||
hdiutil attach tmp.dmg -mountpoint /Volumes/"$(APP_NAME)"
|
--volname "$(APP_NAME)" \
|
||||||
osascript -e 'tell application "Finder"' \
|
--window-pos 200 120 \
|
||||||
-e 'tell disk "$(APP_NAME)"' \
|
--window-size 720 300 \
|
||||||
-e 'open' \
|
--icon-size 96 \
|
||||||
-e 'set current view of container window to icon view' \
|
--text-size 12 \
|
||||||
-e 'set toolbar visible of container window to false' \
|
--icon "$(APP_NAME).app" 278 102 \
|
||||||
-e 'set statusbar visible of container window to false' \
|
--icon "LICENSE" 441 102 \
|
||||||
-e 'set bounds of container window to {100, 100, 600, 400}' \
|
--icon "README.md" 604 102 \
|
||||||
-e 'set icon size of icon view options of container window to 96' \
|
--app-drop-link 115 102 \
|
||||||
-e 'set arrangement of icon view options of container window to not arranged' \
|
--hide-extension "$(APP_NAME).app" \
|
||||||
-e 'update without registering applications' \
|
"$(MACOS_APPLE_SILICON_RELEASE)" \
|
||||||
-e 'close' \
|
"$(RELEASE_FOLDER)" || true
|
||||||
-e 'end tell' \
|
|
||||||
-e 'end tell'
|
|
||||||
sleep 2
|
|
||||||
hdiutil detach /Volumes/"$(APP_NAME)"
|
|
||||||
hdiutil convert tmp.dmg -format UDZO -o "$(MACOS_APPLE_SILICON_RELEASE)"
|
|
||||||
$(RMFILE) tmp.dmg
|
|
||||||
@echo "Release Apple Silicon creado: $(MACOS_APPLE_SILICON_RELEASE)"
|
@echo "Release Apple Silicon creado: $(MACOS_APPLE_SILICON_RELEASE)"
|
||||||
|
|
||||||
# Elimina las carpetas temporales
|
# Elimina las carpetas temporales
|
||||||
|
|||||||
@@ -10,9 +10,9 @@
|
|||||||
namespace ResourceHelper {
|
namespace ResourceHelper {
|
||||||
static bool resource_system_initialized = false;
|
static bool resource_system_initialized = false;
|
||||||
|
|
||||||
auto initializeResourceSystem(const std::string& pack_file) -> bool {
|
auto initializeResourceSystem(const std::string& pack_file, bool enable_fallback) -> bool {
|
||||||
auto& loader = ResourceLoader::getInstance();
|
auto& loader = ResourceLoader::getInstance();
|
||||||
resource_system_initialized = loader.initialize(pack_file, true);
|
resource_system_initialized = loader.initialize(pack_file, enable_fallback);
|
||||||
|
|
||||||
if (resource_system_initialized) {
|
if (resource_system_initialized) {
|
||||||
std::cout << "Resource system initialized with pack: " << pack_file << '\n';
|
std::cout << "Resource system initialized with pack: " << pack_file << '\n';
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
// Helper functions para integrar ResourceLoader con el sistema existente
|
// Helper functions para integrar ResourceLoader con el sistema existente
|
||||||
namespace ResourceHelper {
|
namespace ResourceHelper {
|
||||||
// Inicializa ResourceLoader (llamar al inicio del programa)
|
// Inicializa ResourceLoader (llamar al inicio del programa)
|
||||||
auto initializeResourceSystem(const std::string& pack_file = "resources.pack") -> bool;
|
auto initializeResourceSystem(const std::string& pack_file = "resources.pack", bool enable_fallback = true) -> bool;
|
||||||
|
|
||||||
// Cierra ResourceLoader
|
// Cierra ResourceLoader
|
||||||
void shutdownResourceSystem();
|
void shutdownResourceSystem();
|
||||||
|
|||||||
Reference in New Issue
Block a user