From c025ac50f1c2927f7ec802c8ae368bd37e9bdc78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Kuklau?= Date: Sun, 10 Mar 2024 22:49:02 +0100 Subject: [PATCH 1/2] wip xcodegen fixes for .help --- MastonautHelp/Makefile | 11 +++++++---- project.yml | 30 ++++++++++++++++-------------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/MastonautHelp/Makefile b/MastonautHelp/Makefile index acd7af6..802c3dc 100644 --- a/MastonautHelp/Makefile +++ b/MastonautHelp/Makefile @@ -10,14 +10,14 @@ $(DESTINATION) : * **/* [[ -s "$(HOME)/.rvm/environments/default" ]] && source "$(HOME)/.rvm/environments/default" ; \ (which -s jekyll || (echo "error: Jekyll not found - check setup requirements" ; false )) \ && jekyll build - + echo "Destination: $(HELP)" # check for things like broken links htmlproofer --allow-missing-href _site - - cp -R _site "$(DESTINATION)" - + + cp -R _site/ "$(DESTINATION)" + for LPROJ in "$(DESTINATION)"/*.lproj ; do \ LOCALE=$$(basename "$$LPROJ" .lproj) ; \ echo "Indexing: $$LPROJ" ; \ @@ -25,3 +25,6 @@ $(DESTINATION) : * **/* hiutil -I corespotlight -1 -vv --create --anchors --locale=$$LOCALE --file "$$LPROJ/search.cshelpindex" "$$LPROJ" 2>&1 | \ awk "{ if (/error:/) {printf \"error: \" ; err = 1} else {printf \"warning: \"} ; print} END {exit err}" ; \ done + + # hack: this dir should not exist + rm -r "$(DESTINATION)/_English.lproj" diff --git a/project.yml b/project.yml index c2a5749..12792f2 100644 --- a/project.yml +++ b/project.yml @@ -69,8 +69,8 @@ targets: AUTH_URL_SCHEME: "mastonaut-auth" preBuildScripts: - script: | - BUNDLE_VERSION=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' $SRCROOT/Mastonaut/Supporting\ Files/Info.plist) - echo "#define BUNDLE_VERSION \"$MARKETING_VERSION\"" > $DERIVED_FILE_DIR/BundleVersions.h + BUNDLE_VERSION=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' $SRCROOT/Mastonaut/Supporting\ Files/Info.plist) + echo "#define BUNDLE_VERSION \"$MARKETING_VERSION\"" > $DERIVED_FILE_DIR/BundleVersions.h inputFiles: - "$(SRCROOT)/Mastonaut/Supporting Files/Info.plist" outputFiles: @@ -136,8 +136,8 @@ targets: platform: macOS preBuildScripts: - script: | - "$PROJECT_DIR/Mastonaut/Supporting Files/BuildConfig.sh" \ - > "${PROJECT_DIR}/CoreTootin/Supporting Files/BuildConfig.generated.swift" + "$PROJECT_DIR/Mastonaut/Supporting Files/BuildConfig.sh" \ + > "${PROJECT_DIR}/CoreTootin/Supporting Files/BuildConfig.generated.swift" outputFiles: - "${PROJECT_DIR}/CoreTootin/Supporting Files/BuildConfig.generated.swift" name: "Apply Build Config (Run Script)" @@ -167,7 +167,7 @@ targets: platform: macOS settings: base: - PRODUCT_BUNDLE_IDENTIFIER: "$(MASTONAUT_BUNDLE_ID_BASE).mac.QuickToot" + PRODUCT_BUNDLE_IDENTIFIER: "$(MASTONAUT_BUNDLE_ID_BASE).mac.MastonautHelp" WRAPPER_EXTENSION: "help" sources: - path: MastonautHelp/book-icon.png @@ -176,17 +176,19 @@ targets: - path: MastonautHelp/_English.lproj/InfoPlist.strings postBuildScripts: - script: | - cd MastonautHelp + cd MastonautHelp - # purge help cache - hiutil -P + # purge help cache + hiutil -P - source /opt/homebrew/opt/chruby/share/chruby/chruby.sh - source /opt/homebrew/opt/chruby/share/chruby/auto.sh - chruby ruby-3.1.3 + source /opt/homebrew/opt/chruby/share/chruby/chruby.sh + source /opt/homebrew/opt/chruby/share/chruby/auto.sh + chruby ruby-3.1.3 - /usr/bin/make + /usr/bin/make --always-make name: "Build Help (Run Script)" + outputFiles: + - "_site/nav.js" PullRefreshableScrollView: type: framework platform: macOS @@ -194,8 +196,8 @@ targets: base: OTHER_LDFLAGS: "" # prevent framework autolink (Xcode 15A240d) sources: - - path: Dependencies/PullRefreshableScrollView/PullRefreshableScrollView - group: Dependencies + - path: Dependencies/PullRefreshableScrollView/PullRefreshableScrollView + group: Dependencies schemes: Mastonaut: From ba79e5a3fd7853cf5cd4a69172ab9fcff4110a9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Kuklau?= Date: Wed, 13 Mar 2024 03:56:39 +0100 Subject: [PATCH 2/2] emit Help's Info.plist entirely from XcodeGen; also, it now works --- .gitignore | 1 + MastonautHelp/Info.plist | 20 -------------------- project.yml | 13 +++++++++++-- 3 files changed, 12 insertions(+), 22 deletions(-) delete mode 100644 MastonautHelp/Info.plist diff --git a/.gitignore b/.gitignore index 7f15ef5..42631db 100644 --- a/.gitignore +++ b/.gitignore @@ -65,3 +65,4 @@ xcuserdata/ *.generated.swift userspecific.xcconfig Mastonaut.xcodeproj +MastonautHelp/Info.plist diff --git a/MastonautHelp/Info.plist b/MastonautHelp/Info.plist deleted file mode 100644 index eb446d4..0000000 --- a/MastonautHelp/Info.plist +++ /dev/null @@ -1,20 +0,0 @@ - - - - - CFBundleSignature - hbwr - HPDBookAccessPath - index.html - HPDBookCSIndexPath - search.cshelpindex - HPDBookIconPath - book-icon.png - HPDBookIndexPath - search.helpindex - HPDBookTitle - $(PROJECT_NAME) Help - HPDBookType - 3 - - diff --git a/project.yml b/project.yml index 12792f2..3372bb2 100644 --- a/project.yml +++ b/project.yml @@ -165,13 +165,22 @@ targets: MastonautHelp: type: bundle platform: macOS + info: + path: MastonautHelp/Info.plist + properties: + CFBundleSignature: "hbwr" + HPDBookAccessPath: "index.html" + HPDBookCSIndexPath: "search.cshelpindex" + HPDBookIconPath: "book-icon.png" + HPDBookIndexPath: "search.helpindex" + HPDBookTitle: "$(PROJECT_NAME) Help" + HPDBookType: "3" settings: base: - PRODUCT_BUNDLE_IDENTIFIER: "$(MASTONAUT_BUNDLE_ID_BASE).mac.MastonautHelp" + PRODUCT_BUNDLE_IDENTIFIER: "$(MASTONAUT_BUNDLE_ID_BASE).MastonautHelp" WRAPPER_EXTENSION: "help" sources: - path: MastonautHelp/book-icon.png - - path: MastonautHelp/Info.plist - path: MastonautHelp/nav.js - path: MastonautHelp/_English.lproj/InfoPlist.strings postBuildScripts: