diff --git a/GPGPreferences.xcodeproj/project.pbxproj b/GPGPreferences.xcodeproj/project.pbxproj index b9c2d56..24319e5 100644 --- a/GPGPreferences.xcodeproj/project.pbxproj +++ b/GPGPreferences.xcodeproj/project.pbxproj @@ -8,7 +8,6 @@ /* Begin PBXBuildFile section */ 3006E02019D1C7D300D819D3 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3056D0D1172D31B500CFC0FA /* Sparkle.framework */; }; - 300DD0F21853AEE60057B05F /* How to get the source code in Resources */ = {isa = PBXBuildFile; fileRef = 300DD0F11853AEE60057B05F /* How to get the source code */; }; 3016A62C17522E0F00701881 /* gpgservices.png in Resources */ = {isa = PBXBuildFile; fileRef = 3016A62B17522E0F00701881 /* gpgservices.png */; }; 3016A62E1752300E00701881 /* GPGTools.iconset in Resources */ = {isa = PBXBuildFile; fileRef = 3016A62D1752300E00701881 /* GPGTools.iconset */; }; 3016A634175230CC00701881 /* gka-gray.png in Resources */ = {isa = PBXBuildFile; fileRef = 3016A62F175230CC00701881 /* gka-gray.png */; }; @@ -40,41 +39,48 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 301AE8D417A1997F00CD277F /* PBXContainerItemProxy */ = { + 1B3EAB311A975FD3005A444E /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 301AE8CC17A1997F00CD277F /* Libmacgpg.xcodeproj */; proxyType = 2; remoteGlobalIDString = 8DC2EF5B0486A6940098B216; remoteInfo = Libmacgpg; }; - 301AE8D617A1997F00CD277F /* PBXContainerItemProxy */ = { + 1B3EAB331A975FD3005A444E /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 301AE8CC17A1997F00CD277F /* Libmacgpg.xcodeproj */; proxyType = 2; remoteGlobalIDString = 30C8B38E139503A800F49AA1; remoteInfo = UnitTest; }; - 301AE8D817A1997F00CD277F /* PBXContainerItemProxy */ = { + 1B3EAB351A975FD3005A444E /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 301AE8CC17A1997F00CD277F /* Libmacgpg.xcodeproj */; proxyType = 2; remoteGlobalIDString = 1B46CFCC161555DF00CF9C5F; remoteInfo = org.gpgtools.Libmacgpg.xpc; }; - 301AE8DA17A1997F00CD277F /* PBXContainerItemProxy */ = { + 1B3EAB371A975FD3005A444E /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 301AE8CC17A1997F00CD277F /* Libmacgpg.xcodeproj */; proxyType = 2; remoteGlobalIDString = 30DF7CB816D39EAA00C8225C; remoteInfo = installerHelper; }; - 301AE8DC17A1997F00CD277F /* PBXContainerItemProxy */ = { + 1B3EAB391A975FD3005A444E /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 301AE8CC17A1997F00CD277F /* Libmacgpg.xcodeproj */; proxyType = 2; remoteGlobalIDString = 1BD78B9F1726B2820005F251; remoteInfo = LeakFinder; }; + 1BEC7A4C1A976E430006FAF6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 301AE8CC17A1997F00CD277F /* Libmacgpg.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 8DC2EF4F0486A6940098B216; + remoteInfo = Libmacgpg; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -99,7 +105,7 @@ 3016A630175230CC00701881 /* gpgmail-gray.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "gpgmail-gray.png"; path = "Images/gpgmail-gray.png"; sourceTree = ""; }; 3016A632175230CC00701881 /* gpgservices-gray.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "gpgservices-gray.png"; path = "Images/gpgservices-gray.png"; sourceTree = ""; }; 3016A633175230CC00701881 /* macgpg2-gray.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "macgpg2-gray.png"; path = "Images/macgpg2-gray.png"; sourceTree = ""; }; - 301AE8CC17A1997F00CD277F /* Libmacgpg.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Libmacgpg.xcodeproj; path = ../Libmacgpg/Libmacgpg.xcodeproj; sourceTree = ""; }; + 301AE8CC17A1997F00CD277F /* Libmacgpg.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Libmacgpg.xcodeproj; path = Dependencies/Libmacgpg/Libmacgpg.xcodeproj; sourceTree = ""; }; 304031041923AC4500955DBC /* NSButton_LinkCursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSButton_LinkCursor.h; sourceTree = ""; }; 304031051923AC4500955DBC /* NSButton_LinkCursor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSButton_LinkCursor.m; sourceTree = ""; }; 3056D051172D2EEA00CFC0FA /* GPGPreferences.prefPane */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GPGPreferences.prefPane; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -152,14 +158,14 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 301AE8CD17A1997F00CD277F /* Products */ = { + 1B3EAB2A1A975FD3005A444E /* Products */ = { isa = PBXGroup; children = ( - 301AE8D517A1997F00CD277F /* Libmacgpg.framework */, - 301AE8D717A1997F00CD277F /* UnitTest.octest */, - 301AE8D917A1997F00CD277F /* org.gpgtools.Libmacgpg.xpc */, - 301AE8DB17A1997F00CD277F /* installerHelper */, - 301AE8DD17A1997F00CD277F /* LeakFinder.app */, + 1B3EAB321A975FD3005A444E /* Libmacgpg.framework */, + 1B3EAB341A975FD3005A444E /* UnitTest.octest */, + 1B3EAB361A975FD3005A444E /* org.gpgtools.Libmacgpg.xpc */, + 1B3EAB381A975FD3005A444E /* installerHelper */, + 1B3EAB3A1A975FD3005A444E /* LeakFinder.app */, ); name = Products; sourceTree = ""; @@ -298,10 +304,12 @@ 3056D04E172D2EEA00CFC0FA /* Resources */, 3056D0D3172D320800CFC0FA /* Copy Frameworks */, 3056D0DA172D330100CFC0FA /* Fill Info.plist */, + 1B49BC681A978529000440E9 /* ShellScript */, ); buildRules = ( ); dependencies = ( + 1BEC7A4D1A976E430006FAF6 /* PBXTargetDependency */, ); name = GPGPreferences; productName = GPGPreferences; @@ -329,7 +337,7 @@ projectDirPath = ""; projectReferences = ( { - ProductGroup = 301AE8CD17A1997F00CD277F /* Products */; + ProductGroup = 1B3EAB2A1A975FD3005A444E /* Products */; ProjectRef = 301AE8CC17A1997F00CD277F /* Libmacgpg.xcodeproj */; }, ); @@ -341,39 +349,39 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 301AE8D517A1997F00CD277F /* Libmacgpg.framework */ = { + 1B3EAB321A975FD3005A444E /* Libmacgpg.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; path = Libmacgpg.framework; - remoteRef = 301AE8D417A1997F00CD277F /* PBXContainerItemProxy */; + remoteRef = 1B3EAB311A975FD3005A444E /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 301AE8D717A1997F00CD277F /* UnitTest.octest */ = { + 1B3EAB341A975FD3005A444E /* UnitTest.octest */ = { isa = PBXReferenceProxy; fileType = wrapper.cfbundle; path = UnitTest.octest; - remoteRef = 301AE8D617A1997F00CD277F /* PBXContainerItemProxy */; + remoteRef = 1B3EAB331A975FD3005A444E /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 301AE8D917A1997F00CD277F /* org.gpgtools.Libmacgpg.xpc */ = { + 1B3EAB361A975FD3005A444E /* org.gpgtools.Libmacgpg.xpc */ = { isa = PBXReferenceProxy; fileType = "compiled.mach-o.executable"; path = org.gpgtools.Libmacgpg.xpc; - remoteRef = 301AE8D817A1997F00CD277F /* PBXContainerItemProxy */; + remoteRef = 1B3EAB351A975FD3005A444E /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 301AE8DB17A1997F00CD277F /* installerHelper */ = { + 1B3EAB381A975FD3005A444E /* installerHelper */ = { isa = PBXReferenceProxy; fileType = "compiled.mach-o.executable"; path = installerHelper; - remoteRef = 301AE8DA17A1997F00CD277F /* PBXContainerItemProxy */; + remoteRef = 1B3EAB371A975FD3005A444E /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 301AE8DD17A1997F00CD277F /* LeakFinder.app */ = { + 1B3EAB3A1A975FD3005A444E /* LeakFinder.app */ = { isa = PBXReferenceProxy; fileType = wrapper.application; path = LeakFinder.app; - remoteRef = 301AE8DC17A1997F00CD277F /* PBXContainerItemProxy */; + remoteRef = 1B3EAB391A975FD3005A444E /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ @@ -387,7 +395,6 @@ 30FDA7FF1784644100B58E01 /* WarningView.xib in Resources */, 3056D0A8172D305E00CFC0FA /* gka.png in Resources */, 3056D0A9172D305E00CFC0FA /* gpgmail.png in Resources */, - 300DD0F21853AEE60057B05F /* How to get the source code in Resources */, 3056D0AA172D305E00CFC0FA /* gpgprefs.png in Resources */, 3056D0AE172D305E00CFC0FA /* macgpg2.png in Resources */, 3056D0B1172D306600CFC0FA /* GPGToolsPref.xib in Resources */, @@ -408,6 +415,19 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 1B49BC681A978529000440E9 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "HOWTO_PATH=\"./Dependencies/GPGTools_Core/resources/How to get the source code\"\n[[ -f \"$HOWTO_PATH\" ]] || exit 0\n\ncp -R \"$HOWTO_PATH\" \"$BUILT_PRODUCTS_DIR/GPGPreferences.prefPane/Contents/Resources/\""; + }; 3056D0DA172D330100CFC0FA /* Fill Info.plist */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -420,7 +440,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "source \"$SRCROOT/Makefile.config\" || exit 1\n\nPLIST=\"$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH\"\n\n/usr/libexec/PlistBuddy -c \"Set CommitHash \\\"$commitHash\\\"\" -c \"Set BuildNumber \\\"$buildNumber\\\"\" -c \"Set CFBundleVersion \\\"$build_version\\\"\" -c \"Set CFBundleShortVersionString \\\"$version\\\"\" \"$PLIST\" || exit 2\n"; + shellScript = "source \"$SRCROOT/Makefile.config\" || exit 1\n\nPLIST=\"$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH\"\nBUILD_NUMBER=${BUILD_NUMBER:-0}\n\n/usr/libexec/PlistBuddy -c \"Set CommitHash '$COMMIT_HASH'\" -c \"Set BuildNumber '$BUILD_NUMBER'\" -c \"Set CFBundleVersion '$BUILD_VERSION'\" -c \"Set CFBundleShortVersionString '$VERSION'\" \"$PLIST\" || exit 2\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -440,6 +460,14 @@ }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + 1BEC7A4D1A976E430006FAF6 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Libmacgpg; + targetProxy = 1BEC7A4C1A976E430006FAF6 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin PBXVariantGroup section */ 3056D0AF172D306600CFC0FA /* GPGToolsPref.xib */ = { isa = PBXVariantGroup; diff --git a/Makefile b/Makefile index 335fd4a..17ed057 100644 --- a/Makefile +++ b/Makefile @@ -1,30 +1,14 @@ PROJECT = GPGPreferences TARGET = GPGPreferences -PRODUCT = GPGPreferences -MAKE_DEFAULT = Dependencies/GPGTools_Core/newBuildSystem/Makefile.default -VPATH = build/$(CONFIG)/GPGPreferences.prefPane/Contents/MacOS -NEED_LIBMACGPG = 1 - - --include $(MAKE_DEFAULT) - -.PRECIOUS: $(MAKE_DEFAULT) -$(MAKE_DEFAULT): - @echo "Dependencies/GPGTools_Core is missing.\nPlease clone it manually from https://github.com/GPGTools/GPGTools_Core\n" - @exit 1 - -init: $(MAKE_DEFAULT) - - -$(PRODUCT): Source/* Resources/* Resources/*/* GPGPreferences.xcodeproj - @xcodebuild -project $(PROJECT).xcodeproj -target $(TARGET) -configuration $(CONFIG) build $(XCCONFIG) - -install: $(PRODUCT) - @echo "Installing GPGPreferences into $(INSTALL_ROOT)Library/PreferencePanes" - @mkdir -p "$(INSTALL_ROOT)Library/PreferencePanes" - @rsync -rltDE "build/$(CONFIG)/GPGPreferences.prefPane" "$(INSTALL_ROOT)Library/PreferencePanes" - @echo Done - @echo "In order to use GPGPreferences, please don't forget to install MacGPG2 and Libmacgpg." - - - +PRODUCT = GPGPreferences.prefPane/MacOS/GPGPreferences +VPATH = build/Release +LIBMACGPG_BUILD_PATH = ./Dependencies/Libmacgpg/build +all: $(PRODUCT) + +$(PRODUCT): Source/* Resources/* Resources/*/* $(PROJECT).xcodeproj + @xcodebuild -project $(PROJECT).xcodeproj -target $(TARGET) build $(XCCONFIG) + +clean: + rm -rf "./build" + # Cleanup Libmacgpg if necessary. + @test -d "$(LIBMACGPG_BUILD_PATH)" && rm -rvf "$(LIBMACGPG_BUILD_PATH)" || exit 0 diff --git a/Makefile.config b/Makefile.config index 1639365..bf5313f 100644 --- a/Makefile.config +++ b/Makefile.config @@ -1,17 +1,7 @@ -name="GPGPreferences" -appName="GPGPreferences.prefPane" - -rmName="Uninstall.app" -imgBackground="Installer/background_dmg.png"; -volumeLayout="Installer/DS_Store" - - - -unset REVISION PRERELEASE -#PRERELEASE=b8 - MAJOR=1 MINOR=5 PRERELEASE=b5 -source "$(dirname "${BASH_SOURCE[0]}")/Dependencies/GPGTools_Core/newBuildSystem/versioning.sh" +COMMIT_HASH=$(git rev-parse --short HEAD)$(test -z "$(git status --porcelain)" || echo "+") +VERSION="${MAJOR}.${MINOR}${REVISION:+.$REVISION}${PRERELEASE} ($COMMIT_HASH)" +BUILD_VERSION=0n